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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 23842002: Whitelisting exts and plugins from cross-site document blocking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Exclude plugins from cross-site document data collection/blocking. Created 7 years, 3 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
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 ef9c3fc04d9a306ee5b4af59a4784042814afd79..08e347c246e2b4d351aa3abdde611e6cf4ffb8bc 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -1305,4 +1305,20 @@ bool ChromeContentRendererClient::ShouldReportDetailedMessageForSource(
return extensions::IsSourceFromAnExtension(source);
}
+bool ChromeContentRendererClient::ShouldEnableSiteIsolationPolicy() const {
+ // SiteIsolationPolicy is off by default. We would like to activate the
+ // cross-site document blocking (for UMA data collection) for normal renderer
+ // processes running an normal web page from the Internet. We only turn on
+ // SiteIsolationPolicy for a renderer process without having the extension
Charlie Reis 2013/09/03 20:22:10 nit: without having -> that does not have
dsjang 2013/09/03 22:31:30 Done.
+ // flag on. Currently, this cannot be turned off for resource requests from
+ // plugins since they request resources via their embedding renderer process.
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ const std::string process_type =
+ command_line->GetSwitchValueASCII(switches::kProcessType);
+ // We only turn on SiteIsolationPolicy for a renderer process without having
+ // the extension flag on.
Charlie Reis 2013/09/03 20:22:10 This comment is redundant with the one above.
dsjang 2013/09/03 22:31:30 Done.
+ DCHECK(process_type == switches::kRendererProcess);
Charlie Reis 2013/09/03 20:22:10 If this passes the try jobs, then I think we can r
dsjang 2013/09/03 22:31:30 Done.
+ return !command_line->HasSwitch(switches::kExtensionProcess);
+}
+
} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698