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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 void InitializeNetworkOptions(const CommandLine& parsed_command_line) { | 204 void InitializeNetworkOptions(const CommandLine& parsed_command_line) { |
205 if (parsed_command_line.HasSwitch(switches::kEnableFileCookies)) { | 205 if (parsed_command_line.HasSwitch(switches::kEnableFileCookies)) { |
206 // Enable cookie storage for file:// URLs. Must do this before the first | 206 // Enable cookie storage for file:// URLs. Must do this before the first |
207 // Profile (and therefore the first CookieMonster) is created. | 207 // Profile (and therefore the first CookieMonster) is created. |
208 net::CookieMonster::EnableFileScheme(); | 208 net::CookieMonster::EnableFileScheme(); |
209 } | 209 } |
210 | 210 |
211 if (parsed_command_line.HasSwitch(switches::kIgnoreCertificateErrors)) | |
212 net::HttpStreamFactory::set_ignore_certificate_errors(true); | |
213 | |
214 if (parsed_command_line.HasSwitch(switches::kHostRules)) | |
215 net::HttpStreamFactory::SetHostMappingRules( | |
216 parsed_command_line.GetSwitchValueASCII(switches::kHostRules)); | |
217 | |
218 if (parsed_command_line.HasSwitch(switches::kEnableIPPooling)) | 211 if (parsed_command_line.HasSwitch(switches::kEnableIPPooling)) |
219 net::SpdySessionPool::enable_ip_pooling(true); | 212 net::SpdySessionPool::enable_ip_pooling(true); |
220 | 213 |
221 if (parsed_command_line.HasSwitch(switches::kDisableIPPooling)) | 214 if (parsed_command_line.HasSwitch(switches::kDisableIPPooling)) |
222 net::SpdySessionPool::enable_ip_pooling(false); | 215 net::SpdySessionPool::enable_ip_pooling(false); |
223 | 216 |
224 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) { | 217 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) { |
225 int value; | 218 int value; |
226 base::StringToInt( | 219 base::StringToInt( |
227 parsed_command_line.GetSwitchValueASCII( | 220 parsed_command_line.GetSwitchValueASCII( |
228 switches::kMaxSpdySessionsPerDomain), | 221 switches::kMaxSpdySessionsPerDomain), |
229 &value); | 222 &value); |
230 net::SpdySessionPool::set_max_sessions_per_domain(value); | 223 net::SpdySessionPool::set_max_sessions_per_domain(value); |
231 } | 224 } |
232 | 225 |
233 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { | 226 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { |
234 // Enable WebSocket over SPDY. | 227 // Enable WebSocket over SPDY. |
235 net::WebSocketJob::set_websocket_over_spdy_enabled(true); | 228 net::WebSocketJob::set_websocket_over_spdy_enabled(true); |
236 } | 229 } |
237 | 230 |
238 if (parsed_command_line.HasSwitch(switches::kEnableHttpPipelining)) | |
239 net::HttpStreamFactory::set_http_pipelining_enabled(true); | |
240 | |
241 if (parsed_command_line.HasSwitch(switches::kTestingFixedHttpPort)) { | |
242 int value; | |
243 base::StringToInt( | |
244 parsed_command_line.GetSwitchValueASCII( | |
245 switches::kTestingFixedHttpPort), | |
246 &value); | |
247 net::HttpStreamFactory::set_testing_fixed_http_port(value); | |
248 } | |
249 | |
250 if (parsed_command_line.HasSwitch(switches::kTestingFixedHttpsPort)) { | |
251 int value; | |
252 base::StringToInt( | |
253 parsed_command_line.GetSwitchValueASCII( | |
254 switches::kTestingFixedHttpsPort), | |
255 &value); | |
256 net::HttpStreamFactory::set_testing_fixed_https_port(value); | |
257 } | |
258 | |
259 bool used_spdy_switch = false; | 231 bool used_spdy_switch = false; |
260 if (parsed_command_line.HasSwitch(switches::kUseSpdy)) { | 232 if (parsed_command_line.HasSwitch(switches::kUseSpdy)) { |
261 std::string spdy_mode = | 233 std::string spdy_mode = |
262 parsed_command_line.GetSwitchValueASCII(switches::kUseSpdy); | 234 parsed_command_line.GetSwitchValueASCII(switches::kUseSpdy); |
263 net::HttpNetworkLayer::EnableSpdy(spdy_mode); | 235 net::HttpNetworkLayer::EnableSpdy(spdy_mode); |
264 used_spdy_switch = true; | 236 used_spdy_switch = true; |
265 } | 237 } |
266 if (parsed_command_line.HasSwitch(switches::kEnableSpdy3)) { | 238 if (parsed_command_line.HasSwitch(switches::kEnableSpdy3)) { |
267 net::HttpStreamFactory::EnableNpnSpdy3(); | 239 net::HttpStreamFactory::EnableNpnSpdy3(); |
268 used_spdy_switch = true; | 240 used_spdy_switch = true; |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 if (base::win::GetVersion() <= base::win::VERSION_XP) | 1596 if (base::win::GetVersion() <= base::win::VERSION_XP) |
1625 uma_name += "_XP"; | 1597 uma_name += "_XP"; |
1626 | 1598 |
1627 uma_name += "_PreRead_"; | 1599 uma_name += "_PreRead_"; |
1628 uma_name += pre_read_percentage; | 1600 uma_name += pre_read_percentage; |
1629 AddPreReadHistogramTime(uma_name.c_str(), time); | 1601 AddPreReadHistogramTime(uma_name.c_str(), time); |
1630 } | 1602 } |
1631 #endif | 1603 #endif |
1632 #endif | 1604 #endif |
1633 } | 1605 } |
OLD | NEW |