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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Rebase after a month... Created 4 years, 2 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 | components/error_page/common/localized_error.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 31595060204c0f3718b0db713a8fd699b5e872e2..db5f17f311a1e8d308c40c7ba518935ad675660f 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -1014,6 +1014,22 @@ bool ChromeContentRendererClient::ShouldSuppressErrorPage(
NetErrorHelper::Get(render_frame)->ShouldSuppressErrorPage(url)) {
return true;
}
+
+#if defined(ENABLE_EXTENSIONS)
+ // Suppress error pages for the webstore when it's loaded in a frame. This
+ // mitigates confusion which could arise from the fact that error pages commit
+ // with the same URL as the failed load. Since pieces of the browser sometimes
+ // rely on the last-committed URL as a permission check of sorts, and the
+ // webstore is a special flower, this can cause problems that we can avoid by
+ // simply suppressing the error page (see https://crbug.com/622385, for
+ // example).
+ GURL webstore_url(extension_urls::GetWebstoreLaunchURL());
+ if (!render_frame->IsMainFrame() && url.SchemeIsHTTPOrHTTPS() &&
+ url.DomainIs(webstore_url.host().c_str())) {
+ return true;
+ }
+#endif
+
// Do not flash an error page if the Instant new tab page fails to load.
return SearchBouncer::GetInstance()->IsNewTabPage(url);
}
« no previous file with comments | « no previous file | components/error_page/common/localized_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698