Use an opaque type for FrameTreeNode IDs, part 1
The type FrameTreeNodeId is in a new file because otherwise it would
have to live in render_frame_host.h, which is very heavyweight, and
it would greatly increase the compile costs of files that didn't have
to include it before but have to include it now.
Bug: 361344235
Change-Id: I5841cd14eb246d4dc7bc20bd419be2760f1166d4
Include-Ci-Only-Tests: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5807683
Owners-Override: Avi Drissman <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Auto-Submit: Avi Drissman <[email protected]>
Commit-Queue: Avi Drissman <[email protected]>
Code-Coverage: [email protected] <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1350315}
diff --git a/content/browser/renderer_host/frame_tree_unittest.cc b/content/browser/renderer_host/frame_tree_unittest.cc
index 4baf016d..3d928c8 100644
--- a/content/browser/renderer_host/frame_tree_unittest.cc
+++ b/content/browser/renderer_host/frame_tree_unittest.cc
@@ -503,7 +503,7 @@
EXPECT_EQ(child1, frame_tree.FindByID(child1->frame_tree_node_id()));
EXPECT_EQ(child2, frame_tree.FindByID(child2->frame_tree_node_id()));
EXPECT_EQ(grandchild, frame_tree.FindByID(grandchild->frame_tree_node_id()));
- EXPECT_EQ(nullptr, frame_tree.FindByID(-1));
+ EXPECT_EQ(nullptr, frame_tree.FindByID(FrameTreeNodeId()));
// Ensure they can be found by routing id.
int process_id = main_test_rfh()->GetProcess()->GetID();
@@ -734,9 +734,9 @@
blink::mojom::FrameOwnerProperties(), kOwnerType, ukm::kInvalidSourceId);
// Ensure they can be found by id.
- int id1 = root->child_at(0)->frame_tree_node_id();
- int id2 = root->child_at(1)->frame_tree_node_id();
- int id3 = root->child_at(0)->child_at(0)->frame_tree_node_id();
+ FrameTreeNodeId id1 = root->child_at(0)->frame_tree_node_id();
+ FrameTreeNodeId id2 = root->child_at(1)->frame_tree_node_id();
+ FrameTreeNodeId id3 = root->child_at(0)->child_at(0)->frame_tree_node_id();
EXPECT_TRUE(FrameTreeNode::GloballyFindByID(id1));
EXPECT_TRUE(FrameTreeNode::GloballyFindByID(id2));
EXPECT_TRUE(FrameTreeNode::GloballyFindByID(id3));