Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 // https://crbug.com/160576 workaround: Origin lock to the chrome-extension:// | 211 // https://crbug.com/160576 workaround: Origin lock to the chrome-extension:// |
| 212 // scheme for a hosted app would kill processes on legitimate requests for the | 212 // scheme for a hosted app would kill processes on legitimate requests for the |
| 213 // app's cookies. | 213 // app's cookies. |
| 214 if (effective_site_url.SchemeIs(extensions::kExtensionScheme)) { | 214 if (effective_site_url.SchemeIs(extensions::kExtensionScheme)) { |
| 215 const Extension* extension = | 215 const Extension* extension = |
| 216 ExtensionRegistry::Get(browser_context) | 216 ExtensionRegistry::Get(browser_context) |
| 217 ->enabled_extensions() | 217 ->enabled_extensions() |
| 218 .GetExtensionOrAppByURL(effective_site_url); | 218 .GetExtensionOrAppByURL(effective_site_url); |
| 219 if (extension && extension->is_hosted_app()) | 219 if (extension && extension->is_hosted_app()) |
| 220 return false; | 220 return false; |
| 221 | |
| 222 // http://crbug.com/600441 workaround - Extension process reuse (implemented | |
| 223 // above, in ShouldTryToUseExistingProcessHost) means that extension | |
|
Devlin
2016/04/07 15:06:37
nit: actually implemented below, right? Might be
ncarter (slow)
2016/04/07 21:41:09
Done.
| |
| 224 // processes aren't always actually dedicated to a single origin, even in | |
| 225 // --isolate-extensions. TODO(nick): Fix this. | |
| 226 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 227 ::switches::kSitePerProcess)) | |
| 228 return false; | |
| 221 } | 229 } |
| 222 return true; | 230 return true; |
| 223 } | 231 } |
| 224 | 232 |
| 225 // static | 233 // static |
| 226 bool ChromeContentBrowserClientExtensionsPart::CanCommitURL( | 234 bool ChromeContentBrowserClientExtensionsPart::CanCommitURL( |
| 227 content::RenderProcessHost* process_host, const GURL& url) { | 235 content::RenderProcessHost* process_host, const GURL& url) { |
| 228 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 236 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 229 | 237 |
| 230 // We need to let most extension URLs commit in any process, since this can | 238 // We need to let most extension URLs commit in any process, since this can |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 613 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); | 621 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); |
| 614 #endif | 622 #endif |
| 615 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 623 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 616 switches::kEnableMojoSerialService)) { | 624 switches::kEnableMojoSerialService)) { |
| 617 command_line->AppendSwitch(switches::kEnableMojoSerialService); | 625 command_line->AppendSwitch(switches::kEnableMojoSerialService); |
| 618 } | 626 } |
| 619 } | 627 } |
| 620 } | 628 } |
| 621 | 629 |
| 622 } // namespace extensions | 630 } // namespace extensions |
| OLD | NEW |