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

Unified Diff: content/public/common/site_isolation_policy.cc

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Partial fixes to Nasko's comments. Created 5 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
Index: content/public/common/site_isolation_policy.cc
diff --git a/content/public/common/site_isolation_policy.cc b/content/public/common/site_isolation_policy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a50a28a397789c61e5bf40fc69823d2c2db4860e
--- /dev/null
+++ b/content/public/common/site_isolation_policy.cc
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/public/common/site_isolation_policy.h"
+
+#include "content/public/common/content_switches.h"
+
+namespace content {
+
+// static
+bool SiteIsolationPolicy::AreCrossProcessFramesPossible() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess);
+}
+
+// static
+bool SiteIsolationPolicy::DoesSiteRequireDedicatedProcess(const GURL& gurl) {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess);
+}
+
+// static
+bool SiteIsolationPolicy::UseSubframeNavigationEntries() {
+ return AreCrossProcessFramesPossible();
Charlie Reis 2015/07/13 22:13:15 Why does this one call one of the others when the
+}
+
+// static
+bool SiteIsolationPolicy::GuestsShouldUseCrossProcessFrames() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess);
+}
+
+// static
+void SiteIsolationPolicy::IsolateAllSitesForTesting(
+ base::CommandLine* command_line) {
+ command_line->AppendSwitch(switches::kSitePerProcess);
+}
+
+// static
+bool SiteIsolationPolicy::AreAllSitesIsolatedForTesting() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess);
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698