diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 01:22:43 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-23 01:22:43 +0000 |
commit | c5629c3842ca9fab0a6bb71a478df3fc528b8837 (patch) | |
tree | 8141f7d0b43e0cba093f049b688a336693abab1b /chrome/browser/io_thread.h | |
parent | 3f9345838d9af871413f7350ca587b0152299e02 (diff) | |
download | chromium_src-c5629c3842ca9fab0a6bb71a478df3fc528b8837.zip chromium_src-c5629c3842ca9fab0a6bb71a478df3fc528b8837.tar.gz chromium_src-c5629c3842ca9fab0a6bb71a478df3fc528b8837.tar.bz2 |
Do speculative preconnection based on network traffic (not just DNS)
This rev also handles the triple of scheme/host/port for recording
both referrers and speculative connections, so that we
can soon support SSL warming as well as "mere" TCP/IP
preconnection.
r=mbelshe
Review URL: http://codereview.chromium.org/2563004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50563 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.h')
-rw-r--r-- | chrome/browser/io_thread.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index 4c7374e..83a781d 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_IO_THREAD_H_ #define CHROME_BROWSER_IO_THREAD_H_ +#include <vector> + #include "base/basictypes.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" @@ -12,6 +14,7 @@ #include "chrome/browser/browser_process_sub_thread.h" #include "chrome/browser/net/chrome_network_delegate.h" #include "chrome/common/net/dns.h" +#include "chrome/browser/net/connect_interceptor.h" #include "net/base/host_resolver.h" class ChromeNetLog; @@ -47,14 +50,15 @@ class IOThread : public BrowserProcessSubThread { // Can only be called on the IO thread. Globals* globals(); - // Initializes the DnsMaster. |prefetching_enabled| indicates whether or - // not dns prefetching should be enabled. This should be called by the UI - // thread. It will post a task to the IO thread to perform the actual - // initialization. + // 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 InitDnsMaster(bool prefetching_enabled, base::TimeDelta max_queue_delay, size_t max_concurrent, - const chrome_common_net::NameList& hostnames_to_prefetch, + const chrome_common_net::UrlList& startup_urls, ListValue* referral_list, bool preconnect_enabled); @@ -74,7 +78,8 @@ class IOThread : public BrowserProcessSubThread { bool prefetching_enabled, base::TimeDelta max_queue_delay, size_t max_concurrent, - chrome_common_net::NameList hostnames_to_prefetch, + const chrome_common_net::UrlList& startup_urls, + ListValue* referral_list, bool preconnect_enabled); @@ -99,6 +104,11 @@ 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_; net::HostResolver::Observer* prefetch_observer_; chrome_browser_net::DnsMaster* dns_master_; |