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 |