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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/prefs/pref_member.h" | 16 #include "base/prefs/pref_member.h" |
17 #include "chrome/browser/net/ssl_config_service_manager.h" | 17 #include "chrome/browser/net/ssl_config_service_manager.h" |
18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
19 #include "content/public/browser/browser_thread_delegate.h" | 19 #include "content/public/browser/browser_thread_delegate.h" |
20 #include "net/base/network_change_notifier.h" | 20 #include "net/base/network_change_notifier.h" |
21 #include "net/http/http_network_session.h" | 21 #include "net/http/http_network_session.h" |
22 #include "net/socket/next_proto.h" | 22 #include "net/socket/next_proto.h" |
23 | 23 |
24 class ChromeNetLog; | 24 class ChromeNetLog; |
25 class CommandLine; | |
26 class PrefProxyConfigTracker; | 25 class PrefProxyConfigTracker; |
27 class PrefService; | 26 class PrefService; |
28 class PrefRegistrySimple; | 27 class PrefRegistrySimple; |
29 class SystemURLRequestContextGetter; | 28 class SystemURLRequestContextGetter; |
30 | 29 |
| 30 namespace base { |
| 31 class CommandLine; |
| 32 } |
| 33 |
31 namespace chrome_browser_net { | 34 namespace chrome_browser_net { |
32 class DnsProbeService; | 35 class DnsProbeService; |
33 class HttpPipeliningCompatibilityClient; | 36 class HttpPipeliningCompatibilityClient; |
34 } | 37 } |
35 | 38 |
36 namespace extensions { | 39 namespace extensions { |
37 class EventRouterForwarder; | 40 class EventRouterForwarder; |
38 } | 41 } |
39 | 42 |
40 namespace net { | 43 namespace net { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // InitSystemRequestContext(). | 218 // InitSystemRequestContext(). |
216 friend class SystemURLRequestContextGetter; | 219 friend class SystemURLRequestContextGetter; |
217 | 220 |
218 // BrowserThreadDelegate implementation, runs on the IO thread. | 221 // BrowserThreadDelegate implementation, runs on the IO thread. |
219 // This handles initialization and destruction of state that must | 222 // This handles initialization and destruction of state that must |
220 // live on the IO thread. | 223 // live on the IO thread. |
221 virtual void Init() OVERRIDE; | 224 virtual void Init() OVERRIDE; |
222 virtual void InitAsync() OVERRIDE; | 225 virtual void InitAsync() OVERRIDE; |
223 virtual void CleanUp() OVERRIDE; | 226 virtual void CleanUp() OVERRIDE; |
224 | 227 |
225 void InitializeNetworkOptions(const CommandLine& parsed_command_line); | 228 void InitializeNetworkOptions(const base::CommandLine& parsed_command_line); |
226 | 229 |
227 // Enable SPDY with the given mode, which may contain the following: | 230 // Enable SPDY with the given mode, which may contain the following: |
228 // | 231 // |
229 // "off" : Disables SPDY support entirely. | 232 // "off" : Disables SPDY support entirely. |
230 // "ssl" : Forces SPDY for all HTTPS requests. | 233 // "ssl" : Forces SPDY for all HTTPS requests. |
231 // "no-ssl" : Forces SPDY for all HTTP requests. | 234 // "no-ssl" : Forces SPDY for all HTTP requests. |
232 // "no-ping" : Disables SPDY ping connection testing. | 235 // "no-ping" : Disables SPDY ping connection testing. |
233 // "exclude=<host>" : Disables SPDY support for the host <host>. | 236 // "exclude=<host>" : Disables SPDY support for the host <host>. |
234 // "no-compress" : Disables SPDY header compression. | 237 // "no-compress" : Disables SPDY header compression. |
235 // "no-alt-protocols : Disables alternate protocol support. | 238 // "no-alt-protocols : Disables alternate protocol support. |
(...skipping 20 matching lines...) Expand all Loading... |
256 | 259 |
257 // Returns an SSLConfigService instance. | 260 // Returns an SSLConfigService instance. |
258 net::SSLConfigService* GetSSLConfigService(); | 261 net::SSLConfigService* GetSSLConfigService(); |
259 | 262 |
260 void ChangedToOnTheRecordOnIOThread(); | 263 void ChangedToOnTheRecordOnIOThread(); |
261 | 264 |
262 void UpdateDnsClientEnabled(); | 265 void UpdateDnsClientEnabled(); |
263 | 266 |
264 // Configures QUIC options based on the flags in |command_line| as | 267 // Configures QUIC options based on the flags in |command_line| as |
265 // well as the QUIC field trial group. | 268 // well as the QUIC field trial group. |
266 void ConfigureQuic(const CommandLine& command_line); | 269 void ConfigureQuic(const base::CommandLine& command_line); |
267 | 270 |
268 // Returns true if QUIC should be enabled, either as a result | 271 // Returns true if QUIC should be enabled, either as a result |
269 // of a field trial or a command line flag. | 272 // of a field trial or a command line flag. |
270 bool ShouldEnableQuic(const CommandLine& command_line, | 273 bool ShouldEnableQuic(const base::CommandLine& command_line, |
271 base::StringPiece quic_trial_group); | 274 base::StringPiece quic_trial_group); |
272 | 275 |
273 // Returns true if HTTPS over QUIC should be enabled, either as a result | 276 // Returns true if HTTPS over QUIC should be enabled, either as a result |
274 // of a field trial or a command line flag. | 277 // of a field trial or a command line flag. |
275 bool ShouldEnableQuicHttps(const CommandLine& command_line, | 278 bool ShouldEnableQuicHttps(const base::CommandLine& command_line, |
276 base::StringPiece quic_trial_group); | 279 base::StringPiece quic_trial_group); |
277 | 280 |
278 // Returns true if the selection of the ephemeral port in bind() should be | 281 // Returns true if the selection of the ephemeral port in bind() should be |
279 // performed by Chromium, and false if the OS should select the port. The OS | 282 // performed by Chromium, and false if the OS should select the port. The OS |
280 // option is used to prevent Windows from posting a security security warning | 283 // option is used to prevent Windows from posting a security security warning |
281 // dialog. | 284 // dialog. |
282 bool ShouldEnableQuicPortSelection(const CommandLine& command_line); | 285 bool ShouldEnableQuicPortSelection(const base::CommandLine& command_line); |
283 | 286 |
284 // Returns true if QUIC packet pacing should be negotiated during the | 287 // Returns true if QUIC packet pacing should be negotiated during the |
285 // QUIC handshake. | 288 // QUIC handshake. |
286 bool ShouldEnableQuicPacing(const CommandLine& command_line, | 289 bool ShouldEnableQuicPacing(const base::CommandLine& command_line, |
287 base::StringPiece quic_trial_group); | 290 base::StringPiece quic_trial_group); |
288 | 291 |
289 // Returns true if Chromium should persist QUIC server config information to | 292 // Returns true if Chromium should persist QUIC server config information to |
290 // disk cache. | 293 // disk cache. |
291 bool ShouldEnableQuicPersistServerInfo(const CommandLine& command_line); | 294 bool ShouldEnableQuicPersistServerInfo(const base::CommandLine& command_line); |
292 | 295 |
293 // Returns the maximum length for QUIC packets, based on any flags in | 296 // Returns the maximum length for QUIC packets, based on any flags in |
294 // |command_line| or the field trial. Returns 0 if there is an error | 297 // |command_line| or the field trial. Returns 0 if there is an error |
295 // parsing any of the options, or if the default value should be used. | 298 // parsing any of the options, or if the default value should be used. |
296 size_t GetQuicMaxPacketLength(const CommandLine& command_line, | 299 size_t GetQuicMaxPacketLength(const base::CommandLine& command_line, |
297 base::StringPiece quic_trial_group); | 300 base::StringPiece quic_trial_group); |
298 | 301 |
299 // Returns the quic versions specified by any flags in |command_line|. | 302 // Returns the quic versions specified by any flags in |command_line|. |
300 net::QuicVersion GetQuicVersion(const CommandLine& command_line); | 303 net::QuicVersion GetQuicVersion(const base::CommandLine& command_line); |
301 | 304 |
302 // The NetLog is owned by the browser process, to allow logging from other | 305 // The NetLog is owned by the browser process, to allow logging from other |
303 // threads during shutdown, but is used most frequently on the IOThread. | 306 // threads during shutdown, but is used most frequently on the IOThread. |
304 ChromeNetLog* net_log_; | 307 ChromeNetLog* net_log_; |
305 | 308 |
306 // The extensions::EventRouterForwarder allows for sending events to | 309 // The extensions::EventRouterForwarder allows for sending events to |
307 // extensions from the IOThread. | 310 // extensions from the IOThread. |
308 extensions::EventRouterForwarder* extension_event_router_forwarder_; | 311 extensions::EventRouterForwarder* extension_event_router_forwarder_; |
309 | 312 |
310 // These member variables are basically global, but their lifetimes are tied | 313 // These member variables are basically global, but their lifetimes are tied |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 356 |
354 // True if SPDY is disabled by policy. | 357 // True if SPDY is disabled by policy. |
355 bool is_spdy_disabled_by_policy_; | 358 bool is_spdy_disabled_by_policy_; |
356 | 359 |
357 base::WeakPtrFactory<IOThread> weak_factory_; | 360 base::WeakPtrFactory<IOThread> weak_factory_; |
358 | 361 |
359 DISALLOW_COPY_AND_ASSIGN(IOThread); | 362 DISALLOW_COPY_AND_ASSIGN(IOThread); |
360 }; | 363 }; |
361 | 364 |
362 #endif // CHROME_BROWSER_IO_THREAD_H_ | 365 #endif // CHROME_BROWSER_IO_THREAD_H_ |
OLD | NEW |