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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 304313003: Allow view-source of pages fully-blocked by Blink's XSS filter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for landing. Created 6 years, 5 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 | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 918e90defe8aa4ff2b2f62678c4ba7a76bc7055b..689fb7adb2e6dc2922a27ce20cbf340eac4ce52c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -508,6 +508,7 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
OnDomOperationResponse)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidChangeThemeColor,
OnThemeColorChanged)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_DidDetectXSS, OnDidDetectXSS)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad,
OnDocumentLoadedInFrame)
IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishLoad, OnDidFinishLoad)
@@ -2576,6 +2577,26 @@ void WebContentsImpl::OnDidRunInsecureContent(
GetController().GetBrowserContext());
}
+
+void WebContentsImpl::OnDidDetectXSS(int32 page_id,
+ const GURL& url,
+ bool blocked_entire_page) {
+ if (!blocked_entire_page)
+ return;
+
+ int entry_index = controller_.GetEntryIndexWithPageID(
+ GetRenderViewHost()->GetSiteInstance(), page_id);
+ if (entry_index < 0)
+ return;
+
+ NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(
+ controller_.GetEntryAtIndex(entry_index));
+ if (!entry)
+ return;
+
+ entry->set_xss_detected(true);
+}
+
void WebContentsImpl::OnDocumentLoadedInFrame() {
CHECK(render_frame_message_source_);
CHECK(!render_view_message_source_);
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698