Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
|
willchan no longer on Chromium
2011/08/10 16:10:35
After your changes, there does not appear to be an
rpetterson
2011/08/12 03:12:36
Done.
| |
| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "chrome/browser/browser_process_sub_thread.h" | 14 #include "chrome/browser/browser_process_sub_thread.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 "chrome/browser/profiles/profile.h" | |
|
willchan no longer on Chromium
2011/08/10 16:10:35
I don't think this needs to be here.
rpetterson
2011/08/12 03:12:36
Done.
| |
| 17 #include "chrome/common/net/predictor_common.h" | 18 #include "chrome/common/net/predictor_common.h" |
| 18 #include "net/base/network_change_notifier.h" | 19 #include "net/base/network_change_notifier.h" |
| 19 | 20 |
| 20 class ChromeNetLog; | 21 class ChromeNetLog; |
| 21 class ChromeURLRequestContextGetter; | 22 class ChromeURLRequestContextGetter; |
| 22 class ExtensionEventRouterForwarder; | 23 class ExtensionEventRouterForwarder; |
| 23 class MediaInternals; | 24 class MediaInternals; |
| 24 class PrefProxyConfigTracker; | 25 class PrefProxyConfigTracker; |
| 25 class PrefService; | 26 class PrefService; |
| 26 class SystemURLRequestContextGetter; | 27 class SystemURLRequestContextGetter; |
| 27 | 28 |
| 28 namespace base { | 29 namespace base { |
| 29 class ListValue; | 30 class ListValue; |
| 30 } | 31 } |
| 31 | 32 |
| 32 namespace chrome_browser_net { | 33 namespace chrome_browser_net { |
| 33 class ConnectInterceptor; | |
| 34 class Predictor; | 34 class Predictor; |
| 35 } // namespace chrome_browser_net | 35 } // namespace chrome_browser_net |
| 36 | 36 |
| 37 namespace net { | 37 namespace net { |
| 38 class CertVerifier; | 38 class CertVerifier; |
| 39 class DnsRRResolver; | 39 class DnsRRResolver; |
| 40 class FtpTransactionFactory; | 40 class FtpTransactionFactory; |
| 41 class HostResolver; | 41 class HostResolver; |
| 42 class HttpAuthHandlerFactory; | 42 class HttpAuthHandlerFactory; |
| 43 class HttpTransactionFactory; | 43 class HttpTransactionFactory; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 // Can only be called on the IO thread. | 102 // Can only be called on the IO thread. |
| 103 Globals* globals(); | 103 Globals* globals(); |
| 104 | 104 |
| 105 ChromeNetLog* net_log(); | 105 ChromeNetLog* net_log(); |
| 106 | 106 |
| 107 // Initializes the network predictor, which induces DNS pre-resolution and/or | 107 // Initializes the network predictor, which induces DNS pre-resolution and/or |
| 108 // TCP/IP preconnections. |prefetching_enabled| indicates whether or not DNS | 108 // TCP/IP preconnections. |prefetching_enabled| indicates whether or not DNS |
| 109 // prefetching should be enabled, and |preconnect_enabled| controls whether | 109 // prefetching should be enabled, and |preconnect_enabled| controls whether |
| 110 // TCP/IP preconnection is enabled. This should be called by the UI thread. | 110 // TCP/IP preconnection is enabled. This should be called by the UI thread. |
| 111 // It will post a task to the IO thread to perform the actual initialization. | 111 // It will post a task to the IO thread to perform the actual initialization. |
| 112 void InitNetworkPredictor(bool prefetching_enabled, | 112 void InitNetworkPredictor(const chrome_common_net::UrlList& startup_urls, |
| 113 base::TimeDelta max_dns_queue_delay, | |
| 114 size_t max_speculative_parallel_resolves, | |
| 115 const chrome_common_net::UrlList& startup_urls, | |
| 116 base::ListValue* referral_list, | 113 base::ListValue* referral_list, |
| 117 bool preconnect_enabled); | 114 chrome_browser_net::Predictor* predictor); |
|
jar (doing other things)
2011/08/16 01:19:09
This method name is now confusing. It appears tha
| |
| 118 | |
| 119 // Handles changing to On The Record mode, discarding confidential data. | |
| 120 void ChangedToOnTheRecord(); | |
| 121 | 115 |
| 122 // Returns a getter for the URLRequestContext. Only called on the UI thread. | 116 // Returns a getter for the URLRequestContext. Only called on the UI thread. |
| 123 net::URLRequestContextGetter* system_url_request_context_getter(); | 117 net::URLRequestContextGetter* system_url_request_context_getter(); |
| 124 | 118 |
| 125 // Clear all network stack history, including the host cache, as well as | 119 // Clear all network stack history, including the host cache, as well as |
| 126 // speculative data about subresources of visited sites, and startup-time | 120 // speculative data about subresources of visited sites, and startup-time |
| 127 // navigations. | 121 // navigations. |
| 128 void ClearNetworkingHistory(); | 122 void ClearNetworkingHistory(chrome_browser_net::Predictor* predictor); |
| 129 | 123 |
| 130 protected: | 124 protected: |
| 131 virtual void Init(); | 125 virtual void Init(); |
| 132 virtual void CleanUp(); | 126 virtual void CleanUp(); |
| 133 | 127 |
| 134 private: | 128 private: |
| 135 // Provide SystemURLRequestContextGetter with access to | 129 // Provide SystemURLRequestContextGetter with access to |
| 136 // InitSystemRequestContext(). | 130 // InitSystemRequestContext(). |
| 137 friend class SystemURLRequestContextGetter; | 131 friend class SystemURLRequestContextGetter; |
| 138 | 132 |
| 139 static void RegisterPrefs(PrefService* local_state); | 133 static void RegisterPrefs(PrefService* local_state); |
| 140 | 134 |
| 141 net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory( | 135 net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory( |
| 142 net::HostResolver* resolver); | 136 net::HostResolver* resolver); |
| 143 | 137 |
| 144 void InitSystemRequestContext(); | 138 void InitSystemRequestContext(); |
| 145 | 139 |
| 146 // Lazy initialization of system request context for | 140 // Lazy initialization of system request context for |
| 147 // SystemURLRequestContextGetter. To be called on IO thread. | 141 // SystemURLRequestContextGetter. To be called on IO thread. |
| 148 void InitSystemRequestContextOnIOThread(); | 142 void InitSystemRequestContextOnIOThread(); |
| 149 | 143 |
| 150 void InitNetworkPredictorOnIOThread( | 144 void InitNetworkPredictorOnIOThread( |
| 151 bool prefetching_enabled, | |
| 152 base::TimeDelta max_dns_queue_delay, | |
| 153 size_t max_speculative_parallel_resolves, | |
| 154 const chrome_common_net::UrlList& startup_urls, | 145 const chrome_common_net::UrlList& startup_urls, |
| 155 base::ListValue* referral_list, | 146 base::ListValue* referral_list, |
| 156 bool preconnect_enabled); | 147 chrome_browser_net::Predictor* predictor); |
| 157 | |
| 158 void ChangedToOnTheRecordOnIOThread(); | |
| 159 | 148 |
| 160 // Clears the host cache. Intended to be used to prevent exposing recently | 149 // Clears the host cache. Intended to be used to prevent exposing recently |
| 161 // visited sites on about:net-internals/#dns and about:dns pages. Must be | 150 // visited sites on about:net-internals/#dns and about:dns pages. Must be |
| 162 // called on the IO thread. | 151 // called on the IO thread. |
| 163 void ClearHostCache(); | 152 void ClearHostCache(); |
| 164 | 153 |
| 165 // Returns an SSLConfigService instance. | 154 // Returns an SSLConfigService instance. |
| 166 net::SSLConfigService* GetSSLConfigService(); | 155 net::SSLConfigService* GetSSLConfigService(); |
| 167 | 156 |
| 168 // The NetLog is owned by the browser process, to allow logging from other | 157 // The NetLog is owned by the browser process, to allow logging from other |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 197 std::string auth_delegate_whitelist_; | 186 std::string auth_delegate_whitelist_; |
| 198 std::string gssapi_library_name_; | 187 std::string gssapi_library_name_; |
| 199 | 188 |
| 200 // This is an instance of the default SSLConfigServiceManager for the current | 189 // This is an instance of the default SSLConfigServiceManager for the current |
| 201 // platform and it gets SSL preferences from local_state object. | 190 // platform and it gets SSL preferences from local_state object. |
| 202 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; | 191 scoped_ptr<SSLConfigServiceManager> ssl_config_service_manager_; |
| 203 | 192 |
| 204 // These member variables are initialized by a task posted to the IO thread, | 193 // These member variables are initialized by a task posted to the IO thread, |
| 205 // which gets posted by calling certain member functions of IOThread. | 194 // which gets posted by calling certain member functions of IOThread. |
| 206 | 195 |
| 207 // Note: we user explicit pointers rather than smart pointers to be more | 196 // Note: we user explicit pointers rather than smart pointers to be more |
|
willchan no longer on Chromium
2011/08/10 16:10:35
This comment is no longer true, just delete it.
rpetterson
2011/08/12 03:12:36
Done.
| |
| 208 // explicit about destruction order, and ensure that there is no chance that | 197 // explicit about destruction order, and ensure that there is no chance that |
| 209 // these observers would be used accidentally after we have begun to tear | 198 // these observers would be used accidentally after we have begun to tear |
| 210 // down. | 199 // down. |
| 211 chrome_browser_net::ConnectInterceptor* speculative_interceptor_; | |
| 212 chrome_browser_net::Predictor* predictor_; | |
| 213 | |
| 214 scoped_ptr<net::ProxyConfigService> system_proxy_config_service_; | 200 scoped_ptr<net::ProxyConfigService> system_proxy_config_service_; |
| 215 | 201 |
| 216 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; | 202 scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; |
| 217 | 203 |
| 218 scoped_refptr<net::URLRequestContextGetter> | 204 scoped_refptr<net::URLRequestContextGetter> |
| 219 system_url_request_context_getter_; | 205 system_url_request_context_getter_; |
| 220 | 206 |
| 221 ScopedRunnableMethodFactory<IOThread> method_factory_; | 207 ScopedRunnableMethodFactory<IOThread> method_factory_; |
| 222 | 208 |
| 223 DISALLOW_COPY_AND_ASSIGN(IOThread); | 209 DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 224 }; | 210 }; |
| 225 | 211 |
| 226 #endif // CHROME_BROWSER_IO_THREAD_H_ | 212 #endif // CHROME_BROWSER_IO_THREAD_H_ |
| OLD | NEW |