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

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 2438823003: BrowserProcessImpl: don't call IsIsolateExtensionsEnabled() too early (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index f01cf1c99c1ce20d112f9abd355c1e7423361395..159c8bc3dc65ed7fb285f08046d09a313c159663 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -221,22 +221,6 @@ BrowserProcessImpl::BrowserProcessImpl(
net_log_path, GetNetCaptureModeFromCommandLine(command_line),
command_line.GetCommandLineString(), chrome::GetChannelString()));
-#if defined(ENABLE_EXTENSIONS)
- if (extensions::IsIsolateExtensionsEnabled()) {
- // chrome-extension:// URLs are safe to request anywhere, but may only
- // commit (including in iframes) in extension processes.
- ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme(
- extensions::kExtensionScheme, true);
- // TODO(nick): Kill off kExtensionResourceScheme.
- ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme(
- extensions::kExtensionResourceScheme, false);
- } else {
- ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(
- extensions::kExtensionScheme);
- ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(
- extensions::kExtensionResourceScheme);
- }
-#endif
ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(
chrome::kChromeSearchScheme);
@@ -1032,6 +1016,26 @@ void BrowserProcessImpl::CreateLocalState() {
}
void BrowserProcessImpl::PreCreateThreads() {
+#if defined(ENABLE_EXTENSIONS)
+ // Register the chrome-extension scheme to reflect the extension process
+ // model. Controlled by a field trial, so we can't do this earlier.
+ base::FieldTrialList::FindFullName("SiteIsolationExtensions");
+ if (extensions::IsIsolateExtensionsEnabled()) {
+ // chrome-extension:// URLs are safe to request anywhere, but may only
+ // commit (including in iframes) in extension processes.
+ ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme(
+ extensions::kExtensionScheme, true);
+ // TODO(nick): Kill off kExtensionResourceScheme.
+ ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme(
+ extensions::kExtensionResourceScheme, false);
+ } else {
+ ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(
+ extensions::kExtensionScheme);
+ ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(
+ extensions::kExtensionResourceScheme);
+ }
+#endif
+
io_thread_.reset(
new IOThread(local_state(), policy_service(), net_log_.get(),
extension_event_router_forwarder()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698