Index: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
index 2e8522fb0e484f0f6572bcc9d02a8bc66339bad1..3d196e09b27fa34d7bf9add4e5958dbc4aed00e1 100644 |
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc |
@@ -398,12 +398,15 @@ void WebNavigationTabObserver::DidFinishLoad( |
navigation_state_.SetNavigationCompleted(render_frame_host); |
if (!navigation_state_.CanSendEvents(render_frame_host)) |
return; |
- DCHECK(navigation_state_.GetUrl(render_frame_host) == validated_url || |
- (navigation_state_.GetUrl(render_frame_host) == |
- GURL(content::kAboutSrcDocURL) && |
- validated_url == GURL(url::kAboutBlankURL))) |
- << "validated URL is " << validated_url << " but we expected " |
- << navigation_state_.GetUrl(render_frame_host); |
+ |
+ // A new navigation might have started before the old one completed. |
+ // Ignore the old navigation completion in that case. |
+ if (navigation_state_.GetUrl(render_frame_host) != validated_url && |
dcheng
2015/10/08 05:34:35
This first check seems obviously related to the co
Nate Chapin
2015/10/08 21:03:59
Done.
|
+ (navigation_state_.GetUrl(render_frame_host) != |
+ GURL(content::kAboutSrcDocURL) || |
+ validated_url != GURL(url::kAboutBlankURL))) { |
+ return; |
+ } |
// The load might already have finished by the time we finished parsing. For |
// compatibility reasons, we artifically delay the load completed signal until |