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..52462b3b7b5d1f41b1d9bdb337e7a9ae25594068 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,16 @@ 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. |
+ // srcdoc iframes will report a url of about:blank, still let it through. |
+ if (navigation_state_.GetUrl(render_frame_host) != validated_url && |
+ (navigation_state_.GetUrl(render_frame_host) != |
+ GURL(content::kAboutSrcDocURL) || |
+ validated_url != GURL(url::kAboutBlankURL))) { |
+ return; |
nasko
2015/10/12 23:48:24
Does your change imply that a DidFailLoad will be
|
+ } |
// The load might already have finished by the time we finished parsing. For |
// compatibility reasons, we artifically delay the load completed signal until |