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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h

Issue 2503273002: Fetch a warmup URL if data reduction proxy is enabled (Closed)
Patch Set: ryansturm comments Created 4 years 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 | components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
index 385bf60ea791135f7f7426cd445cee62bb791149..3fe9f61a1a31d74d8e5f5f0eeeae89d3d9fdace1 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
@@ -51,6 +51,7 @@ class DataReductionProxyConfigValues;
class DataReductionProxyConfigurator;
class DataReductionProxyEventCreator;
class SecureProxyChecker;
+class WarmupURLFetcher;
struct DataReductionProxyTypeInfo;
// Values of the UMA DataReductionProxy.ProbeURL histogram.
@@ -103,7 +104,13 @@ class DataReductionProxyConfig
~DataReductionProxyConfig() override;
// Performs initialization on the IO thread.
+ // |basic_url_request_context_getter| is the net::URLRequestContextGetter that
+ // disables the use of alternative protocols and proxies.
+ // |url_request_context_getter| is the default net::URLRequestContextGetter
+ // used for making URL requests.
void InitializeOnIOThread(const scoped_refptr<net::URLRequestContextGetter>&
+ basic_url_request_context_getter,
+ const scoped_refptr<net::URLRequestContextGetter>&
url_request_context_getter);
// Sets the proxy configs, enabling or disabling the proxy according to
@@ -214,6 +221,10 @@ class DataReductionProxyConfig
// Updates the Data Reduction Proxy configurator with the current config.
void UpdateConfigForTesting(bool enabled, bool restricted);
+ // Updates the callback that is called when the warmup URL has been fetched.
+ void SetWarmupURLFetcherCallbackForTesting(
+ base::Callback<void()> warmup_url_fetched_callback);
+
private:
friend class MockDataReductionProxyConfig;
friend class TestDataReductionProxyConfig;
@@ -230,6 +241,7 @@ class DataReductionProxyConfig
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, LoFiAccuracy);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest,
LoFiAccuracyNonZeroDelay);
+ FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, WarmupURL);
// Values of the estimated network quality at the beginning of the most
// recent query of the Network Quality Estimator.
@@ -308,8 +320,15 @@ class DataReductionProxyConfig
// for testing.
virtual bool GetIsCaptivePortal() const;
+ // Fetches the warmup URL.
+ void FetchWarmupURL();
+
+ // URL fetcher used for performing the secure proxy check.
std::unique_ptr<SecureProxyChecker> secure_proxy_checker_;
+ // URL fetcher used for fetching the warmup URL.
+ std::unique_ptr<WarmupURLFetcher> warmup_url_fetcher_;
+
// Indicates if the secure Data Reduction Proxy can be used or not.
bool secure_proxy_allowed_;
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698