| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy); | 1071 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy); |
| 1072 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( | 1072 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
| 1073 net::HttpNetworkSession::NORMAL_SOCKET_POOL, | 1073 net::HttpNetworkSession::NORMAL_SOCKET_POOL, |
| 1074 std::max(std::min(max_per_proxy, 99), | 1074 std::max(std::min(max_per_proxy, 99), |
| 1075 net::ClientSocketPoolManager::max_sockets_per_group( | 1075 net::ClientSocketPoolManager::max_sockets_per_group( |
| 1076 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); | 1076 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 void BrowserProcessImpl::PreCreateThreads() { | 1079 void BrowserProcessImpl::PreCreateThreads() { |
| 1080 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1080 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 1081 // Register the chrome-extension scheme to reflect the extension process | 1081 // chrome-extension:// URLs are safe to request anywhere, but may only |
| 1082 // model. Controlled by a field trial, so we can't do this earlier. | 1082 // commit (including in iframes) in extension processes. |
| 1083 base::FieldTrialList::FindFullName("SiteIsolationExtensions"); | 1083 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme( |
| 1084 if (extensions::IsIsolateExtensionsEnabled()) { | 1084 extensions::kExtensionScheme, true); |
| 1085 // chrome-extension:// URLs are safe to request anywhere, but may only | |
| 1086 // commit (including in iframes) in extension processes. | |
| 1087 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeIsolatedScheme( | |
| 1088 extensions::kExtensionScheme, true); | |
| 1089 } else { | |
| 1090 ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme( | |
| 1091 extensions::kExtensionScheme); | |
| 1092 } | |
| 1093 #endif | 1085 #endif |
| 1094 | 1086 |
| 1095 io_thread_.reset( | 1087 io_thread_.reset( |
| 1096 new IOThread(local_state(), policy_service(), net_log_.get(), | 1088 new IOThread(local_state(), policy_service(), net_log_.get(), |
| 1097 extension_event_router_forwarder())); | 1089 extension_event_router_forwarder())); |
| 1098 } | 1090 } |
| 1099 | 1091 |
| 1100 void BrowserProcessImpl::PreMainMessageLoopRun() { | 1092 void BrowserProcessImpl::PreMainMessageLoopRun() { |
| 1101 TRACE_EVENT0("startup", "BrowserProcessImpl::PreMainMessageLoopRun"); | 1093 TRACE_EVENT0("startup", "BrowserProcessImpl::PreMainMessageLoopRun"); |
| 1102 SCOPED_UMA_HISTOGRAM_TIMER( | 1094 SCOPED_UMA_HISTOGRAM_TIMER( |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 } | 1427 } |
| 1436 | 1428 |
| 1437 void BrowserProcessImpl::OnAutoupdateTimer() { | 1429 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1438 if (CanAutorestartForUpdate()) { | 1430 if (CanAutorestartForUpdate()) { |
| 1439 DLOG(WARNING) << "Detected update. Restarting browser."; | 1431 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1440 RestartBackgroundInstance(); | 1432 RestartBackgroundInstance(); |
| 1441 } | 1433 } |
| 1442 } | 1434 } |
| 1443 | 1435 |
| 1444 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1436 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |