summaryrefslogtreecommitdiffstats
path: root/net/base
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/base
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/base')
-rw-r--r--net/base/dns_resolution_observer.cc7
-rw-r--r--net/base/dns_resolution_observer.h13
2 files changed, 15 insertions, 5 deletions
diff --git a/net/base/dns_resolution_observer.cc b/net/base/dns_resolution_observer.cc
index 46416d4..0b2e9d5 100644
--- a/net/base/dns_resolution_observer.cc
+++ b/net/base/dns_resolution_observer.cc
@@ -47,10 +47,13 @@ void DidStartDnsResolution(const std::string& name, void* context) {
current_observer->OnStartResolution(name, context);
}
-void DidFinishDnsResolutionWithStatus(bool was_resolved, void* context) {
+void DidFinishDnsResolutionWithStatus(bool was_resolved,
+ const GURL& referrer,
+ void* context) {
DnsResolutionObserver* current_observer = dns_resolution_observer;
if (current_observer) {
- current_observer->OnFinishResolutionWithStatus(was_resolved, context);
+ current_observer->OnFinishResolutionWithStatus(was_resolved, referrer,
+ context);
}
}
diff --git a/net/base/dns_resolution_observer.h b/net/base/dns_resolution_observer.h
index 1fd3c74..b03897d 100644
--- a/net/base/dns_resolution_observer.h
+++ b/net/base/dns_resolution_observer.h
@@ -15,6 +15,8 @@
#include <string>
+#include "googleurl/src/gurl.h"
+
namespace net {
class DnsResolutionObserver {
@@ -30,8 +32,10 @@ class DnsResolutionObserver {
// Once a matching pair of notifications has been provided (i.e., a pair with
// identical context values), and the notification methods (below) have
// returned, the context values *might* be reused.
- virtual void OnStartResolution(const std::string& name, void* context) = 0;
+ virtual void OnStartResolution(const std::string& host_name,
+ void* context) = 0;
virtual void OnFinishResolutionWithStatus(bool was_resolved,
+ const GURL& referrer,
void* context) = 0;
};
@@ -51,8 +55,11 @@ DnsResolutionObserver* RemoveDnsResolutionObserver();
// The following functions are expected to be called only by network stack
// implementations. This above observer class will relay the notifications
// to any registered observer.
-void DidStartDnsResolution(const std::string& name, void* context);
-void DidFinishDnsResolutionWithStatus(bool was_resolved, void* context);
+void DidStartDnsResolution(const std::string& name,
+ void* context);
+void DidFinishDnsResolutionWithStatus(bool was_resolved,
+ const GURL& url,
+ void* context);
} // namspace net
#endif // NET_BASE_DNS_RESOLUTION_OBSERVER_H_