| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 explicit SystemRequestContextLeakChecker(Globals* globals); | 116 explicit SystemRequestContextLeakChecker(Globals* globals); |
| 120 ~SystemRequestContextLeakChecker(); | 117 ~SystemRequestContextLeakChecker(); |
| 121 | 118 |
| 122 private: | 119 private: |
| 123 Globals* const globals_; | 120 Globals* const globals_; |
| 124 }; | 121 }; |
| 125 | 122 |
| 126 Globals(); | 123 Globals(); |
| 127 ~Globals(); | 124 ~Globals(); |
| 128 | 125 |
| 129 // Global aggregator of data use. It must outlive the | |
| 130 // |system_network_delegate|. | |
| 131 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator; | |
| 132 // The "system" NetworkDelegate, used for Profile-agnostic network events. | 126 // The "system" NetworkDelegate, used for Profile-agnostic network events. |
| 133 scoped_ptr<net::NetworkDelegate> system_network_delegate; | 127 scoped_ptr<net::NetworkDelegate> system_network_delegate; |
| 134 scoped_ptr<net::HostResolver> host_resolver; | 128 scoped_ptr<net::HostResolver> host_resolver; |
| 135 scoped_ptr<net::CertVerifier> cert_verifier; | 129 scoped_ptr<net::CertVerifier> cert_verifier; |
| 136 // The ChannelIDService must outlive the HttpTransactionFactory. | 130 // The ChannelIDService must outlive the HttpTransactionFactory. |
| 137 scoped_ptr<net::ChannelIDService> system_channel_id_service; | 131 scoped_ptr<net::ChannelIDService> system_channel_id_service; |
| 138 // This TransportSecurityState doesn't load or save any state. It's only | 132 // This TransportSecurityState doesn't load or save any state. It's only |
| 139 // used to enforce pinning for system requests and will only use built-in | 133 // used to enforce pinning for system requests and will only use built-in |
| 140 // pins. | 134 // pins. |
| 141 scoped_ptr<net::TransportSecurityState> transport_security_state; | 135 scoped_ptr<net::TransportSecurityState> transport_security_state; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 239 |
| 246 // Clears the host cache. Intended to be used to prevent exposing recently | 240 // Clears the host cache. Intended to be used to prevent exposing recently |
| 247 // visited sites on about:net-internals/#dns and about:dns pages. Must be | 241 // visited sites on about:net-internals/#dns and about:dns pages. Must be |
| 248 // called on the IO thread. | 242 // called on the IO thread. |
| 249 void ClearHostCache(); | 243 void ClearHostCache(); |
| 250 | 244 |
| 251 void InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params); | 245 void InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params); |
| 252 | 246 |
| 253 base::TimeTicks creation_time() const; | 247 base::TimeTicks creation_time() const; |
| 254 | 248 |
| 249 data_usage::DataUseAggregator* data_use_aggregator() const; |
| 250 |
| 255 // Returns true if QUIC should be enabled for data reduction proxy, either as | 251 // Returns true if QUIC should be enabled for data reduction proxy, either as |
| 256 // a result of a field trial or a command line flag. | 252 // a result of a field trial or a command line flag. |
| 257 static bool ShouldEnableQuicForDataReductionProxy(); | 253 static bool ShouldEnableQuicForDataReductionProxy(); |
| 258 | 254 |
| 259 private: | 255 private: |
| 260 // Map from name to value for all parameters associate with a field trial. | 256 // Map from name to value for all parameters associate with a field trial. |
| 261 typedef std::map<std::string, std::string> VariationParameters; | 257 typedef std::map<std::string, std::string> VariationParameters; |
| 262 | 258 |
| 263 // Provide SystemURLRequestContextGetter with access to | 259 // Provide SystemURLRequestContextGetter with access to |
| 264 // InitSystemRequestContext(). | 260 // InitSystemRequestContext(). |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 502 |
| 507 scoped_refptr<net::URLRequestContextGetter> | 503 scoped_refptr<net::URLRequestContextGetter> |
| 508 system_url_request_context_getter_; | 504 system_url_request_context_getter_; |
| 509 | 505 |
| 510 // True if SPDY is disabled by policy. | 506 // True if SPDY is disabled by policy. |
| 511 bool is_spdy_disabled_by_policy_; | 507 bool is_spdy_disabled_by_policy_; |
| 512 | 508 |
| 513 // True if QUIC is allowed by policy. | 509 // True if QUIC is allowed by policy. |
| 514 bool is_quic_allowed_by_policy_; | 510 bool is_quic_allowed_by_policy_; |
| 515 | 511 |
| 512 // Global aggregator of data use. It must outlive the |
| 513 // |system_network_delegate|. |
| 514 scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_; |
| 515 // An external observer of data use. |
| 516 scoped_ptr<data_usage::DataUseAggregator::Observer> |
| 517 external_data_use_observer_; |
| 518 |
| 516 const base::TimeTicks creation_time_; | 519 const base::TimeTicks creation_time_; |
| 517 | 520 |
| 518 base::WeakPtrFactory<IOThread> weak_factory_; | 521 base::WeakPtrFactory<IOThread> weak_factory_; |
| 519 | 522 |
| 520 DISALLOW_COPY_AND_ASSIGN(IOThread); | 523 DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 521 }; | 524 }; |
| 522 | 525 |
| 523 #endif // CHROME_BROWSER_IO_THREAD_H_ | 526 #endif // CHROME_BROWSER_IO_THREAD_H_ |
| OLD | NEW |