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 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "chrome/browser/net/ssl_config_service_manager.h" | 15 #include "chrome/browser/net/ssl_config_service_manager.h" |
16 #include "chrome/browser/prefs/pref_member.h" | 16 #include "chrome/browser/prefs/pref_member.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/browser_thread_delegate.h" | 18 #include "content/public/browser/browser_thread_delegate.h" |
19 #include "net/base/network_change_notifier.h" | 19 #include "net/base/network_change_notifier.h" |
20 | 20 |
21 class ChromeNetLog; | 21 class ChromeNetLog; |
22 class ExtensionEventRouterForwarder; | |
23 class PrefProxyConfigTrackerImpl; | 22 class PrefProxyConfigTrackerImpl; |
24 class PrefService; | 23 class PrefService; |
25 class SystemURLRequestContextGetter; | 24 class SystemURLRequestContextGetter; |
26 | 25 |
27 namespace chrome_browser_net { | 26 namespace chrome_browser_net { |
28 class HttpPipeliningCompatibilityClient; | 27 class HttpPipeliningCompatibilityClient; |
29 } | 28 } |
30 | 29 |
| 30 namespace extensions { |
| 31 class EventRouterForwarder; |
| 32 } |
| 33 |
31 namespace net { | 34 namespace net { |
32 class CertVerifier; | 35 class CertVerifier; |
33 class CookieStore; | 36 class CookieStore; |
34 class FtpTransactionFactory; | 37 class FtpTransactionFactory; |
35 class HostResolver; | 38 class HostResolver; |
36 class HttpAuthHandlerFactory; | 39 class HttpAuthHandlerFactory; |
37 class HttpServerProperties; | 40 class HttpServerProperties; |
38 class HttpTransactionFactory; | 41 class HttpTransactionFactory; |
39 class NetworkDelegate; | 42 class NetworkDelegate; |
40 class ServerBoundCertService; | 43 class ServerBoundCertService; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 scoped_ptr<net::URLRequestContext> proxy_script_fetcher_context; | 100 scoped_ptr<net::URLRequestContext> proxy_script_fetcher_context; |
98 scoped_ptr<net::ProxyService> system_proxy_service; | 101 scoped_ptr<net::ProxyService> system_proxy_service; |
99 scoped_ptr<net::HttpTransactionFactory> system_http_transaction_factory; | 102 scoped_ptr<net::HttpTransactionFactory> system_http_transaction_factory; |
100 scoped_ptr<net::FtpTransactionFactory> system_ftp_transaction_factory; | 103 scoped_ptr<net::FtpTransactionFactory> system_ftp_transaction_factory; |
101 scoped_ptr<net::URLRequestContext> system_request_context; | 104 scoped_ptr<net::URLRequestContext> system_request_context; |
102 SystemRequestContextLeakChecker system_request_context_leak_checker; | 105 SystemRequestContextLeakChecker system_request_context_leak_checker; |
103 // |system_cookie_store| and |system_server_bound_cert_service| are shared | 106 // |system_cookie_store| and |system_server_bound_cert_service| are shared |
104 // between |proxy_script_fetcher_context| and |system_request_context|. | 107 // between |proxy_script_fetcher_context| and |system_request_context|. |
105 scoped_refptr<net::CookieStore> system_cookie_store; | 108 scoped_refptr<net::CookieStore> system_cookie_store; |
106 scoped_ptr<net::ServerBoundCertService> system_server_bound_cert_service; | 109 scoped_ptr<net::ServerBoundCertService> system_server_bound_cert_service; |
107 scoped_refptr<ExtensionEventRouterForwarder> | 110 scoped_refptr<extensions::EventRouterForwarder> |
108 extension_event_router_forwarder; | 111 extension_event_router_forwarder; |
109 scoped_ptr<chrome_browser_net::HttpPipeliningCompatibilityClient> | 112 scoped_ptr<chrome_browser_net::HttpPipeliningCompatibilityClient> |
110 http_pipelining_compatibility_client; | 113 http_pipelining_compatibility_client; |
111 }; | 114 }; |
112 | 115 |
113 // |net_log| must either outlive the IOThread or be NULL. | 116 // |net_log| must either outlive the IOThread or be NULL. |
114 IOThread(PrefService* local_state, | 117 IOThread(PrefService* local_state, |
115 ChromeNetLog* net_log, | 118 ChromeNetLog* net_log, |
116 ExtensionEventRouterForwarder* extension_event_router_forwarder); | 119 extensions::EventRouterForwarder* extension_event_router_forwarder); |
117 | 120 |
118 virtual ~IOThread(); | 121 virtual ~IOThread(); |
119 | 122 |
120 // Can only be called on the IO thread. | 123 // Can only be called on the IO thread. |
121 Globals* globals(); | 124 Globals* globals(); |
122 | 125 |
123 ChromeNetLog* net_log(); | 126 ChromeNetLog* net_log(); |
124 | 127 |
125 // Handles changing to On The Record mode, discarding confidential data. | 128 // Handles changing to On The Record mode, discarding confidential data. |
126 void ChangedToOnTheRecord(); | 129 void ChangedToOnTheRecord(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 164 |
162 // Returns an SSLConfigService instance. | 165 // Returns an SSLConfigService instance. |
163 net::SSLConfigService* GetSSLConfigService(); | 166 net::SSLConfigService* GetSSLConfigService(); |
164 | 167 |
165 void ChangedToOnTheRecordOnIOThread(); | 168 void ChangedToOnTheRecordOnIOThread(); |
166 | 169 |
167 // The NetLog is owned by the browser process, to allow logging from other | 170 // The NetLog is owned by the browser process, to allow logging from other |
168 // threads during shutdown, but is used most frequently on the IOThread. | 171 // threads during shutdown, but is used most frequently on the IOThread. |
169 ChromeNetLog* net_log_; | 172 ChromeNetLog* net_log_; |
170 | 173 |
171 // The ExtensionEventRouterForwarder allows for sending events to extensions | 174 // The extensions::EventRouterForwarder allows for sending events to |
172 // from the IOThread. | 175 // extensions from the IOThread. |
173 ExtensionEventRouterForwarder* extension_event_router_forwarder_; | 176 extensions::EventRouterForwarder* extension_event_router_forwarder_; |
174 | 177 |
175 // These member variables are basically global, but their lifetimes are tied | 178 // These member variables are basically global, but their lifetimes are tied |
176 // to the IOThread. IOThread owns them all, despite not using scoped_ptr. | 179 // to the IOThread. IOThread owns them all, despite not using scoped_ptr. |
177 // This is because the destructor of IOThread runs on the wrong thread. All | 180 // This is because the destructor of IOThread runs on the wrong thread. All |
178 // member variables should be deleted in CleanUp(). | 181 // member variables should be deleted in CleanUp(). |
179 | 182 |
180 // These member variables are initialized in Init() and do not change for the | 183 // These member variables are initialized in Init() and do not change for the |
181 // lifetime of the IO thread. | 184 // lifetime of the IO thread. |
182 | 185 |
183 Globals* globals_; | 186 Globals* globals_; |
(...skipping 26 matching lines...) Expand all Loading... |
210 system_url_request_context_getter_; | 213 system_url_request_context_getter_; |
211 | 214 |
212 net::SdchManager* sdch_manager_; | 215 net::SdchManager* sdch_manager_; |
213 | 216 |
214 base::WeakPtrFactory<IOThread> weak_factory_; | 217 base::WeakPtrFactory<IOThread> weak_factory_; |
215 | 218 |
216 DISALLOW_COPY_AND_ASSIGN(IOThread); | 219 DISALLOW_COPY_AND_ASSIGN(IOThread); |
217 }; | 220 }; |
218 | 221 |
219 #endif // CHROME_BROWSER_IO_THREAD_H_ | 222 #endif // CHROME_BROWSER_IO_THREAD_H_ |
OLD | NEW |