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

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: Remove stray debugging include. Created 6 years, 7 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/view_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 8918d4311a0a1189bb8c01fb0b1c102ea91ebe3e..681cc5cb911dd969c782d8115ffcff296da16c53 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -524,6 +524,7 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
OnDidDisplayInsecureContent)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent,
OnDidRunInsecureContent)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_DidDetectXSS, OnDidDetectXSS)
IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits)
IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory)
@@ -2549,6 +2550,15 @@ void WebContentsImpl::OnDidRunInsecureContent(
GetController().GetBrowserContext());
}
+void WebContentsImpl::OnDidDetectXSS(const GURL& url,
+ bool blocked_entire_page) {
+ NavigationEntry* entry = controller_.GetLastCommittedEntry();
sky 2014/06/03 22:12:16 How do you know lastcommittedentry is the right en
+ if (!entry)
+ return;
+ entry->SetExtraData("XSSDetected",
+ base::ASCIIToUTF16(blocked_entire_page ? "1" : "0"));
+}
+
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/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698