diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-15 05:08:42 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-15 05:08:42 +0000 |
commit | 2884a4619edeac1787e2b1d1b57e913f7e442cae (patch) | |
tree | f194f30877c49ce17031a29393143039eacfb496 /net/http | |
parent | 202e7a773359b24943d7de0943dd9c7d257ab1cb (diff) | |
download | chromium_src-2884a4619edeac1787e2b1d1b57e913f7e442cae.zip chromium_src-2884a4619edeac1787e2b1d1b57e913f7e442cae.tar.gz chromium_src-2884a4619edeac1787e2b1d1b57e913f7e442cae.tar.bz2 |
* Move the global "DnsResolutionObserver" code depended on by DNS prefetcher, into HostResolver. This has the advantage that consumers of DNS no longer have to remember to call "DidFinishDnsResolutionWithStatus()" followed by "DidStartDnsResolution()" in order for the prefetcher to observe the resolution. Instead it just happens automatically, and subscribers register via HostResolver::AddObserver() on a particular resolver instance.
* To accomodate the prefetcher's observer, HostResolver::Resolve() needs an additional "referrer" parameter. This is slightly awkward since "referrer" has nothing to do with the actual resolve request. To simplify plumbing through this and other optional parameters, Resolve() was changed to take a "RequestInfo&" parameter in place of say {hostname, port, flags}.
* Added an option to HostResolver::Resolve() for disallowing cached responses (RequestInfo::allow_cached_response). This will be used when you refresh a page, to bypass the host cache. The code to do this has been added to HttpNetworkTransaction, but is commented out pending an appropriate unit-test to verify it.
BUG=14056
Review URL: http://codereview.chromium.org/125107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_network_transaction.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 4fbd5cb..d5cd81f 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -570,7 +570,26 @@ int HttpNetworkTransaction::DoInitConnection() { connection_group.append(request_->url.GetOrigin().spec()); DCHECK(!connection_group.empty()); - int rv = connection_.Init(connection_group, host, port, request_->priority, + + HostResolver::RequestInfo resolve_info(host, port); + + // The referrer is used by the DNS prefetch system to corellate resolutions + // with the page that triggered them. It doesn't impact the actual addresses + // that we resolve to. + resolve_info.set_referrer(request_->referrer); + +// TODO(eroman): Enable this! +// Needs some unit-tests before turning on. +// http://crbug.com/13163 +#if 0 + // If the user is refreshing the page, bypass the host cache. + if (request_->load_flags & LOAD_BYPASS_CACHE || + request_->load_flags & LOAD_DISABLE_CACHE) { + resolve_info.allow_cached_response = false; + } +#endif + + int rv = connection_.Init(connection_group, resolve_info, request_->priority, &io_callback_); return rv; } |