| 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 df01795fcaf93e5281e71137da129764b055ba88..bb309977bf556c88f81810d3414b06ebc32ae123 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
|
| @@ -14,11 +14,13 @@
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "base/time/time.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/base/network_change_notifier.h"
|
| #include "net/base/network_interfaces.h"
|
| +#include "net/base/trusted_spdy_proxy_provider.h"
|
| #include "net/log/net_log.h"
|
| #include "net/proxy/proxy_config.h"
|
| #include "net/proxy/proxy_retry_info.h"
|
| @@ -29,6 +31,7 @@ namespace net {
|
| class HostPortPair;
|
| class NetLog;
|
| class NetworkQualityEstimator;
|
| +class ProxyServer;
|
| class URLFetcher;
|
| class URLRequest;
|
| class URLRequestContextGetter;
|
| @@ -80,7 +83,8 @@ enum SecureProxyCheckFetchResult {
|
| // This object lives on the IO thread and all of its methods are expected to be
|
| // called from there.
|
| class DataReductionProxyConfig
|
| - : public net::NetworkChangeNotifier::IPAddressObserver {
|
| + : public net::NetworkChangeNotifier::IPAddressObserver,
|
| + public net::TrustedSpdyProxyProvider {
|
| public:
|
| // The caller must ensure that all parameters remain alive for the lifetime
|
| // of the |DataReductionProxyConfig| instance, with the exception of
|
| @@ -190,6 +194,12 @@ class DataReductionProxyConfig
|
| // the URLRequestContext.
|
| bool ShouldEnableLoFiMode(const net::URLRequest& request);
|
|
|
| + // Implements net::TrustedSpdyProxyProvider and sets |trusted_spdy_proxy| to a
|
| + // secure data reduction proxy. |trusted_spdy_proxy| must be non-null.
|
| + void GetTrustedSpdyProxy(net::ProxyServer* trusted_spdy_proxy) const override;
|
| +
|
| + base::WeakPtr<net::TrustedSpdyProxyProvider> GetWeakPtr() override;
|
| +
|
| protected:
|
| // Virtualized for mocking. Records UMA containing the result of requesting
|
| // the secure proxy check.
|
| @@ -217,6 +227,7 @@ class DataReductionProxyConfig
|
| AreProxiesBypassed);
|
| FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest,
|
| AreProxiesBypassedRetryDelay);
|
| + FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, TrustedSpdyProxy);
|
| FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, AutoLoFiParams);
|
| FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest,
|
| AutoLoFiParamsSlowConnectionsFlag);
|
| @@ -358,6 +369,8 @@ class DataReductionProxyConfig
|
| // request headers are never modified in the control group.
|
| bool previous_state_lofi_on_;
|
|
|
| + base::WeakPtrFactory<TrustedSpdyProxyProvider> weak_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfig);
|
| };
|
|
|
|
|