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

Unified Diff: content/common/site_isolation_policy.cc

Issue 1377933004: Modify --isolate-extensions to not isolate hosted apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_isolate_apps3
Patch Set: Fixes from charlie Created 5 years, 2 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 | « content/common/site_isolation_policy.h ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/common/site_isolation_policy.h ('k') | content/public/browser/content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698