Turn FrameTreeNode::frame_tree into raw_ref.
This patch started as a consequence of this comment, where I asked to
remove all multiple meaningless CHECK:
https://chromium-review.googlesource.com/c/chromium/src/+/3862583/118..119/content/browser/renderer_host/frame_tree_node.cc#b869
The `frame_tree` has always been non null. Chrome used to prefer
pointers, even for non null references. This is changing.
By using a raw_ref, we make it clearer what to expect, and we aren't
going to add meaningless CHECK.
Bug: None
Change-Id: I97a5ad4172387d16348b6510c75099edaf3f5228
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4076211
Commit-Queue: Arthur Sonzogni <[email protected]>
Reviewed-by: Rakina Zata Amni <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1079139}
diff --git a/content/browser/renderer_host/navigation_controller_impl.cc b/content/browser/renderer_host/navigation_controller_impl.cc
index f2e7e503..53a860a 100644
--- a/content/browser/renderer_host/navigation_controller_impl.cc
+++ b/content/browser/renderer_host/navigation_controller_impl.cc
@@ -680,7 +680,7 @@
// discarded API keys.
if (frame_entry->document_sequence_number() !=
frame_tree_node_id_to_doc_seq_nos_[node->frame_tree_node_id()]) {
- for (auto* descendant : node->frame_tree()->SubtreeNodes(node))
+ for (auto* descendant : node->frame_tree().SubtreeNodes(node))
nodes_to_process.erase(descendant);
}
});
@@ -1364,7 +1364,7 @@
// NavigationEntry, by either creating a new object or reusing the previous
// entry's one.
scoped_refptr<BackForwardCacheMetrics> back_forward_cache_metrics;
- if (navigation_request->frame_tree_node()->frame_tree()->type() ==
+ if (navigation_request->frame_tree_node()->frame_tree().type() ==
FrameTree::Type::kPrimary) {
back_forward_cache_metrics = BackForwardCacheMetrics::
CreateOrReuseBackForwardCacheMetricsForNavigation(
@@ -3398,7 +3398,7 @@
node = params.frame_tree_node_id != RenderFrameHost::kNoFrameTreeNodeId
? frame_tree_->FindByID(params.frame_tree_node_id)
: frame_tree_->FindByName(params.frame_name);
- DCHECK(!node || node->frame_tree() == &*frame_tree_);
+ DCHECK(!node || &node->frame_tree() == &frame_tree());
}
// If no FrameTreeNode was specified, navigate the main frame.
@@ -3574,7 +3574,7 @@
// TODO(crbug.com/1254130): Remove the test dependency on this behavior.
if (!url.SchemeIs(url::kJavaScriptScheme)) {
bool was_loading = frame_tree_node->frame_tree()
- ->LoadingTree()
+ .LoadingTree()
->IsLoadingIncludingInnerFrameTrees();
frame_tree_node->current_frame_host()->SetIsLoadingForRendererDebugURL();
frame_tree_node->DidStartLoading(true /* should_show_loading_ui */,