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 "ios/chrome/browser/application_context_impl.h" | 5 #include "ios/chrome/browser/application_context_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 created_local_state_ = true; | 191 created_local_state_ = true; |
192 | 192 |
193 base::FilePath local_state_path; | 193 base::FilePath local_state_path; |
194 CHECK(PathService::Get(ios::FILE_LOCAL_STATE, &local_state_path)); | 194 CHECK(PathService::Get(ios::FILE_LOCAL_STATE, &local_state_path)); |
195 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple); | 195 scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple); |
196 | 196 |
197 // Register local state preferences. | 197 // Register local state preferences. |
198 RegisterLocalStatePrefs(pref_registry.get()); | 198 RegisterLocalStatePrefs(pref_registry.get()); |
199 | 199 |
200 local_state_ = ::CreateLocalState( | 200 local_state_ = ::CreateLocalState( |
201 local_state_path, local_state_task_runner_.get(), pref_registry, false); | 201 local_state_path, local_state_task_runner_.get(), pref_registry); |
202 | 202 |
203 const int max_per_proxy = | 203 const int max_per_proxy = |
204 local_state_->GetInteger(ios::prefs::kMaxConnectionsPerProxy); | 204 local_state_->GetInteger(ios::prefs::kMaxConnectionsPerProxy); |
205 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( | 205 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
206 net::HttpNetworkSession::NORMAL_SOCKET_POOL, | 206 net::HttpNetworkSession::NORMAL_SOCKET_POOL, |
207 std::max(std::min(max_per_proxy, 99), | 207 std::max(std::min(max_per_proxy, 99), |
208 net::ClientSocketPoolManager::max_sockets_per_group( | 208 net::ClientSocketPoolManager::max_sockets_per_group( |
209 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); | 209 net::HttpNetworkSession::NORMAL_SOCKET_POOL))); |
210 | 210 |
211 // Register the shutdown state before anything changes it. | 211 // Register the shutdown state before anything changes it. |
212 if (local_state_->HasPrefPath(prefs::kLastSessionExitedCleanly)) { | 212 if (local_state_->HasPrefPath(prefs::kLastSessionExitedCleanly)) { |
213 was_last_shutdown_clean_ = | 213 was_last_shutdown_clean_ = |
214 local_state_->GetBoolean(prefs::kLastSessionExitedCleanly); | 214 local_state_->GetBoolean(prefs::kLastSessionExitedCleanly); |
215 } | 215 } |
216 } | 216 } |
OLD | NEW |