Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1023)

Unified Diff: chrome/browser/ui/omnibox/omnibox_navigation_observer.cc

Issue 876203002: Turns out the CHECK I added for debugging can fail due to yet another bad side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
index e5926fb1efbbdf30023467c384763897cc308854..50029406173c543006e3e37fa2132b301f4a7f91 100644
--- a/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
+++ b/chrome/browser/ui/omnibox/omnibox_navigation_observer.cc
@@ -99,9 +99,18 @@ void OmniboxNavigationObserver::Observe(
if (!InfoBarService::FromWebContents(web_contents))
return;
- CHECK_EQ(match_.destination_url,
- content::Details<content::NavigationEntry>(
- details)->GetVirtualURL());
+ // Ignore navgiations to the wrong URL.
+ // This shouldn't actually happen, but right now it's possible because the
+ // prerenderer doesn't properly notify us when it swaps in a prerendered page.
+ // Plus, the swap-in can trigger instant to kick off a new background
+ // prerender, which we _do_ get notified about. Once crbug.com/247848 is
+ // fixed, this conditional should be able to be replaced with a [D]CHECK;
+ // until then we ignore the incorrect navigation (and will be torn down
+ // without having received the correct notification).
+ if (match_.destination_url !=
+ content::Details<content::NavigationEntry>(details)->GetVirtualURL())
+ return;
+
registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
content::NotificationService::AllSources());
if (fetcher_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698