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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.cc

Issue 2541063002: Revert of Remove about:srcdoc url conversion. (Closed)
Patch Set: Created 4 years 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
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 64f5824cfea5ed8875e4bfc5ad15d893b1776d41..6d45ec5856295bb365085ebcbf3cdc14a43bc81d 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.cc
@@ -320,8 +320,13 @@
// 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)
- return;
+ // 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) !=
+ content::kAboutSrcDocURL ||
+ validated_url != 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
@@ -394,7 +399,8 @@
navigation_state_.StartTrackingDocumentLoad(
navigation_handle->GetRenderFrameHost(), navigation_handle->GetURL(),
navigation_handle->IsSamePage(),
- false); // is_error_page
+ false, // is_error_page
+ navigation_handle->IsSrcdoc());
events::HistogramValue histogram_value = events::UNKNOWN;
std::string event_name;
@@ -417,7 +423,8 @@
navigation_state_.StartTrackingDocumentLoad(
navigation_handle->GetRenderFrameHost(), navigation_handle->GetURL(),
navigation_handle->IsSamePage(),
- true); // is_error_page
+ true, // is_error_page
+ navigation_handle->IsSrcdoc());
}
helpers::DispatchOnErrorOccurred(navigation_handle);

Powered by Google App Engine
This is Rietveld 408576698