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 #ifndef CHROME_BROWSER_IO_THREAD_H_ | 5 #ifndef CHROME_BROWSER_IO_THREAD_H_ |
6 #define CHROME_BROWSER_IO_THREAD_H_ | 6 #define CHROME_BROWSER_IO_THREAD_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 net::HttpNetworkSession::Params* params); | 264 net::HttpNetworkSession::Params* params); |
265 | 265 |
266 void InitializeNetworkOptions(const base::CommandLine& parsed_command_line); | 266 void InitializeNetworkOptions(const base::CommandLine& parsed_command_line); |
267 | 267 |
268 // Sets up TCP FastOpen if enabled via field trials or via the command line. | 268 // Sets up TCP FastOpen if enabled via field trials or via the command line. |
269 void ConfigureTCPFastOpen(const base::CommandLine& command_line); | 269 void ConfigureTCPFastOpen(const base::CommandLine& command_line); |
270 | 270 |
271 // Sets up SDCH based on field trials. | 271 // Sets up SDCH based on field trials. |
272 void ConfigureSdch(); | 272 void ConfigureSdch(); |
273 | 273 |
274 // Enable SPDY with the given mode, which may contain the following: | 274 // Configures available SPDY protocol versions in |globals| based on the flags |
275 // | 275 // in |command_lin| as well as SPDY field trial group and parameters. Must be |
276 // "off" : Disables SPDY support entirely. | 276 // called after ConfigureQuicGlobals. |
277 // "ssl" : Forces SPDY for all HTTPS requests. | 277 static void ConfigureSpdyGlobals(const base::CommandLine& command_line, |
278 // "no-ssl" : Forces SPDY for all HTTP requests. | 278 base::StringPiece quic_trial_group, |
279 // "no-ping" : Disables SPDY ping connection testing. | 279 const VariationParameters& quic_trial_params, |
280 // "exclude=<host>" : Disables SPDY support for the host <host>. | 280 Globals* globals); |
281 // "no-compress" : Disables SPDY header compression. | |
282 // "no-alt-protocols : Disables alternate protocol support. | |
283 // "force-alt-protocols : Forces an alternate protocol of SPDY/3 | |
284 // on port 443. | |
285 // "single-domain" : Forces all spdy traffic to a single domain. | |
286 // "init-max-streams=<limit>" : Specifies the maximum number of concurrent | |
287 // streams for a SPDY session, unless the | |
288 // specifies a different value via SETTINGS. | |
289 void EnableSpdy(const std::string& mode); | |
290 | |
291 // Configures available SPDY protocol versions from the given trial. | |
292 // Used only if no command-line configuration was present. | |
293 static void ConfigureSpdyFromTrial(base::StringPiece spdy_trial_group, | |
294 Globals* globals); | |
295 | 281 |
296 // Global state must be initialized on the IO thread, then this | 282 // Global state must be initialized on the IO thread, then this |
297 // method must be invoked on the UI thread. | 283 // method must be invoked on the UI thread. |
298 void InitSystemRequestContext(); | 284 void InitSystemRequestContext(); |
299 | 285 |
300 // Lazy initialization of system request context for | 286 // Lazy initialization of system request context for |
301 // SystemURLRequestContextGetter. To be called on IO thread only | 287 // SystemURLRequestContextGetter. To be called on IO thread only |
302 // after global state has been initialized on the IO thread, and | 288 // after global state has been initialized on the IO thread, and |
303 // SystemRequestContext state has been initialized on the UI thread. | 289 // SystemRequestContext state has been initialized on the UI thread. |
304 void InitSystemRequestContextOnIOThread(); | 290 void InitSystemRequestContextOnIOThread(); |
(...skipping 13 matching lines...) Expand all Loading... |
318 void ConfigureQuic(const base::CommandLine& command_line); | 304 void ConfigureQuic(const base::CommandLine& command_line); |
319 | 305 |
320 extensions::EventRouterForwarder* extension_event_router_forwarder() { | 306 extensions::EventRouterForwarder* extension_event_router_forwarder() { |
321 #if defined(ENABLE_EXTENSIONS) | 307 #if defined(ENABLE_EXTENSIONS) |
322 return extension_event_router_forwarder_; | 308 return extension_event_router_forwarder_; |
323 #else | 309 #else |
324 return NULL; | 310 return NULL; |
325 #endif | 311 #endif |
326 } | 312 } |
327 // Configures QUIC options in |globals| based on the flags in |command_line| | 313 // Configures QUIC options in |globals| based on the flags in |command_line| |
328 // as well as the QUIC field trial group and parameters. | 314 // as well as the QUIC field trial group and parameters. Must be called |
| 315 // before ConfigureSpdyGlobals. |
329 static void ConfigureQuicGlobals( | 316 static void ConfigureQuicGlobals( |
330 const base::CommandLine& command_line, | 317 const base::CommandLine& command_line, |
331 base::StringPiece quic_trial_group, | 318 base::StringPiece quic_trial_group, |
332 const VariationParameters& quic_trial_params, | 319 const VariationParameters& quic_trial_params, |
333 Globals* globals); | 320 Globals* globals); |
334 | 321 |
335 // Returns true if QUIC should be enabled, either as a result | 322 // Returns true if QUIC should be enabled, either as a result |
336 // of a field trial or a command line flag. | 323 // of a field trial or a command line flag. |
337 static bool ShouldEnableQuic( | 324 static bool ShouldEnableQuic( |
338 const base::CommandLine& command_line, | 325 const base::CommandLine& command_line, |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 bool is_spdy_disabled_by_policy_; | 461 bool is_spdy_disabled_by_policy_; |
475 | 462 |
476 const base::TimeTicks creation_time_; | 463 const base::TimeTicks creation_time_; |
477 | 464 |
478 base::WeakPtrFactory<IOThread> weak_factory_; | 465 base::WeakPtrFactory<IOThread> weak_factory_; |
479 | 466 |
480 DISALLOW_COPY_AND_ASSIGN(IOThread); | 467 DISALLOW_COPY_AND_ASSIGN(IOThread); |
481 }; | 468 }; |
482 | 469 |
483 #endif // CHROME_BROWSER_IO_THREAD_H_ | 470 #endif // CHROME_BROWSER_IO_THREAD_H_ |
OLD | NEW |