| OLD | NEW |
| 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/browser_plugin_guest_mode.h" | 9 #include "content/public/common/browser_plugin_guest_mode.h" |
| 10 #include "content/public/common/browser_side_navigation_policy.h" | 10 #include "content/public/common/browser_side_navigation_policy.h" |
| 11 #include "content/public/common/content_client.h" | 11 #include "content/public/common/content_client.h" |
| 12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 bool SiteIsolationPolicy::AreCrossProcessFramesPossible() { | 17 bool SiteIsolationPolicy::AreCrossProcessFramesPossible() { |
| 18 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 18 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 19 switches::kSitePerProcess) || | 19 switches::kSitePerProcess) || |
| 20 base:: CommandLine:: ForCurrentProcess()-> HasSwitch( |
| 21 switches:: kDogHouseProcess) || |
| 20 GetContentClient()->IsSupplementarySiteIsolationModeEnabled() || | 22 GetContentClient()->IsSupplementarySiteIsolationModeEnabled() || |
| 21 BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); | 23 BrowserPluginGuestMode::UseCrossProcessFramesForGuests(); |
| 22 } | 24 } |
| 23 | 25 |
| 24 // static | 26 // static |
| 25 bool SiteIsolationPolicy::UseDedicatedProcessesForAllSites() { | 27 bool SiteIsolationPolicy::UseDedicatedProcessesForAllSites() { |
| 26 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 28 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 27 switches::kSitePerProcess); | 29 switches::kSitePerProcess) || |
| 30 base:: CommandLine:: ForCurrentProcess()->HasSwitch( |
| 31 switches:: kDogHouseProcess); |
| 28 } | 32 } |
| 29 | 33 |
| 30 // static | 34 // static |
| 31 bool SiteIsolationPolicy::UseSubframeNavigationEntries() { | 35 bool SiteIsolationPolicy::UseSubframeNavigationEntries() { |
| 32 // Enable the new navigation history behavior if any manner of site isolation | 36 // Enable the new navigation history behavior if any manner of site isolation |
| 33 // is active. | 37 // is active. |
| 34 // PlzNavigate: also enable the new navigation history behavior. | 38 // PlzNavigate: also enable the new navigation history behavior. |
| 35 return AreCrossProcessFramesPossible() || IsBrowserSideNavigationEnabled(); | 39 return AreCrossProcessFramesPossible() || IsBrowserSideNavigationEnabled(); |
| 36 } | 40 } |
| 37 | 41 |
| 38 } // namespace content | 42 } // namespace content |
| OLD | NEW |