Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: chrome/browser/net/predictor.h

Issue 2004453002: Add a Dns preresolve interface in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@predictor_dns_browsertest
Patch Set: safe callbacks Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/predictor.h
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h
index 78348757f3461ffee28a6a258b9efa6a81acc602..8b2165f411b0c6fed5750131c2e8aeb03d09b104 100644
--- a/chrome/browser/net/predictor.h
+++ b/chrome/browser/net/predictor.h
@@ -25,7 +25,6 @@
#include <map>
#include <memory>
#include <queue>
-#include <set>
#include <string>
#include <vector>
@@ -277,10 +276,6 @@ class Predictor {
static GURL CanonicalizeUrl(const GURL& url);
// Used for testing.
- void SetHostResolver(net::HostResolver* host_resolver) {
- host_resolver_ = host_resolver;
- }
- // Used for testing.
void SetTransportSecurityState(
net::TransportSecurityState* transport_security_state) {
transport_security_state_ = transport_security_state;
@@ -335,8 +330,6 @@ class Predictor {
friend class WaitForResolutionHelper; // For testing.
friend class PredictorBrowserTest;
- class LookupRequest;
-
// A simple priority queue for handling host names.
// Some names that are queued up have |motivation| that requires very rapid
// handling. For example, a sub-resource name lookup MUST be done before the
@@ -457,11 +450,10 @@ class Predictor {
const GURL& first_party_for_cookies);
// Access method for use by async lookup request to pass resolution result.
- void OnLookupFinished(LookupRequest* request, const GURL& url, bool found);
+ void OnLookupFinished(const GURL& url, int result);
// Underlying method for both async and synchronous lookup to update state.
- void LookupFinished(LookupRequest* request,
- const GURL& url, bool found);
+ void LookupFinished(const GURL& url, bool found);
// Queue hostname for resolution. If queueing was done, return the pointer
// to the queued instance, otherwise return NULL. If the proxy advisor is
@@ -539,7 +531,7 @@ class Predictor {
// results_ contains information for existing/prior prefetches.
Results results_;
- std::set<LookupRequest*> pending_lookups_;
+ size_t num_pending_lookups_;
// For testing, to verify that we don't exceed the limit.
size_t peak_pending_lookups_;
@@ -557,9 +549,6 @@ class Predictor {
// reduction mode, and discard all queued (but not yet assigned) resolutions.
const base::TimeDelta max_dns_queue_delay_;
- // The host resolver we warm DNS entries for.
- net::HostResolver* host_resolver_;
-
// The TransportSecurityState instance we query HSTS redirects from.
net::TransportSecurityState* transport_security_state_;

Powered by Google App Engine
This is Rietveld 408576698