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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/prefs/pref_member.h" | 18 #include "base/prefs/pref_member.h" |
19 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
21 #include "chrome/browser/net/chrome_network_delegate.h" | 21 #include "chrome/browser/net/chrome_network_delegate.h" |
22 #include "chrome/browser/net/ssl_config_service_manager.h" | 22 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 23 #include "components/data_usage/core/data_use_aggregator.h" |
23 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
24 #include "content/public/browser/browser_thread_delegate.h" | 25 #include "content/public/browser/browser_thread_delegate.h" |
25 #include "net/base/network_change_notifier.h" | 26 #include "net/base/network_change_notifier.h" |
26 #include "net/http/http_network_session.h" | 27 #include "net/http/http_network_session.h" |
27 #include "net/socket/next_proto.h" | 28 #include "net/socket/next_proto.h" |
28 | 29 |
29 class PrefProxyConfigTracker; | 30 class PrefProxyConfigTracker; |
30 class PrefService; | 31 class PrefService; |
31 class PrefRegistrySimple; | 32 class PrefRegistrySimple; |
32 class SystemURLRequestContextGetter; | 33 class SystemURLRequestContextGetter; |
33 | 34 |
34 namespace base { | 35 namespace base { |
35 class CommandLine; | 36 class CommandLine; |
36 } | 37 } |
37 | 38 |
38 namespace chrome_browser_net { | 39 namespace chrome_browser_net { |
39 class DnsProbeService; | 40 class DnsProbeService; |
40 } | 41 } |
41 | 42 |
42 namespace extensions { | 43 namespace extensions { |
43 class EventRouterForwarder; | 44 class EventRouterForwarder; |
44 } | 45 } |
45 | 46 |
46 namespace data_usage { | |
47 class DataUseAggregator; | |
48 } | |
49 | |
50 namespace net { | 47 namespace net { |
51 class CertPolicyEnforcer; | 48 class CertPolicyEnforcer; |
52 class CertVerifier; | 49 class CertVerifier; |
53 class ChannelIDService; | 50 class ChannelIDService; |
54 class CookieStore; | 51 class CookieStore; |
55 class CTVerifier; | 52 class CTVerifier; |
56 class FtpTransactionFactory; | 53 class FtpTransactionFactory; |
57 class HostMappingRules; | 54 class HostMappingRules; |
58 class HostResolver; | 55 class HostResolver; |
59 class HttpAuthHandlerFactory; | 56 class HttpAuthHandlerFactory; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 explicit SystemRequestContextLeakChecker(Globals* globals); | 117 explicit SystemRequestContextLeakChecker(Globals* globals); |
121 ~SystemRequestContextLeakChecker(); | 118 ~SystemRequestContextLeakChecker(); |
122 | 119 |
123 private: | 120 private: |
124 Globals* const globals_; | 121 Globals* const globals_; |
125 }; | 122 }; |
126 | 123 |
127 Globals(); | 124 Globals(); |
128 ~Globals(); | 125 ~Globals(); |
129 | 126 |
130 // Global aggregator of data use. It must outlive the | |
131 // |system_network_delegate|. | |
132 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator; | |
133 // The "system" NetworkDelegate, used for Profile-agnostic network events. | 127 // The "system" NetworkDelegate, used for Profile-agnostic network events. |
134 scoped_ptr<net::NetworkDelegate> system_network_delegate; | 128 scoped_ptr<net::NetworkDelegate> system_network_delegate; |
135 scoped_ptr<net::HostResolver> host_resolver; | 129 scoped_ptr<net::HostResolver> host_resolver; |
136 scoped_ptr<net::CertVerifier> cert_verifier; | 130 scoped_ptr<net::CertVerifier> cert_verifier; |
137 // The ChannelIDService must outlive the HttpTransactionFactory. | 131 // The ChannelIDService must outlive the HttpTransactionFactory. |
138 scoped_ptr<net::ChannelIDService> system_channel_id_service; | 132 scoped_ptr<net::ChannelIDService> system_channel_id_service; |
139 // This TransportSecurityState doesn't load or save any state. It's only | 133 // This TransportSecurityState doesn't load or save any state. It's only |
140 // used to enforce pinning for system requests and will only use built-in | 134 // used to enforce pinning for system requests and will only use built-in |
141 // pins. | 135 // pins. |
142 scoped_ptr<net::TransportSecurityState> transport_security_state; | 136 scoped_ptr<net::TransportSecurityState> transport_security_state; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 | 243 |
250 // Clears the host cache. Intended to be used to prevent exposing recently | 244 // Clears the host cache. Intended to be used to prevent exposing recently |
251 // visited sites on about:net-internals/#dns and about:dns pages. Must be | 245 // visited sites on about:net-internals/#dns and about:dns pages. Must be |
252 // called on the IO thread. | 246 // called on the IO thread. |
253 void ClearHostCache(); | 247 void ClearHostCache(); |
254 | 248 |
255 void InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params); | 249 void InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params); |
256 | 250 |
257 base::TimeTicks creation_time() const; | 251 base::TimeTicks creation_time() const; |
258 | 252 |
| 253 data_usage::DataUseAggregator* data_use_aggregator() const; |
| 254 |
259 // Returns true if QUIC should be enabled for data reduction proxy, either as | 255 // Returns true if QUIC should be enabled for data reduction proxy, either as |
260 // a result of a field trial or a command line flag. | 256 // a result of a field trial or a command line flag. |
261 static bool ShouldEnableQuicForDataReductionProxy(); | 257 static bool ShouldEnableQuicForDataReductionProxy(); |
262 | 258 |
263 private: | 259 private: |
264 // Map from name to value for all parameters associate with a field trial. | 260 // Map from name to value for all parameters associate with a field trial. |
265 typedef std::map<std::string, std::string> VariationParameters; | 261 typedef std::map<std::string, std::string> VariationParameters; |
266 | 262 |
267 // Provide SystemURLRequestContextGetter with access to | 263 // Provide SystemURLRequestContextGetter with access to |
268 // InitSystemRequestContext(). | 264 // InitSystemRequestContext(). |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 | 506 |
511 scoped_refptr<net::URLRequestContextGetter> | 507 scoped_refptr<net::URLRequestContextGetter> |
512 system_url_request_context_getter_; | 508 system_url_request_context_getter_; |
513 | 509 |
514 // True if SPDY is disabled by policy. | 510 // True if SPDY is disabled by policy. |
515 bool is_spdy_disabled_by_policy_; | 511 bool is_spdy_disabled_by_policy_; |
516 | 512 |
517 // True if QUIC is allowed by policy. | 513 // True if QUIC is allowed by policy. |
518 bool is_quic_allowed_by_policy_; | 514 bool is_quic_allowed_by_policy_; |
519 | 515 |
| 516 // Global aggregator of data use. It must outlive the |
| 517 // |system_network_delegate|. |
| 518 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_; |
| 519 // An external observer of data use. |
| 520 scoped_ptr<data_usage::DataUseAggregator::Observer> |
| 521 external_data_use_observer_; |
| 522 |
520 const base::TimeTicks creation_time_; | 523 const base::TimeTicks creation_time_; |
521 | 524 |
522 base::WeakPtrFactory<IOThread> weak_factory_; | 525 base::WeakPtrFactory<IOThread> weak_factory_; |
523 | 526 |
524 DISALLOW_COPY_AND_ASSIGN(IOThread); | 527 DISALLOW_COPY_AND_ASSIGN(IOThread); |
525 }; | 528 }; |
526 | 529 |
527 #endif // CHROME_BROWSER_IO_THREAD_H_ | 530 #endif // CHROME_BROWSER_IO_THREAD_H_ |
OLD | NEW |