diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 00:39:18 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-18 00:39:18 +0000 |
commit | 760d970aa408a7ea9a00e4e2ab792ef05f9355e5 (patch) | |
tree | e6699d0e0b2fb930685ce1e346ca41db566c8c21 /chrome/browser/net/dns_global.h | |
parent | d71cc6cc3834d8824c063b9fccf75b3559f545f3 (diff) | |
download | chromium_src-760d970aa408a7ea9a00e4e2ab792ef05f9355e5.zip chromium_src-760d970aa408a7ea9a00e4e2ab792ef05f9355e5.tar.gz chromium_src-760d970aa408a7ea9a00e4e2ab792ef05f9355e5.tar.bz2 |
Support speculative pre-connection to search URLs
Implement several flavors of TCP/IP speculative preconnection
under a command line flag (not yet on by default).
The first area of preconnection takes place when a user types
a query into the omnibox, as we preconnect to the search service
when the omnibox suggests it is going to do a search.
The second area involves subresources, such as images.
When a navigation takes place, and we've seen navigations
to that domain/port before, and the history-based
probabability that we'll need to make a connection to
a second site (host/port) is sufficiently large, then we
preconnect to that second site while we are still connecting
to the primary site (and before we've gotten content from
the primary site.
We also fall-back to mere DNS pre-resolution of subresource
hostnames when the probability of a connection to the
subresource is not high enough.
BUG=42694
r=pkasting,willchan,mbelshe
Review URL: http://codereview.chromium.org/1585029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47479 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/dns_global.h')
-rw-r--r-- | chrome/browser/net/dns_global.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/net/dns_global.h b/chrome/browser/net/dns_global.h index bc44b79..639f614 100644 --- a/chrome/browser/net/dns_global.h +++ b/chrome/browser/net/dns_global.h @@ -16,6 +16,7 @@ #include "base/field_trial.h" #include "base/scoped_ptr.h" +#include "chrome/browser/autocomplete/autocomplete.h" #include "chrome/browser/net/dns_master.h" #include "net/base/host_resolver.h" @@ -42,10 +43,16 @@ net::HostResolver::Observer* CreatePrefetchObserver(); void EnableDnsPrefetch(bool enable); void RegisterPrefs(PrefService* local_state); void RegisterUserPrefs(PrefService* user_prefs); + // Renderer bundles up list and sends to this browser API via IPC. void DnsPrefetchList(const NameList& hostnames); + // This API is used by the autocomplete popup box (as user types). -void DnsPrefetchUrl(const GURL& url); +// This will either preresolve the domain name, or possibly preconnect creating +// an open TCP/IP connection to the host. +void DnsPrefetchUrl(const GURL& url, bool preconnectable); + +// When displaying info in about:dns, the following API is called. void DnsPrefetchGetHtmlInfo(std::string* output); //------------------------------------------------------------------------------ @@ -63,7 +70,8 @@ class DnsGlobalInit { // of that state. The following is the suggested default time limit. static const int kMaxPrefetchQueueingDelayMs; - DnsGlobalInit(PrefService* user_prefs, PrefService* local_state); + DnsGlobalInit(PrefService* user_prefs, PrefService* local_state, + bool preconnect_enabled); private: // Maintain a field trial instance when we do A/B testing. |