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

Side by Side Diff: content/common/site_isolation_policy.cc

Issue 1378203002: Handle hosted apps consistently in --isolate-extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « content/common/site_isolation_policy.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/site_isolation_policy.h" 5 #include "content/common/site_isolation_policy.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "content/public/common/content_client.h" 9 #include "content/public/common/content_client.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } // namespace 49 } // namespace
50 50
51 // static 51 // static
52 bool SiteIsolationPolicy::AreCrossProcessFramesPossible() { 52 bool SiteIsolationPolicy::AreCrossProcessFramesPossible() {
53 const SiteIsolationWhitelist& whitelist = g_site_isolation_whitelist.Get(); 53 const SiteIsolationWhitelist& whitelist = g_site_isolation_whitelist.Get();
54 return whitelist.should_isolate_all_sites() || 54 return whitelist.should_isolate_all_sites() ||
55 !whitelist.isolated_schemes().empty(); 55 !whitelist.isolated_schemes().empty();
56 } 56 }
57 57
58 // static 58 // static
59 bool SiteIsolationPolicy::DoesSiteRequireDedicatedProcess(const GURL& gurl) { 59 bool SiteIsolationPolicy::DoesSiteRequireDedicatedProcess(
60 const GURL& effective_url) {
60 const SiteIsolationWhitelist& whitelist = g_site_isolation_whitelist.Get(); 61 const SiteIsolationWhitelist& whitelist = g_site_isolation_whitelist.Get();
61 return whitelist.should_isolate_all_sites() || 62 return whitelist.should_isolate_all_sites() ||
62 (!whitelist.isolated_schemes().empty() && 63 (!whitelist.isolated_schemes().empty() &&
63 whitelist.isolated_schemes().count(gurl.scheme())); 64 whitelist.isolated_schemes().count(effective_url.scheme()));
64 } 65 }
65 66
66 // static 67 // static
67 bool SiteIsolationPolicy::UseSubframeNavigationEntries() { 68 bool SiteIsolationPolicy::UseSubframeNavigationEntries() {
68 // Enable the new navigation history behavior if any manner of site isolation 69 // Enable the new navigation history behavior if any manner of site isolation
69 // is active. 70 // is active.
70 return AreCrossProcessFramesPossible(); 71 return AreCrossProcessFramesPossible();
71 } 72 }
72 73
73 // static 74 // static
74 bool SiteIsolationPolicy::IsSwappedOutStateForbidden() { 75 bool SiteIsolationPolicy::IsSwappedOutStateForbidden() {
75 return AreCrossProcessFramesPossible(); 76 return AreCrossProcessFramesPossible();
76 } 77 }
77 78
78 // static 79 // static
79 bool SiteIsolationPolicy::IsolateAllSitesForTesting() { 80 bool SiteIsolationPolicy::IsolateAllSitesForTesting() {
80 // TODO(nick): Re-enable once https://crbug.com/133403 is fixed. 81 // TODO(nick): Re-enable once https://crbug.com/133403 is fixed.
81 // if (!(g_site_isolation_whitelist == nullptr)) return false; 82 // if (!(g_site_isolation_whitelist == nullptr)) return false;
82 base::CommandLine::ForCurrentProcess()->AppendSwitch( 83 base::CommandLine::ForCurrentProcess()->AppendSwitch(
83 switches::kSitePerProcess); 84 switches::kSitePerProcess);
84 return true; 85 return true;
85 } 86 }
86 87
87 } // namespace content 88 } // namespace content
OLDNEW
« no previous file with comments | « content/common/site_isolation_policy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698