Index: content/common/site_isolation_policy.cc |
diff --git a/content/common/site_isolation_policy.cc b/content/common/site_isolation_policy.cc |
index afe4f149bf2f2ef64990aeaec626cabfe5f58a24..0423101d001aeee5d1fe236783f3259fe295be20 100644 |
--- a/content/common/site_isolation_policy.cc |
+++ b/content/common/site_isolation_policy.cc |
@@ -11,57 +11,17 @@ |
namespace content { |
-namespace { |
- |
-class SiteIsolationWhitelist { |
- public: |
- SiteIsolationWhitelist() { |
- // Call into the embedder to get the list of isolated schemes from the |
- // command-line configuration. |
- // |
- // TODO(nick): https://crbug.com/133403 Because the AtExitManager doesn't |
- // run between unit tests, it's not possible for unit tests to safely alter |
- // the isolated schemes here. |
- GetContentClient()->AddIsolatedSchemes(&isolated_schemes_); |
- } |
- ~SiteIsolationWhitelist() {} |
- |
- const std::set<std::string>& isolated_schemes() const { |
- return isolated_schemes_; |
- } |
- |
- bool should_isolate_all_sites() const { |
- // TODO(nick): https://crbug.com/133403 We ought to cache the value of this |
- // switch here, but cannot because the AtExitManager doesn't run between |
- // unit tests. |
- return base::CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kSitePerProcess); |
- } |
- |
- private: |
- std::set<std::string> isolated_schemes_; |
- DISALLOW_COPY_AND_ASSIGN(SiteIsolationWhitelist); |
-}; |
- |
-base::LazyInstance<SiteIsolationWhitelist> g_site_isolation_whitelist = |
- LAZY_INSTANCE_INITIALIZER; |
- |
-} // namespace |
- |
// static |
bool SiteIsolationPolicy::AreCrossProcessFramesPossible() { |
- const SiteIsolationWhitelist& whitelist = g_site_isolation_whitelist.Get(); |
- return whitelist.should_isolate_all_sites() || |
- !whitelist.isolated_schemes().empty(); |
+ return base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kSitePerProcess) || |
+ GetContentClient()->IsSupplementarySiteIsolationModeEnabled(); |
} |
// static |
-bool SiteIsolationPolicy::DoesSiteRequireDedicatedProcess( |
- const GURL& effective_url) { |
- const SiteIsolationWhitelist& whitelist = g_site_isolation_whitelist.Get(); |
- return whitelist.should_isolate_all_sites() || |
- (!whitelist.isolated_schemes().empty() && |
- whitelist.isolated_schemes().count(effective_url.scheme())); |
+bool SiteIsolationPolicy::UseDedicatedProcessesForAllSites() { |
+ return base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kSitePerProcess); |
} |
// static |
@@ -76,13 +36,4 @@ bool SiteIsolationPolicy::IsSwappedOutStateForbidden() { |
return AreCrossProcessFramesPossible(); |
} |
-// static |
-bool SiteIsolationPolicy::IsolateAllSitesForTesting() { |
- // TODO(nick): Re-enable once https://crbug.com/133403 is fixed. |
- // if (!(g_site_isolation_whitelist == nullptr)) return false; |
- base::CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kSitePerProcess); |
- return true; |
-} |
- |
} // namespace content |