Switch away from using page IDs for UpdateTitle
BUG=577449, 369661
TEST=No crash reports
Review-Url: https://codereview.chromium.org/1997983002
Cr-Commit-Position: refs/heads/master@{#395396}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 1dd2a8d..d7d4250 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4424,13 +4424,14 @@
// Try to find the navigation entry, which might not be the current one.
// For example, it might be from a recently swapped out RFH.
- NavigationEntryImpl* entry = controller_.GetEntryWithPageID(
- render_frame_host->GetSiteInstance(), page_id);
-
- // TODO(creis): Switch to use this as the default.
- NavigationEntryImpl* new_entry = controller_.GetEntryWithUniqueID(
+ NavigationEntryImpl* entry = controller_.GetEntryWithUniqueID(
static_cast<RenderFrameHostImpl*>(render_frame_host)->nav_entry_id());
- DCHECK_EQ(entry, new_entry);
+
+ // Sanity check that we would find the same entry via page ID.
+ // TODO(creis): Remove this and all of page_id. https://crbug.com/369661.
+ NavigationEntryImpl* entry_via_page_id = controller_.GetEntryWithPageID(
+ render_frame_host->GetSiteInstance(), page_id);
+ CHECK_EQ(entry, entry_via_page_id);
// We can handle title updates when we don't have an entry in
// UpdateTitleForEntry, but only if the update is from the current RVH.