[email protected] | 4617d2da | 2012-01-13 20:46:49 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_IO_THREAD_H_ |
| 6 | #define CHROME_BROWSER_IO_THREAD_H_ |
| 7 | |
[email protected] | bcefe0f | 2010-11-10 16:19:10 | [diff] [blame] | 8 | #include <string> |
[email protected] | c38831a1 | 2011-10-28 12:44:49 | [diff] [blame] | 9 | |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 10 | #include "base/basictypes.h" |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 11 | #include "base/compiler_specific.h" |
| 12 | #include "base/memory/ref_counted.h" |
[email protected] | 3b63f8f4 | 2011-03-28 01:54:15 | [diff] [blame] | 13 | #include "base/memory/scoped_ptr.h" |
[email protected] | 21ee224e | 2011-11-21 02:17:53 | [diff] [blame] | 14 | #include "base/memory/weak_ptr.h" |
[email protected] | 0abb6712 | 2012-12-12 11:36:05 | [diff] [blame] | 15 | #include "base/prefs/public/pref_member.h" |
[email protected] | 4d45a6de | 2011-05-13 05:20:18 | [diff] [blame] | 16 | #include "chrome/browser/net/ssl_config_service_manager.h" |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 17 | #include "content/public/browser/browser_thread.h" |
| 18 | #include "content/public/browser/browser_thread_delegate.h" |
[email protected] | 58bc704 | 2010-07-07 18:04:14 | [diff] [blame] | 19 | #include "net/base/network_change_notifier.h" |
[email protected] | f9cf557 | 2012-12-04 15:52:09 | [diff] [blame] | 20 | #include "net/http/http_network_session.h" |
| 21 | #include "net/socket/next_proto.h" |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 22 | |
[email protected] | 9e743cd | 2010-03-16 07:03:53 | [diff] [blame] | 23 | class ChromeNetLog; |
[email protected] | 7730542 | 2012-11-29 16:51:39 | [diff] [blame] | 24 | class CommandLine; |
[email protected] | 6f96cbcb | 2011-11-04 02:26:07 | [diff] [blame] | 25 | class PrefProxyConfigTrackerImpl; |
[email protected] | bcefe0f | 2010-11-10 16:19:10 | [diff] [blame] | 26 | class PrefService; |
[email protected] | 5b19952 | 2012-12-22 17:24:44 | [diff] [blame] | 27 | class PrefServiceSimple; |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 28 | class SystemURLRequestContextGetter; |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 29 | |
[email protected] | 7613faae | 2012-04-18 01:01:19 | [diff] [blame] | 30 | namespace chrome_browser_net { |
[email protected] | 4588b3d | 2012-11-14 00:37:38 | [diff] [blame] | 31 | class DnsProbeService; |
[email protected] | 7613faae | 2012-04-18 01:01:19 | [diff] [blame] | 32 | class HttpPipeliningCompatibilityClient; |
[email protected] | a9e0d141 | 2012-08-20 22:13:01 | [diff] [blame] | 33 | class LoadTimeStats; |
[email protected] | 7613faae | 2012-04-18 01:01:19 | [diff] [blame] | 34 | } |
| 35 | |
[email protected] | 5a38dfd | 2012-07-23 23:22:10 | [diff] [blame] | 36 | namespace extensions { |
| 37 | class EventRouterForwarder; |
| 38 | } |
| 39 | |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 40 | namespace net { |
[email protected] | 822581d | 2010-12-16 17:27:15 | [diff] [blame] | 41 | class CertVerifier; |
[email protected] | 273e37d | 2011-08-11 01:49:12 | [diff] [blame] | 42 | class CookieStore; |
[email protected] | 933bc5c6 | 2011-04-12 19:08:02 | [diff] [blame] | 43 | class FtpTransactionFactory; |
[email protected] | c2dad29 | 2012-09-07 21:27:35 | [diff] [blame] | 44 | class HostMappingRules; |
[email protected] | 1889dc1b | 2010-10-14 22:03:13 | [diff] [blame] | 45 | class HostResolver; |
[email protected] | fa55e19 | 2010-02-15 14:25:50 | [diff] [blame] | 46 | class HttpAuthHandlerFactory; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 47 | class HttpServerProperties; |
[email protected] | 52617df | 2010-12-24 07:30:01 | [diff] [blame] | 48 | class HttpTransactionFactory; |
[email protected] | ee4c30d | 2012-11-07 15:08:43 | [diff] [blame] | 49 | class HttpUserAgentSettings; |
[email protected] | 0651b81 | 2011-02-24 00:22:50 | [diff] [blame] | 50 | class NetworkDelegate; |
[email protected] | 9c4eff2 | 2012-03-20 22:42:29 | [diff] [blame] | 51 | class ServerBoundCertService; |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 52 | class ProxyConfigService; |
[email protected] | 2fb62920 | 2010-12-23 23:52:57 | [diff] [blame] | 53 | class ProxyService; |
[email protected] | 3b543ab | 2011-09-17 21:47:00 | [diff] [blame] | 54 | class SdchManager; |
[email protected] | 2fb62920 | 2010-12-23 23:52:57 | [diff] [blame] | 55 | class SSLConfigService; |
[email protected] | a2a4197 | 2011-12-07 17:47:27 | [diff] [blame] | 56 | class TransportSecurityState; |
[email protected] | 27a112c | 2011-01-06 04:19:30 | [diff] [blame] | 57 | class URLRequestContext; |
[email protected] | abe2c03 | 2011-03-31 18:49:34 | [diff] [blame] | 58 | class URLRequestContextGetter; |
[email protected] | a73a280 | 2012-05-02 19:20:15 | [diff] [blame] | 59 | class URLRequestThrottlerManager; |
[email protected] | b4955e7d | 2010-04-16 20:22:30 | [diff] [blame] | 60 | class URLSecurityManager; |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 61 | } // namespace net |
| 62 | |
[email protected] | 7730542 | 2012-11-29 16:51:39 | [diff] [blame] | 63 | namespace policy { |
| 64 | class PolicyService; |
| 65 | } // namespace policy |
| 66 | |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 67 | // Contains state associated with, initialized and cleaned up on, and |
[email protected] | dd48370 | 2011-12-02 14:47:42 | [diff] [blame] | 68 | // primarily used on, the IO thread. |
[email protected] | c92b861 | 2011-12-13 22:18:59 | [diff] [blame] | 69 | // |
| 70 | // If you are looking to interact with the IO thread (e.g. post tasks |
| 71 | // to it or check if it is the current thread), see |
| 72 | // content::BrowserThread. |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 73 | class IOThread : public content::BrowserThreadDelegate { |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 74 | public: |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 75 | struct Globals { |
[email protected] | f9cf557 | 2012-12-04 15:52:09 | [diff] [blame] | 76 | template <typename T> |
| 77 | class Optional { |
| 78 | public: |
| 79 | Optional() : set_(false) {} |
| 80 | |
| 81 | void set(T value) { |
| 82 | set_ = true; |
| 83 | value_ = value; |
| 84 | } |
| 85 | void CopyToIfSet(T* value) { |
| 86 | if (set_) { |
| 87 | *value = value_; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | private: |
| 92 | bool set_; |
| 93 | T value_; |
| 94 | }; |
| 95 | |
[email protected] | c93123fa | 2012-04-19 02:49:48 | [diff] [blame] | 96 | class SystemRequestContextLeakChecker { |
| 97 | public: |
| 98 | explicit SystemRequestContextLeakChecker(Globals* globals); |
| 99 | ~SystemRequestContextLeakChecker(); |
| 100 | |
| 101 | private: |
| 102 | Globals* const globals_; |
| 103 | }; |
| 104 | |
[email protected] | 1889dc1b | 2010-10-14 22:03:13 | [diff] [blame] | 105 | Globals(); |
| 106 | ~Globals(); |
| 107 | |
[email protected] | 0651b81 | 2011-02-24 00:22:50 | [diff] [blame] | 108 | // The "system" NetworkDelegate, used for Profile-agnostic network events. |
| 109 | scoped_ptr<net::NetworkDelegate> system_network_delegate; |
[email protected] | 73c4532 | 2010-10-01 23:57:54 | [diff] [blame] | 110 | scoped_ptr<net::HostResolver> host_resolver; |
[email protected] | 822581d | 2010-12-16 17:27:15 | [diff] [blame] | 111 | scoped_ptr<net::CertVerifier> cert_verifier; |
[email protected] | c934fdb7 | 2012-12-28 22:02:36 | [diff] [blame] | 112 | // The ServerBoundCertService must outlive the HttpTransactionFactory. |
| 113 | scoped_ptr<net::ServerBoundCertService> system_server_bound_cert_service; |
[email protected] | a2a4197 | 2011-12-07 17:47:27 | [diff] [blame] | 114 | // This TransportSecurityState doesn't load or save any state. It's only |
| 115 | // used to enforce pinning for system requests and will only use built-in |
| 116 | // pins. |
| 117 | scoped_ptr<net::TransportSecurityState> transport_security_state; |
[email protected] | 2fb62920 | 2010-12-23 23:52:57 | [diff] [blame] | 118 | scoped_refptr<net::SSLConfigService> ssl_config_service; |
[email protected] | fa55e19 | 2010-02-15 14:25:50 | [diff] [blame] | 119 | scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 120 | scoped_ptr<net::HttpServerProperties> http_server_properties; |
[email protected] | 6104ea5d | 2011-04-27 21:37:12 | [diff] [blame] | 121 | scoped_ptr<net::ProxyService> proxy_script_fetcher_proxy_service; |
[email protected] | 52617df | 2010-12-24 07:30:01 | [diff] [blame] | 122 | scoped_ptr<net::HttpTransactionFactory> |
| 123 | proxy_script_fetcher_http_transaction_factory; |
[email protected] | 933bc5c6 | 2011-04-12 19:08:02 | [diff] [blame] | 124 | scoped_ptr<net::FtpTransactionFactory> |
| 125 | proxy_script_fetcher_ftp_transaction_factory; |
[email protected] | a73a280 | 2012-05-02 19:20:15 | [diff] [blame] | 126 | scoped_ptr<net::URLRequestThrottlerManager> throttler_manager; |
[email protected] | b4955e7d | 2010-04-16 20:22:30 | [diff] [blame] | 127 | scoped_ptr<net::URLSecurityManager> url_security_manager; |
[email protected] | ef2bf42 | 2012-05-11 03:27:09 | [diff] [blame] | 128 | // TODO(willchan): Remove proxy script fetcher context since it's not |
| 129 | // necessary now that I got rid of refcounting URLRequestContexts. |
| 130 | // |
[email protected] | 77feb46 | 2011-05-16 23:37:25 | [diff] [blame] | 131 | // The first URLRequestContext is |system_url_request_context|. We introduce |
| 132 | // |proxy_script_fetcher_context| for the second context. It has a direct |
| 133 | // ProxyService, since we always directly connect to fetch the PAC script. |
[email protected] | ef2bf42 | 2012-05-11 03:27:09 | [diff] [blame] | 134 | scoped_ptr<net::URLRequestContext> proxy_script_fetcher_context; |
[email protected] | 6104ea5d | 2011-04-27 21:37:12 | [diff] [blame] | 135 | scoped_ptr<net::ProxyService> system_proxy_service; |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 136 | scoped_ptr<net::HttpTransactionFactory> system_http_transaction_factory; |
[email protected] | 933bc5c6 | 2011-04-12 19:08:02 | [diff] [blame] | 137 | scoped_ptr<net::FtpTransactionFactory> system_ftp_transaction_factory; |
[email protected] | ef2bf42 | 2012-05-11 03:27:09 | [diff] [blame] | 138 | scoped_ptr<net::URLRequestContext> system_request_context; |
[email protected] | c93123fa | 2012-04-19 02:49:48 | [diff] [blame] | 139 | SystemRequestContextLeakChecker system_request_context_leak_checker; |
[email protected] | 9c4eff2 | 2012-03-20 22:42:29 | [diff] [blame] | 140 | // |system_cookie_store| and |system_server_bound_cert_service| are shared |
[email protected] | 4617d2da | 2012-01-13 20:46:49 | [diff] [blame] | 141 | // between |proxy_script_fetcher_context| and |system_request_context|. |
[email protected] | 273e37d | 2011-08-11 01:49:12 | [diff] [blame] | 142 | scoped_refptr<net::CookieStore> system_cookie_store; |
[email protected] | 5a38dfd | 2012-07-23 23:22:10 | [diff] [blame] | 143 | scoped_refptr<extensions::EventRouterForwarder> |
[email protected] | 3ce0241 | 2011-03-01 12:01:15 | [diff] [blame] | 144 | extension_event_router_forwarder; |
[email protected] | 7613faae | 2012-04-18 01:01:19 | [diff] [blame] | 145 | scoped_ptr<chrome_browser_net::HttpPipeliningCompatibilityClient> |
| 146 | http_pipelining_compatibility_client; |
[email protected] | a9e0d141 | 2012-08-20 22:13:01 | [diff] [blame] | 147 | scoped_ptr<chrome_browser_net::LoadTimeStats> load_time_stats; |
[email protected] | c2dad29 | 2012-09-07 21:27:35 | [diff] [blame] | 148 | scoped_ptr<net::HostMappingRules> host_mapping_rules; |
[email protected] | ee4c30d | 2012-11-07 15:08:43 | [diff] [blame] | 149 | scoped_ptr<net::HttpUserAgentSettings> http_user_agent_settings; |
[email protected] | c2dad29 | 2012-09-07 21:27:35 | [diff] [blame] | 150 | bool ignore_certificate_errors; |
| 151 | bool http_pipelining_enabled; |
| 152 | uint16 testing_fixed_http_port; |
| 153 | uint16 testing_fixed_https_port; |
[email protected] | f9cf557 | 2012-12-04 15:52:09 | [diff] [blame] | 154 | Optional<size_t> max_spdy_sessions_per_domain; |
| 155 | Optional<size_t> initial_max_spdy_concurrent_streams; |
| 156 | Optional<size_t> max_spdy_concurrent_streams_limit; |
| 157 | Optional<bool> force_spdy_single_domain; |
| 158 | Optional<bool> enable_spdy_ip_pooling; |
| 159 | Optional<bool> enable_spdy_credential_frames; |
| 160 | Optional<bool> enable_spdy_compression; |
| 161 | Optional<bool> enable_spdy_ping_based_connection_checking; |
| 162 | Optional<net::NextProto> spdy_default_protocol; |
[email protected] | f1e97e9 | 2012-12-16 04:53:25 | [diff] [blame] | 163 | Optional<uint16> origin_port_to_force_quic_on; |
[email protected] | 4588b3d | 2012-11-14 00:37:38 | [diff] [blame] | 164 | // NetErrorTabHelper uses |dns_probe_service| to send DNS probes when a |
| 165 | // main frame load fails with a DNS error in order to provide more useful |
| 166 | // information to the renderer so it can show a more specific error page. |
| 167 | scoped_ptr<chrome_browser_net::DnsProbeService> dns_probe_service; |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 168 | }; |
| 169 | |
[email protected] | b2fcd0e | 2010-12-01 15:19:40 | [diff] [blame] | 170 | // |net_log| must either outlive the IOThread or be NULL. |
[email protected] | 5b19952 | 2012-12-22 17:24:44 | [diff] [blame] | 171 | IOThread(PrefServiceSimple* local_state, |
[email protected] | 7730542 | 2012-11-29 16:51:39 | [diff] [blame] | 172 | policy::PolicyService* policy_service, |
[email protected] | 3ce0241 | 2011-03-01 12:01:15 | [diff] [blame] | 173 | ChromeNetLog* net_log, |
[email protected] | 5a38dfd | 2012-07-23 23:22:10 | [diff] [blame] | 174 | extensions::EventRouterForwarder* extension_event_router_forwarder); |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 175 | |
| 176 | virtual ~IOThread(); |
| 177 | |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 178 | // Can only be called on the IO thread. |
| 179 | Globals* globals(); |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 180 | |
[email protected] | b2fcd0e | 2010-12-01 15:19:40 | [diff] [blame] | 181 | ChromeNetLog* net_log(); |
| 182 | |
[email protected] | b09f76d6 | 2011-12-07 01:51:06 | [diff] [blame] | 183 | // Handles changing to On The Record mode, discarding confidential data. |
| 184 | void ChangedToOnTheRecord(); |
| 185 | |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 186 | // Returns a getter for the URLRequestContext. Only called on the UI thread. |
[email protected] | abe2c03 | 2011-03-31 18:49:34 | [diff] [blame] | 187 | net::URLRequestContextGetter* system_url_request_context_getter(); |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 188 | |
[email protected] | 67372ecf | 2011-09-10 01:30:46 | [diff] [blame] | 189 | // Clears the host cache. Intended to be used to prevent exposing recently |
| 190 | // visited sites on about:net-internals/#dns and about:dns pages. Must be |
| 191 | // called on the IO thread. |
| 192 | void ClearHostCache(); |
[email protected] | d6f37fc | 2011-02-13 23:58:41 | [diff] [blame] | 193 | |
[email protected] | f9cf557 | 2012-12-04 15:52:09 | [diff] [blame] | 194 | void InitializeNetworkSessionParams(net::HttpNetworkSession::Params* params); |
| 195 | |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 196 | private: |
[email protected] | 7730542 | 2012-11-29 16:51:39 | [diff] [blame] | 197 | // Provide SystemURLRequestContextGetter with access to |
| 198 | // InitSystemRequestContext(). |
| 199 | friend class SystemURLRequestContextGetter; |
| 200 | |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 201 | // BrowserThreadDelegate implementation, runs on the IO thread. |
| 202 | // This handles initialization and destruction of state that must |
| 203 | // live on the IO thread. |
[email protected] | 0d5c08e | 2011-11-21 16:51:06 | [diff] [blame] | 204 | virtual void Init() OVERRIDE; |
| 205 | virtual void CleanUp() OVERRIDE; |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 206 | |
[email protected] | 7730542 | 2012-11-29 16:51:39 | [diff] [blame] | 207 | void InitializeNetworkOptions(const CommandLine& parsed_command_line); |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 208 | |
[email protected] | 443a30ed | 2012-11-30 02:56:46 | [diff] [blame] | 209 | // Enable the SPDY protocol. If this function is not called, SPDY/3 |
| 210 | // will be enabled. |
| 211 | // "off" : Disables SPDY support entirely. |
| 212 | // "ssl" : Forces SPDY for all HTTPS requests. |
| 213 | // "no-ssl" : Forces SPDY for all HTTP requests. |
| 214 | // "no-ping" : Disables SPDY ping connection testing. |
| 215 | // "exclude=<host>" : Disables SPDY support for the host <host>. |
| 216 | // "no-compress" : Disables SPDY header compression. |
| 217 | // "no-alt-protocols : Disables alternate protocol support. |
| 218 | // "force-alt-protocols : Forces an alternate protocol of SPDY/2 |
| 219 | // on port 443. |
| 220 | // "single-domain" : Forces all spdy traffic to a single domain. |
| 221 | // "init-max-streams=<limit>" : Specifies the maximum number of concurrent |
| 222 | // streams for a SPDY session, unless the |
| 223 | // specifies a different value via SETTINGS. |
| 224 | void EnableSpdy(const std::string& mode); |
| 225 | |
[email protected] | 2e5b60a2 | 2011-11-28 15:56:41 | [diff] [blame] | 226 | // Global state must be initialized on the IO thread, then this |
| 227 | // method must be invoked on the UI thread. |
| 228 | void InitSystemRequestContext(); |
| 229 | |
| 230 | // Lazy initialization of system request context for |
| 231 | // SystemURLRequestContextGetter. To be called on IO thread only |
| 232 | // after global state has been initialized on the IO thread, and |
| 233 | // SystemRequestContext state has been initialized on the UI thread. |
| 234 | void InitSystemRequestContextOnIOThread(); |
| 235 | |
[email protected] | 5b19952 | 2012-12-22 17:24:44 | [diff] [blame] | 236 | static void RegisterPrefs(PrefServiceSimple* local_state); |
[email protected] | bcefe0f | 2010-11-10 16:19:10 | [diff] [blame] | 237 | |
[email protected] | 65d3438 | 2010-07-01 18:12:26 | [diff] [blame] | 238 | net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory( |
| 239 | net::HostResolver* resolver); |
[email protected] | eb3cac7 | 2010-02-26 21:07:45 | [diff] [blame] | 240 | |
[email protected] | 4d45a6de | 2011-05-13 05:20:18 | [diff] [blame] | 241 | // Returns an SSLConfigService instance. |
| 242 | net::SSLConfigService* GetSSLConfigService(); |
| 243 | |
[email protected] | b09f76d6 | 2011-12-07 01:51:06 | [diff] [blame] | 244 | void ChangedToOnTheRecordOnIOThread(); |
| 245 | |
[email protected] | fa4b6c3 | 2012-11-26 23:02:39 | [diff] [blame] | 246 | void UpdateDnsClientEnabled(); |
| 247 | |
[email protected] | b2fcd0e | 2010-12-01 15:19:40 | [diff] [blame] | 248 | // The NetLog is owned by the browser process, to allow logging from other |
| 249 | // threads during shutdown, but is used most frequently on the IOThread. |
| 250 | ChromeNetLog* net_log_; |
| 251 | |
[email protected] | 5a38dfd | 2012-07-23 23:22:10 | [diff] [blame] | 252 | // The extensions::EventRouterForwarder allows for sending events to |
| 253 | // extensions from the IOThread. |
| 254 | extensions::EventRouterForwarder* extension_event_router_forwarder_; |
[email protected] | 3ce0241 | 2011-03-01 12:01:15 | [diff] [blame] | 255 | |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 256 | // These member variables are basically global, but their lifetimes are tied |
| 257 | // to the IOThread. IOThread owns them all, despite not using scoped_ptr. |
| 258 | // This is because the destructor of IOThread runs on the wrong thread. All |
[email protected] | b2fcd0e | 2010-12-01 15:19:40 | [diff] [blame] | 259 | // member variables should be deleted in CleanUp(). |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 260 | |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 261 | // These member variables are initialized in Init() and do not change for the |
| 262 | // lifetime of the IO thread. |
| 263 | |
| 264 | Globals* globals_; |
| 265 | |
[email protected] | 58bc704 | 2010-07-07 18:04:14 | [diff] [blame] | 266 | // Observer that logs network changes to the ChromeNetLog. |
[email protected] | e0845d5f | 2012-05-29 00:11:41 | [diff] [blame] | 267 | class LoggingNetworkChangeObserver; |
| 268 | scoped_ptr<LoggingNetworkChangeObserver> network_change_observer_; |
[email protected] | 58bc704 | 2010-07-07 18:04:14 | [diff] [blame] | 269 | |
[email protected] | 0a8db0d | 2011-04-13 15:15:40 | [diff] [blame] | 270 | BooleanPrefMember system_enable_referrers_; |
| 271 | |
[email protected] | fa4b6c3 | 2012-11-26 23:02:39 | [diff] [blame] | 272 | BooleanPrefMember dns_client_enabled_; |
| 273 | |
[email protected] | bcefe0f | 2010-11-10 16:19:10 | [diff] [blame] | 274 | // Store HTTP Auth-related policies in this thread. |
| 275 | std::string auth_schemes_; |
| 276 | bool negotiate_disable_cname_lookup_; |
| 277 | bool negotiate_enable_port_; |
| 278 | std::string auth_server_whitelist_; |
| 279 | std::string auth_delegate_whitelist_; |
[email protected] | ac7f3fdb | 2010-11-12 12:47:05 | [diff] [blame] | 280 | std::string gssapi_library_name_; |
[email protected] | ec44ee0 | 2012-09-28 21:31:51 | [diff] [blame] | 281 | std::string spdyproxy_origin_; |
[email protected] | bcefe0f | 2010-11-10 16:19:10 | [diff] [blame] | 282 | |
[email protected] | 4d45a6de | 2011-05-13 05:20:18 | [diff] [blame] | 283 | // This is an instance of the default SSLConfigServiceManager for the current |
| 284 | // platform and it gets SSL preferences from local_state object. |
| 285 | scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; |
| 286 | |
[email protected] | d13c327 | 2010-02-04 00:24:51 | [diff] [blame] | 287 | // These member variables are initialized by a task posted to the IO thread, |
| 288 | // which gets posted by calling certain member functions of IOThread. |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 289 | scoped_ptr<net::ProxyConfigService> system_proxy_config_service_; |
| 290 | |
[email protected] | 6f96cbcb | 2011-11-04 02:26:07 | [diff] [blame] | 291 | scoped_ptr<PrefProxyConfigTrackerImpl> pref_proxy_config_tracker_; |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 292 | |
[email protected] | abe2c03 | 2011-03-31 18:49:34 | [diff] [blame] | 293 | scoped_refptr<net::URLRequestContextGetter> |
| 294 | system_url_request_context_getter_; |
[email protected] | db0e86dd | 2011-03-16 14:47:21 | [diff] [blame] | 295 | |
[email protected] | 3b543ab | 2011-09-17 21:47:00 | [diff] [blame] | 296 | net::SdchManager* sdch_manager_; |
| 297 | |
[email protected] | 7730542 | 2012-11-29 16:51:39 | [diff] [blame] | 298 | // True if SPDY is disabled by policy. |
| 299 | bool is_spdy_disabled_by_policy_; |
| 300 | |
[email protected] | 21ee224e | 2011-11-21 02:17:53 | [diff] [blame] | 301 | base::WeakPtrFactory<IOThread> weak_factory_; |
[email protected] | addb324 | 2011-06-13 21:39:16 | [diff] [blame] | 302 | |
[email protected] | 0ac8368 | 2010-01-22 17:46:27 | [diff] [blame] | 303 | DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 304 | }; |
| 305 | |
[email protected] | fa55e19 | 2010-02-15 14:25:50 | [diff] [blame] | 306 | #endif // CHROME_BROWSER_IO_THREAD_H_ |