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

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: Created 7 years, 4 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 | content/child/site_isolation_policy.h » ('j') | content/child/site_isolation_policy.h » ('J')
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 1fa7a9cc91667b06716abe8facba1a0671e46219..58643ff06c087acf34c23ba4ca272ebe2626fee1 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -66,6 +66,7 @@
#include "components/autofill/content/renderer/password_autofill_agent.h"
#include "components/autofill/content/renderer/password_generation_manager.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
+#include "content/child/site_isolation_policy.h"
Charlie Reis 2013/09/03 16:43:23 Yeah, we can only include things from content/publ
dsjang 2013/09/03 19:13:11 Done.
#include "content/public/common/content_constants.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
@@ -345,6 +346,19 @@ void ChromeContentRendererClient::RenderThreadStarted() {
extensions::ExtensionsClient::Set(
extensions::ChromeExtensionsClient::GetInstance());
+
+ // SiteIsolationPolicy is off by default. We only activate the cross-site
+ // document blocking (for UMA data collection) for normal renderer processes
+ // running an normal web page.
+
+ 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.
+ content::SiteIsolationPolicy::SetPolicyActivationFlag(
+ process_type == switches::kRendererProcess &&
Charlie Reis 2013/09/03 16:43:23 This check doesn't seem necessary. I think we can
dsjang 2013/09/03 19:13:11 Done.
+ !command_line->HasSwitch(switches::kExtensionProcess));
}
void ChromeContentRendererClient::RenderViewCreated(
« no previous file with comments | « no previous file | content/child/site_isolation_policy.h » ('j') | content/child/site_isolation_policy.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698