summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 00:39:18 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 00:39:18 +0000
commit760d970aa408a7ea9a00e4e2ab792ef05f9355e5 (patch)
treee6699d0e0b2fb930685ce1e346ca41db566c8c21 /net
parentd71cc6cc3834d8824c063b9fccf75b3559f545f3 (diff)
downloadchromium_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 'net')
-rw-r--r--net/base/host_port_pair.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/base/host_port_pair.h b/net/base/host_port_pair.h
index 35d244e..78f74ea 100644
--- a/net/base/host_port_pair.h
+++ b/net/base/host_port_pair.h
@@ -17,12 +17,18 @@ struct HostPortPair {
// TODO(willchan): Define a functor instead.
// Comparator function so this can be placed in a std::map.
+ // TODO(jar): Violation of style guide, and should be removed.
bool operator<(const HostPortPair& other) const {
if (port != other.port)
return port < other.port;
return host < other.host;
}
+ // Equality test of contents. (Probably another violation of style guide).
+ bool Equals(const HostPortPair& other) const {
+ return host == other.host && port == other.port;
+ }
+
// ToString() will convert the HostPortPair to "host:port". If |host| is an
// IPv6 literal, it will add brackets around |host|.
std::string ToString() const;