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

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

Issue 545633002: Don't preresolve DNS if a fixed proxy configuration is in place. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo no-longer-needed virtual marking Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | chrome/browser/net/predictor.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor.h
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h
index 85b8d1894cd031b11c8304931530d0df54cfec86..d9df615d670efc33b0cc4c9546e1b3f460dfa031 100644
--- a/chrome/browser/net/predictor.h
+++ b/chrome/browser/net/predictor.h
@@ -49,6 +49,7 @@ class WaitableEvent;
namespace net {
class HostResolver;
class SSLConfigService;
+class ProxyService;
class TransportSecurityState;
class URLRequestContextGetter;
}
@@ -318,6 +319,10 @@ class Predictor {
FRIEND_TEST_ALL_PREFIXES(PredictorTest, SingleLookupTestWithDisabledAdvisor);
FRIEND_TEST_ALL_PREFIXES(PredictorTest, SingleLookupTestWithEnabledAdvisor);
FRIEND_TEST_ALL_PREFIXES(PredictorTest, TestSimplePreconnectAdvisor);
+ FRIEND_TEST_ALL_PREFIXES(PredictorTest, NoProxyService);
+ FRIEND_TEST_ALL_PREFIXES(PredictorTest, ProxyDefinitelyEnabled);
+ FRIEND_TEST_ALL_PREFIXES(PredictorTest, ProxyDefinitelyNotEnabled);
+ FRIEND_TEST_ALL_PREFIXES(PredictorTest, ProxyMaybeEnabled);
friend class WaitForResolutionHelper; // For testing.
class LookupRequest;
@@ -501,6 +506,13 @@ class Predictor {
UrlInfo::ResolutionMotivation motivation,
bool is_preconnect);
+ // If we can determine immediately (i.e. synchronously) that requests to this
+ // URL would likely go through a proxy, then return true. Otherwise, return
+ // false. This is used to avoid issuing DNS requests when a fixed proxy
+ // configuration is in place, which improves efficiency, and is also important
+ // if the unproxied DNS may contain incorrect entries.
+ bool WouldLikelyProxyURL(const GURL& url);
+
// Applies the HSTS redirect for |url|, if any.
GURL GetHSTSRedirectOnIOThread(const GURL& url);
@@ -558,6 +570,9 @@ class Predictor {
// redirects).
net::SSLConfigService* ssl_config_service_;
+ // The ProxyService, used to determine whether preresolve is useful.
+ net::ProxyService* proxy_service_;
+
// Are we currently using preconnection, rather than just DNS resolution, for
// subresources and omni-box search URLs.
// This is false if and only if disabled by a command line switch.
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | chrome/browser/net/predictor.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698