| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <string> | 10 #include <string> |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.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/task.h" | 14 #include "base/task.h" |
| 15 #include "chrome/browser/browser_process_sub_thread.h" | 15 #include "chrome/browser/browser_process_sub_thread.h" |
| 16 #include "chrome/browser/net/ssl_config_service_manager.h" | 16 #include "chrome/browser/net/ssl_config_service_manager.h" |
| 17 #include "chrome/browser/prefs/pref_member.h" | 17 #include "chrome/browser/prefs/pref_member.h" |
| 18 #include "chrome/common/net/predictor_common.h" | 18 #include "chrome/common/net/predictor_common.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 ChromeURLRequestContextGetter; | 22 class ChromeURLRequestContextGetter; |
| 23 class ExtensionEventRouterForwarder; | 23 class ExtensionEventRouterForwarder; |
| 24 class ListValue; | |
| 25 class MediaInternals; | 24 class MediaInternals; |
| 26 class PrefProxyConfigTracker; | 25 class PrefProxyConfigTracker; |
| 27 class PrefService; | 26 class PrefService; |
| 28 class SystemURLRequestContextGetter; | 27 class SystemURLRequestContextGetter; |
| 29 | 28 |
| 29 namespace base { |
| 30 class ListValue; |
| 31 } |
| 32 |
| 30 namespace chrome_browser_net { | 33 namespace chrome_browser_net { |
| 31 class ConnectInterceptor; | 34 class ConnectInterceptor; |
| 32 class Predictor; | 35 class Predictor; |
| 33 } // namespace chrome_browser_net | 36 } // namespace chrome_browser_net |
| 34 | 37 |
| 35 namespace net { | 38 namespace net { |
| 36 class CertVerifier; | 39 class CertVerifier; |
| 37 class DnsRRResolver; | 40 class DnsRRResolver; |
| 38 class FtpTransactionFactory; | 41 class FtpTransactionFactory; |
| 39 class HostResolver; | 42 class HostResolver; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 107 |
| 105 // Initializes the network predictor, which induces DNS pre-resolution and/or | 108 // Initializes the network predictor, which induces DNS pre-resolution and/or |
| 106 // TCP/IP preconnections. |prefetching_enabled| indicates whether or not DNS | 109 // TCP/IP preconnections. |prefetching_enabled| indicates whether or not DNS |
| 107 // prefetching should be enabled, and |preconnect_enabled| controls whether | 110 // prefetching should be enabled, and |preconnect_enabled| controls whether |
| 108 // TCP/IP preconnection is enabled. This should be called by the UI thread. | 111 // TCP/IP preconnection is enabled. This should be called by the UI thread. |
| 109 // It will post a task to the IO thread to perform the actual initialization. | 112 // It will post a task to the IO thread to perform the actual initialization. |
| 110 void InitNetworkPredictor(bool prefetching_enabled, | 113 void InitNetworkPredictor(bool prefetching_enabled, |
| 111 base::TimeDelta max_dns_queue_delay, | 114 base::TimeDelta max_dns_queue_delay, |
| 112 size_t max_speculative_parallel_resolves, | 115 size_t max_speculative_parallel_resolves, |
| 113 const chrome_common_net::UrlList& startup_urls, | 116 const chrome_common_net::UrlList& startup_urls, |
| 114 ListValue* referral_list, | 117 base::ListValue* referral_list, |
| 115 bool preconnect_enabled); | 118 bool preconnect_enabled); |
| 116 | 119 |
| 117 // Registers |url_request_context_getter| into the IO thread. During | 120 // Registers |url_request_context_getter| into the IO thread. During |
| 118 // IOThread::CleanUp(), IOThread will iterate through known getters and | 121 // IOThread::CleanUp(), IOThread will iterate through known getters and |
| 119 // release their URLRequestContexts. Only called on the IO thread. It does | 122 // release their URLRequestContexts. Only called on the IO thread. It does |
| 120 // not acquire a refcount for |url_request_context_getter|. If | 123 // not acquire a refcount for |url_request_context_getter|. If |
| 121 // |url_request_context_getter| is being deleted before IOThread::CleanUp() is | 124 // |url_request_context_getter| is being deleted before IOThread::CleanUp() is |
| 122 // invoked, then this needs to be balanced with a call to | 125 // invoked, then this needs to be balanced with a call to |
| 123 // UnregisterURLRequestContextGetter(). | 126 // UnregisterURLRequestContextGetter(). |
| 124 void RegisterURLRequestContextGetter( | 127 void RegisterURLRequestContextGetter( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 161 |
| 159 // Lazy initialization of system request context for | 162 // Lazy initialization of system request context for |
| 160 // SystemURLRequestContextGetter. To be called on IO thread. | 163 // SystemURLRequestContextGetter. To be called on IO thread. |
| 161 void InitSystemRequestContextOnIOThread(); | 164 void InitSystemRequestContextOnIOThread(); |
| 162 | 165 |
| 163 void InitNetworkPredictorOnIOThread( | 166 void InitNetworkPredictorOnIOThread( |
| 164 bool prefetching_enabled, | 167 bool prefetching_enabled, |
| 165 base::TimeDelta max_dns_queue_delay, | 168 base::TimeDelta max_dns_queue_delay, |
| 166 size_t max_speculative_parallel_resolves, | 169 size_t max_speculative_parallel_resolves, |
| 167 const chrome_common_net::UrlList& startup_urls, | 170 const chrome_common_net::UrlList& startup_urls, |
| 168 ListValue* referral_list, | 171 base::ListValue* referral_list, |
| 169 bool preconnect_enabled); | 172 bool preconnect_enabled); |
| 170 | 173 |
| 171 void ChangedToOnTheRecordOnIOThread(); | 174 void ChangedToOnTheRecordOnIOThread(); |
| 172 | 175 |
| 173 // Clears the host cache. Intended to be used to prevent exposing recently | 176 // Clears the host cache. Intended to be used to prevent exposing recently |
| 174 // visited sites on about:net-internals/#dns and about:dns pages. Must be | 177 // visited sites on about:net-internals/#dns and about:dns pages. Must be |
| 175 // called on the IO thread. | 178 // called on the IO thread. |
| 176 void ClearHostCache(); | 179 void ClearHostCache(); |
| 177 | 180 |
| 178 // Returns an SSLConfigService instance. | 181 // Returns an SSLConfigService instance. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // ChromeURLRequestContexts can be released during | 238 // ChromeURLRequestContexts can be released during |
| 236 // IOThread::CleanUp(). | 239 // IOThread::CleanUp(). |
| 237 std::list<ChromeURLRequestContextGetter*> url_request_context_getters_; | 240 std::list<ChromeURLRequestContextGetter*> url_request_context_getters_; |
| 238 | 241 |
| 239 ScopedRunnableMethodFactory<IOThread> method_factory_; | 242 ScopedRunnableMethodFactory<IOThread> method_factory_; |
| 240 | 243 |
| 241 DISALLOW_COPY_AND_ASSIGN(IOThread); | 244 DISALLOW_COPY_AND_ASSIGN(IOThread); |
| 242 }; | 245 }; |
| 243 | 246 |
| 244 #endif // CHROME_BROWSER_IO_THREAD_H_ | 247 #endif // CHROME_BROWSER_IO_THREAD_H_ |
| OLD | NEW |