namespace net {
class HostResolver;
class SSLConfigService;
+class ProxyService;
class TransportSecurityState;
class URLRequestContextGetter;
}
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;
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);
// 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.
public:
explicit SimplePredictor(bool preconnect_enabled, bool predictor_enabled)
: Predictor(preconnect_enabled, predictor_enabled) {}
- virtual ~SimplePredictor() {}
- virtual void InitNetworkPredictor(
- PrefService* user_prefs,
- PrefService* local_state,
- IOThread* io_thread,
- net::URLRequestContextGetter* getter,
- ProfileIOData* profile_io_data) OVERRIDE;
- virtual void ShutdownOnUIThread() OVERRIDE;
+ ~SimplePredictor() override {}
+ void InitNetworkPredictor(PrefService* user_prefs,
+ PrefService* local_state,
+ IOThread* io_thread,
+ net::URLRequestContextGetter* getter,
+ ProfileIOData* profile_io_data) override;
+ void ShutdownOnUIThread() override;
+
private:
// These member functions return True for unittests.
- virtual bool CanPrefetchAndPrerender() const OVERRIDE;
- virtual bool CanPreresolveAndPreconnect() const OVERRIDE;
+ bool CanPrefetchAndPrerender() const override;
+ bool CanPreresolveAndPreconnect() const override;
};
} // namespace chrome_browser_net