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 69098b792378490aa48f36fd78b8e5c76522204f..d662df288e732705e0a15ffcae9c3dd830aeead0 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 |
@@ -5,6 +5,7 @@ |
#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_H_ |
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_CONFIG_H_ |
+#include "base/callback.h" |
#include "base/gtest_prod_util.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
@@ -14,8 +15,13 @@ |
#include "net/base/net_log.h" |
#include "net/base/net_util.h" |
#include "net/base/network_change_notifier.h" |
+#include "net/http/http_network_layer.h" |
sclittle
2015/04/02 00:06:59
Remove unnecessary include.
tbansal1
2015/04/02 23:21:19
Done.
|
#include "net/proxy/proxy_config.h" |
#include "net/proxy/proxy_retry_info.h" |
+#include "net/url_request/url_fetcher_delegate.h" |
sclittle
2015/04/02 00:07:00
Remove unnecessary include.
tbansal1
2015/04/02 23:21:19
Not done. This is required.
sclittle
2015/04/03 02:06:56
Could you move it to the .cc file then? I don't se
tbansal1
2015/04/03 22:14:42
Done.
|
+#include "net/url_request/url_request_context_getter.h" |
sclittle
2015/04/02 00:07:00
Remove unnecessary include.
tbansal1
2015/04/02 23:21:19
Done.
|
+ |
+class GURL; |
namespace base { |
class SingleThreadTaskRunner; |
@@ -27,10 +33,16 @@ class HostPortPair; |
class NetLog; |
class URLRequest; |
class URLRequestStatus; |
+class URLFetcher; |
sclittle
2015/04/02 00:06:59
Alphabetize these.
tbansal1
2015/04/02 23:21:19
Done.
|
+class URLRequestContextGetter; |
} |
namespace data_reduction_proxy { |
+typedef base::Callback<void(const std::string&, const net::URLRequestStatus&)> |
sclittle
2015/04/02 00:06:59
Add an include for <string>
tbansal1
2015/04/02 23:21:19
Done.
|
+FetcherResponseCallback; |
+ |
+class SecureProxyChecker; |
sclittle
2015/04/02 00:06:59
Alphabetize these.
tbansal1
2015/04/02 23:21:19
Done.
|
class DataReductionProxyConfigValues; |
class DataReductionProxyConfigurator; |
class DataReductionProxyEventStore; |
@@ -73,6 +85,7 @@ class DataReductionProxyConfig |
// of the |DataReductionProxyConfig| instance, with the exception of |params| |
// which this instance will own. |
DataReductionProxyConfig( |
+ scoped_refptr<net::URLRequestContextGetter> request_context_getter, |
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
net::NetLog* net_log, |
@@ -189,6 +202,13 @@ class DataReductionProxyConfig |
virtual void GetNetworkList(net::NetworkInterfaceList* interfaces, |
int policy); |
+ // Requests the given |secure_proxy_check_url|. Upon completion, returns the |
+ // results to the caller via the |fetcher_callback|. Virtualized for unit |
+ // testing. |
+ virtual void SecureProxyCheck( |
+ const GURL& secure_proxy_check_url, |
+ FetcherResponseCallback fetcher_callback); |
+ |
private: |
friend class DataReductionProxyConfigTest; |
friend class MockDataReductionProxyConfig; |
@@ -204,6 +224,10 @@ class DataReductionProxyConfig |
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, |
AreProxiesBypassedRetryDelay); |
+ scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; |
sclittle
2015/04/02 00:06:59
Move these below the private methods.
tbansal1
2015/04/02 23:21:19
Done.
|
+ scoped_ptr<SecureProxyChecker> secure_proxy_checker_; |
+ |
+ |
// NetworkChangeNotifier::IPAddressObserver: |
void OnIPAddressChanged() override; |
@@ -224,8 +248,6 @@ class DataReductionProxyConfig |
// Data Reduction Proxy rules. |
virtual void HandleSecureProxyCheckResponse( |
const std::string& response, const net::URLRequestStatus& status); |
- virtual void HandleSecureProxyCheckResponseOnIOThread( |
- const std::string& response, const net::URLRequestStatus& status); |
// Adds the default proxy bypass rules for the Data Reduction Proxy. |
void AddDefaultProxyBypassRules(); |