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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 10834215: Remove static variables from HttpStreamFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typo Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/io_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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::kEnableSpdyCredentialFrames)) 217 if (parsed_command_line.HasSwitch(switches::kEnableSpdyCredentialFrames))
225 net::SpdySession::set_enable_credential_frames(true); 218 net::SpdySession::set_enable_credential_frames(true);
226 219
227 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) { 220 if (parsed_command_line.HasSwitch(switches::kMaxSpdySessionsPerDomain)) {
228 int value; 221 int value;
229 base::StringToInt( 222 base::StringToInt(
230 parsed_command_line.GetSwitchValueASCII( 223 parsed_command_line.GetSwitchValueASCII(
231 switches::kMaxSpdySessionsPerDomain), 224 switches::kMaxSpdySessionsPerDomain),
232 &value); 225 &value);
233 net::SpdySessionPool::set_max_sessions_per_domain(value); 226 net::SpdySessionPool::set_max_sessions_per_domain(value);
234 } 227 }
235 228
236 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) { 229 if (parsed_command_line.HasSwitch(switches::kEnableWebSocketOverSpdy)) {
237 // Enable WebSocket over SPDY. 230 // Enable WebSocket over SPDY.
238 net::WebSocketJob::set_websocket_over_spdy_enabled(true); 231 net::WebSocketJob::set_websocket_over_spdy_enabled(true);
239 } 232 }
240 233
241 if (parsed_command_line.HasSwitch(switches::kEnableHttpPipelining))
242 net::HttpStreamFactory::set_http_pipelining_enabled(true);
243
244 if (parsed_command_line.HasSwitch(switches::kTestingFixedHttpPort)) {
245 int value;
246 base::StringToInt(
247 parsed_command_line.GetSwitchValueASCII(
248 switches::kTestingFixedHttpPort),
249 &value);
250 net::HttpStreamFactory::set_testing_fixed_http_port(value);
251 }
252
253 if (parsed_command_line.HasSwitch(switches::kTestingFixedHttpsPort)) {
254 int value;
255 base::StringToInt(
256 parsed_command_line.GetSwitchValueASCII(
257 switches::kTestingFixedHttpsPort),
258 &value);
259 net::HttpStreamFactory::set_testing_fixed_https_port(value);
260 }
261
262 bool used_spdy_switch = false; 234 bool used_spdy_switch = false;
263 if (parsed_command_line.HasSwitch(switches::kUseSpdy)) { 235 if (parsed_command_line.HasSwitch(switches::kUseSpdy)) {
264 std::string spdy_mode = 236 std::string spdy_mode =
265 parsed_command_line.GetSwitchValueASCII(switches::kUseSpdy); 237 parsed_command_line.GetSwitchValueASCII(switches::kUseSpdy);
266 net::HttpNetworkLayer::EnableSpdy(spdy_mode); 238 net::HttpNetworkLayer::EnableSpdy(spdy_mode);
267 used_spdy_switch = true; 239 used_spdy_switch = true;
268 } 240 }
269 if (parsed_command_line.HasSwitch(switches::kEnableSpdy3)) { 241 if (parsed_command_line.HasSwitch(switches::kEnableSpdy3)) {
270 net::HttpStreamFactory::EnableNpnSpdy3(); 242 net::HttpStreamFactory::EnableNpnSpdy3();
271 used_spdy_switch = true; 243 used_spdy_switch = true;
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 if (base::win::GetVersion() <= base::win::VERSION_XP) 1599 if (base::win::GetVersion() <= base::win::VERSION_XP)
1628 uma_name += "_XP"; 1600 uma_name += "_XP";
1629 1601
1630 uma_name += "_PreRead_"; 1602 uma_name += "_PreRead_";
1631 uma_name += pre_read_percentage; 1603 uma_name += pre_read_percentage;
1632 AddPreReadHistogramTime(uma_name.c_str(), time); 1604 AddPreReadHistogramTime(uma_name.c_str(), time);
1633 } 1605 }
1634 #endif 1606 #endif
1635 #endif 1607 #endif
1636 } 1608 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698