| 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/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 } | 201 } |
| 202 | 202 |
| 203 void InitializeNetworkOptions(const CommandLine& parsed_command_line) { | 203 void InitializeNetworkOptions(const CommandLine& parsed_command_line) { |
| 204 if (parsed_command_line.HasSwitch(switches::kEnableFileCookies)) { | 204 if (parsed_command_line.HasSwitch(switches::kEnableFileCookies)) { |
| 205 // Enable cookie storage for file:// URLs. Must do this before the first | 205 // Enable cookie storage for file:// URLs. Must do this before the first |
| 206 // Profile (and therefore the first CookieMonster) is created. | 206 // Profile (and therefore the first CookieMonster) is created. |
| 207 net::CookieMonster::EnableFileScheme(); | 207 net::CookieMonster::EnableFileScheme(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 if (parsed_command_line.HasSwitch(switches::kIgnoreCertificateErrors)) | |
| 211 net::HttpStreamFactory::set_ignore_certificate_errors(true); | |
| 212 | |
| 213 if (parsed_command_line.HasSwitch(switches::kHostRules)) | |
| 214 net::HttpStreamFactory::SetHostMappingRules( | |
| 215 parsed_command_line.GetSwitchValueASCII(switches::kHostRules)); | |
| 216 | |
| 217 if (parsed_command_line.HasSwitch(switches::kEnableIPPooling)) | 210 if (parsed_command_line.HasSwitch(switches::kEnableIPPooling)) |
| 218 net::SpdySessionPool::enable_ip_pooling(true); | 211 net::SpdySessionPool::enable_ip_pooling(true); |
| 219 | 212 |
| 220 if (parsed_command_line.HasSwitch(switches::kDisableIPPooling)) | 213 if (parsed_command_line.HasSwitch(switches::kDisableIPPooling)) |
| 221 net::SpdySessionPool::enable_ip_pooling(false); | 214 net::SpdySessionPool::enable_ip_pooling(false); |
| 222 | 215 |
| 223 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) { | 216 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) { |
| 224 int value; | 217 int value; |
| 225 base::StringToInt( | 218 base::StringToInt( |
| 226 parsed_command_line.GetSwitchValueASCII( | 219 parsed_command_line.GetSwitchValueASCII( |
| 227 switches::kMaxSpdySessionsPerDomain), | 220 switches::kMaxSpdySessionsPerDomain), |
| 228 &value); | 221 &value); |
| 229 net::SpdySessionPool::set_max_sessions_per_domain(value); | 222 net::SpdySessionPool::set_max_sessions_per_domain(value); |
| 230 } | 223 } |
| 231 | 224 |
| 232 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 225 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
| 233 // Enable WebSocket over SPDY. | 226 // Enable WebSocket over SPDY. |
| 234 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | 227 net::WebSocketJob::set_websocket_over_spdy_enabled(true); |
| 235 } | 228 } |
| 236 | |
| 237 if (parsed_command_line.HasSwitch(switches::kEnableHttpPipelining)) | |
| 238 net::HttpStreamFactory::set_http_pipelining_enabled(true); | |
| 239 | |
| 240 if (parsed_command_line.HasSwitch(switches::kTestingFixedHttpPort)) { | |
| 241 int value; | |
| 242 base::StringToInt( | |
| 243 parsed_command_line.GetSwitchValueASCII( | |
| 244 switches::kTestingFixedHttpPort), | |
| 245 &value); | |
| 246 net::HttpStreamFactory::set_testing_fixed_http_port(value); | |
| 247 } | |
| 248 | |
| 249 if (parsed_command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | |
| 250 int value; | |
| 251 base::StringToInt( | |
| 252 parsed_command_line.GetSwitchValueASCII( | |
| 253 switches::kTestingFixedHttpsPort), | |
| 254 &value); | |
| 255 net::HttpStreamFactory::set_testing_fixed_https_port(value); | |
| 256 } | |
| 257 } | 229 } |
| 258 | 230 |
| 259 // Returns the new local state object, guaranteed non-NULL. | 231 // Returns the new local state object, guaranteed non-NULL. |
| 260 PrefService* InitializeLocalState(const CommandLine& parsed_command_line, | 232 PrefService* InitializeLocalState(const CommandLine& parsed_command_line, |
| 261 bool is_first_run) { | 233 bool is_first_run) { |
| 262 FilePath local_state_path; | 234 FilePath local_state_path; |
| 263 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); | 235 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
| 264 bool local_state_file_exists = file_util::PathExists(local_state_path); | 236 bool local_state_file_exists = file_util::PathExists(local_state_path); |
| 265 | 237 |
| 266 // Load local state. This includes the application locale so we know which | 238 // Load local state. This includes the application locale so we know which |
| (...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1574 if (base::win::GetVersion() <= base::win::VERSION_XP) |
| 1603 uma_name += "_XP"; | 1575 uma_name += "_XP"; |
| 1604 | 1576 |
| 1605 uma_name += "_PreRead_"; | 1577 uma_name += "_PreRead_"; |
| 1606 uma_name += pre_read_percentage; | 1578 uma_name += pre_read_percentage; |
| 1607 AddPreReadHistogramTime(uma_name.c_str(), time); | 1579 AddPreReadHistogramTime(uma_name.c_str(), time); |
| 1608 } | 1580 } |
| 1609 #endif | 1581 #endif |
| 1610 #endif | 1582 #endif |
| 1611 } | 1583 } |
| OLD | NEW |