| Index: chrome/browser/profiles/profile_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
|
| index 20d93b9a2c49d8247c1d0c1e70ce7f27e9f92ba4..072609d7604f267edcf294bb2cb430b4cec6c0ff 100644
|
| --- a/chrome/browser/profiles/profile_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_io_data.cc
|
| @@ -5,7 +5,6 @@
|
| #include "chrome/browser/profiles/profile_io_data.h"
|
|
|
| #include <stddef.h>
|
| -#include <string>
|
| #include <utility>
|
|
|
| #include "base/bind.h"
|
| @@ -58,6 +57,7 @@
|
| #include "components/content_settings/core/browser/cookie_settings.h"
|
| #include "components/content_settings/core/browser/host_content_settings_map.h"
|
| #include "components/cookie_config/cookie_store_util.h"
|
| +#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
|
| #include "components/dom_distiller/core/url_constants.h"
|
| #include "components/metrics/metrics_pref_names.h"
|
| @@ -74,12 +74,12 @@
|
| #include "net/cert/cert_verifier.h"
|
| #include "net/cert/multi_log_ct_verifier.h"
|
| #include "net/cookies/canonical_cookie.h"
|
| -#include "net/http/http_network_session.h"
|
| #include "net/http/http_transaction_factory.h"
|
| #include "net/http/http_util.h"
|
| #include "net/http/transport_security_persister.h"
|
| #include "net/proxy/proxy_config_service_fixed.h"
|
| #include "net/proxy/proxy_script_fetcher_impl.h"
|
| +#include "net/proxy/proxy_server.h"
|
| #include "net/proxy/proxy_service.h"
|
| #include "net/ssl/channel_id_service.h"
|
| #include "net/ssl/client_cert_store.h"
|
| @@ -1299,6 +1299,8 @@ scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession(
|
| params.socket_performance_watcher_factory =
|
| io_thread->globals()->network_quality_estimator.get();
|
| }
|
| + SetTrustedSpdyProxyProvider(profile_params, ¶ms);
|
| +
|
| if (data_reduction_proxy_io_data_.get())
|
| params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate();
|
|
|
| @@ -1329,3 +1331,36 @@ void ProfileIOData::SetCookieSettingsForTesting(
|
| DCHECK(!cookie_settings_.get());
|
| cookie_settings_ = cookie_settings;
|
| }
|
| +
|
| +void ProfileIOData::SetTrustedSpdyProxyProvider(
|
| + const ProfileParams& profile_params,
|
| + net::HttpNetworkSession::Params* params) const {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
| +
|
| + if (IsOffTheRecord())
|
| + return;
|
| +
|
| + IOThread* const io_thread = profile_params.io_thread;
|
| +
|
| + net::ProxyServer trusted_spdy_proxy;
|
| + DCHECK(!trusted_spdy_proxy.is_valid());
|
| +
|
| + if (io_thread->globals()->trusted_spdy_proxy_provider) {
|
| + io_thread->globals()->trusted_spdy_proxy_provider->GetTrustedSpdyProxy(
|
| + &trusted_spdy_proxy);
|
| + }
|
| + // Default implementation of TrustedSpdyProxyProvider.
|
| + if (trusted_spdy_proxy.is_valid()) {
|
| + params->trusted_spdy_proxy_provider =
|
| + io_thread->globals()->trusted_spdy_proxy_provider->GetWeakPtr();
|
| + return;
|
| + }
|
| +
|
| + // The default implementation did not provide a valid trusted SPDY proxy.
|
| + // Query Data Reduction Proxy.
|
| + if (data_reduction_proxy_io_data()) {
|
| + params->trusted_spdy_proxy_provider =
|
| + data_reduction_proxy_io_data()->config()->GetWeakPtr();
|
| + return;
|
| + }
|
| +}
|
|
|