Chromium Code Reviews| 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 "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 bool SiteIsolationPolicy::AreCrossProcessFramesPossible() { | 13 bool SiteIsolationPolicy::AreCrossProcessFramesPossible() { |
| 14 // Before turning this on for Android, input event routing needs to be | |
| 15 // completed there, and perf regressions in https://crbug.com/690229 need to be | |
| 16 // investigated. | |
| 17 #if defined(OS_ANDROID) | |
| 18 return false; | |
|
nasko
2017/02/09 21:05:25
Shouldn't this be the old code that we removed? It
alexmos
2017/02/09 21:42:31
Indeed! Thanks for catching, and I'm glad the bot
| |
| 19 #else | |
| 14 return true; | 20 return true; |
| 21 #endif | |
| 15 } | 22 } |
| 16 | 23 |
| 17 // static | 24 // static |
| 18 bool SiteIsolationPolicy::UseDedicatedProcessesForAllSites() { | 25 bool SiteIsolationPolicy::UseDedicatedProcessesForAllSites() { |
| 19 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 26 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 20 switches::kSitePerProcess); | 27 switches::kSitePerProcess); |
| 21 } | 28 } |
| 22 | 29 |
| 23 // static | 30 // static |
| 24 bool SiteIsolationPolicy::IsTopDocumentIsolationEnabled() { | 31 bool SiteIsolationPolicy::IsTopDocumentIsolationEnabled() { |
| 25 // --site-per-process trumps --top-document-isolation. | 32 // --site-per-process trumps --top-document-isolation. |
| 26 if (UseDedicatedProcessesForAllSites()) | 33 if (UseDedicatedProcessesForAllSites()) |
| 27 return false; | 34 return false; |
| 28 | 35 |
| 29 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 36 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 30 switches::kTopDocumentIsolation); | 37 switches::kTopDocumentIsolation); |
| 31 } | 38 } |
| 32 | 39 |
| 33 } // namespace content | 40 } // namespace content |
| OLD | NEW |