From b1af343a7deb23a3229cc07d65285b5247c8ad46 Mon Sep 17 00:00:00 2001 From: "rlp@chromium.org" Date: Fri, 19 Aug 2011 09:36:14 +0000 Subject: Modifying prefetch to account for multi-profile. Items of note: - predictor_api is gone. Most functions in predictor_api.cc have moved into the chrome_browser_net::Predictor class or the Profile class. - The predictor state is cleaned up in the Profile dtor. - Predictor is owned by the ProfileIOData of the profile. - InitialObserver class is gone since each profile keeps their own info, the non-OTR don't care if anyone is OTR. - Predictor is created by the profile and then passed to the ProfileIOData. Then its initialization is finished on the IOThread. - ConnectInterceptor now subclasses off of UrlRequestJobFactory::Interceptor. - Updated Profile to create a SimpleShutdownPredictor with limited functionality when in unittests. BUG=89937 TEST=passes existing Review URL: http://codereview.chromium.org/7467012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97446 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/io_thread.h | 52 ++++------------------------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) (limited to 'chrome/browser/io_thread.h') diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index a2b42b5..9340f39 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -14,7 +14,6 @@ #include "chrome/browser/browser_process_sub_thread.h" #include "chrome/browser/net/ssl_config_service_manager.h" #include "chrome/browser/prefs/pref_member.h" -#include "chrome/common/net/predictor_common.h" #include "net/base/network_change_notifier.h" class ChromeNetLog; @@ -29,11 +28,6 @@ namespace base { class ListValue; } -namespace chrome_browser_net { -class ConnectInterceptor; -class Predictor; -} // namespace chrome_browser_net - namespace net { class CertVerifier; class CookieStore; @@ -109,28 +103,13 @@ class IOThread : public BrowserProcessSubThread { ChromeNetLog* net_log(); - // Initializes the network predictor, which induces DNS pre-resolution and/or - // TCP/IP preconnections. |prefetching_enabled| indicates whether or not DNS - // prefetching should be enabled, and |preconnect_enabled| controls whether - // TCP/IP preconnection is enabled. This should be called by the UI thread. - // It will post a task to the IO thread to perform the actual initialization. - void InitNetworkPredictor(bool prefetching_enabled, - base::TimeDelta max_dns_queue_delay, - size_t max_speculative_parallel_resolves, - const chrome_common_net::UrlList& startup_urls, - base::ListValue* referral_list, - bool preconnect_enabled); - - // Handles changing to On The Record mode, discarding confidential data. - void ChangedToOnTheRecord(); - // Returns a getter for the URLRequestContext. Only called on the UI thread. net::URLRequestContextGetter* system_url_request_context_getter(); - // Clear all network stack history, including the host cache, as well as - // speculative data about subresources of visited sites, and startup-time - // navigations. - void ClearNetworkingHistory(); + // Clears the host cache. Intended to be used to prevent exposing recently + // visited sites on about:net-internals/#dns and about:dns pages. Must be + // called on the IO thread. + void ClearHostCache(); protected: virtual void Init(); @@ -152,21 +131,6 @@ class IOThread : public BrowserProcessSubThread { // SystemURLRequestContextGetter. To be called on IO thread. void InitSystemRequestContextOnIOThread(); - void InitNetworkPredictorOnIOThread( - bool prefetching_enabled, - base::TimeDelta max_dns_queue_delay, - size_t max_speculative_parallel_resolves, - const chrome_common_net::UrlList& startup_urls, - base::ListValue* referral_list, - bool preconnect_enabled); - - void ChangedToOnTheRecordOnIOThread(); - - // Clears the host cache. Intended to be used to prevent exposing recently - // visited sites on about:net-internals/#dns and about:dns pages. Must be - // called on the IO thread. - void ClearHostCache(); - // Returns an SSLConfigService instance. net::SSLConfigService* GetSSLConfigService(); @@ -208,14 +172,6 @@ class IOThread : public BrowserProcessSubThread { // These member variables are initialized by a task posted to the IO thread, // which gets posted by calling certain member functions of IOThread. - - // Note: we user explicit pointers rather than smart pointers to be more - // explicit about destruction order, and ensure that there is no chance that - // these observers would be used accidentally after we have begun to tear - // down. - chrome_browser_net::ConnectInterceptor* speculative_interceptor_; - chrome_browser_net::Predictor* predictor_; - scoped_ptr system_proxy_config_service_; scoped_refptr pref_proxy_config_tracker_; -- cgit v1.1