summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-06 23:32:53 +0000
committerjar@google.com <jar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-06 23:32:53 +0000
commit21dae9b9628a3a7ef481c1871d69e9b48ed90158 (patch)
treeda091a8ff8222d6bfbde888972752d289644b4f7 /net/http
parenta2633667fc8bf1429fe33f5dd89b550e484a03c9 (diff)
downloadchromium_src-21dae9b9628a3a7ef481c1871d69e9b48ed90158.zip
chromium_src-21dae9b9628a3a7ef481c1871d69e9b48ed90158.tar.gz
chromium_src-21dae9b9628a3a7ef481c1871d69e9b48ed90158.tar.bz2
Adaptively identify URL subresources and pre-resolve hosts via DNS
Use the HTTP "referer" header to identify subresources used during a page load. Store that info, and use it when next visiting the referenced hosts to pre-resolve the (probably) needed subresources. This set of changes will surely evolve as we see how it plays out on broader distribution (via histogram measurments), but this should be the foundation of the change. In design specs, this was previously referred to as "adaptive correlated DNS prefetching." r=mbelshe Review URL: http://codereview.chromium.org/9168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4929 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction.cc2
-rw-r--r--net/http/http_transaction_winhttp.cc5
2 files changed, 5 insertions, 2 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index ae82b67..0c87b54 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -461,7 +461,7 @@ int HttpNetworkTransaction::DoResolveHost() {
int HttpNetworkTransaction::DoResolveHostComplete(int result) {
bool ok = (result == OK);
- DidFinishDnsResolutionWithStatus(ok, this);
+ DidFinishDnsResolutionWithStatus(ok, this->request_->referrer, this);
if (ok) {
next_state_ = STATE_CONNECT;
} else {
diff --git a/net/http/http_transaction_winhttp.cc b/net/http/http_transaction_winhttp.cc
index a1eb3f8..bb5f610 100644
--- a/net/http/http_transaction_winhttp.cc
+++ b/net/http/http_transaction_winhttp.cc
@@ -702,6 +702,7 @@ void HttpTransactionWinHttp::StatusCallback(HINTERNET handle,
if (API_SEND_REQUEST == result->dwResult &&
ERROR_WINHTTP_NAME_NOT_RESOLVED == result->dwError)
DidFinishDnsResolutionWithStatus(false,
+ GURL(), // null referrer URL.
reinterpret_cast<void*>(context));
break;
}
@@ -725,7 +726,9 @@ void HttpTransactionWinHttp::StatusCallback(HINTERNET handle,
}
// Successfully found the IP address of the server.
case WINHTTP_CALLBACK_STATUS_NAME_RESOLVED:
- DidFinishDnsResolutionWithStatus(true, reinterpret_cast<void*>(context));
+ DidFinishDnsResolutionWithStatus(true,
+ GURL(), // null referer URL.
+ reinterpret_cast<void*>(context));
break;
}
}