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..b733a3ef88b9fa63cff3b06751ef29bb73190972 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,13 @@ class DataReductionProxyConfig |
// the URLRequestContext. |
bool ShouldEnableLoFiMode(const net::URLRequest& request); |
+ // Overrides net::TrustedSpdyProxyProvider implementation that sets |
bengr
2016/01/12 21:43:03
Revert to:
// Implements net::... and sets |truste
tbansal1
2016/01/12 23:43:49
Done.
|
+ // |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 +228,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 +370,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); |
}; |