| Index: chromecast/browser/url_request_context_factory.cc
|
| diff --git a/chromecast/browser/url_request_context_factory.cc b/chromecast/browser/url_request_context_factory.cc
|
| index ef726e6dd507f6c9f0611c7b02387bd197f94422..f9119ad611cbc88d7ef9c5a46993f54370d1952e 100644
|
| --- a/chromecast/browser/url_request_context_factory.cc
|
| +++ b/chromecast/browser/url_request_context_factory.cc
|
| @@ -165,8 +165,8 @@ URLRequestContextFactory::URLRequestContextFactory()
|
| system_network_delegate_(CastNetworkDelegate::Create()),
|
| system_dependencies_initialized_(false),
|
| main_dependencies_initialized_(false),
|
| - media_dependencies_initialized_(false) {
|
| -}
|
| + media_dependencies_initialized_(false),
|
| + enable_quic_(true) {}
|
|
|
| URLRequestContextFactory::~URLRequestContextFactory() {
|
| }
|
| @@ -307,6 +307,7 @@ void URLRequestContextFactory::InitializeMediaContextDependencies(
|
| void URLRequestContextFactory::PopulateNetworkSessionParams(
|
| bool ignore_certificate_errors,
|
| net::HttpNetworkSession::Params* params) {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
| params->host_resolver = host_resolver_.get();
|
| params->cert_verifier = cert_verifier_.get();
|
| params->channel_id_service = channel_id_service_.get();
|
| @@ -318,6 +319,9 @@ void URLRequestContextFactory::PopulateNetworkSessionParams(
|
| params->http_server_properties = http_server_properties_.get();
|
| params->ignore_certificate_errors = ignore_certificate_errors;
|
| params->proxy_service = proxy_service_.get();
|
| +
|
| + LOG(INFO) << "Set HttpNetworkSessionParams.enable_quic = " << enable_quic_;
|
| + params->enable_quic = enable_quic_;
|
| }
|
|
|
| net::URLRequestContext* URLRequestContextFactory::CreateSystemRequestContext() {
|
| @@ -427,5 +431,43 @@ void URLRequestContextFactory::InitializeNetworkDelegates() {
|
| LOG(INFO) << "Initialized system network delegate.";
|
| }
|
|
|
| +void URLRequestContextFactory::DisableQuic() {
|
| + content::BrowserThread::PostTask(
|
| + content::BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&URLRequestContextFactory::DisableQuicOnBrowserIOThread,
|
| + base::Unretained(this)));
|
| +}
|
| +
|
| +void URLRequestContextFactory::DisableQuicOnBrowserIOThread() {
|
| + DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
| + if (!enable_quic_)
|
| + return;
|
| +
|
| + LOG(INFO) << "Disabled QUIC.";
|
| +
|
| + enable_quic_ = false;
|
| +
|
| + if (main_getter_) {
|
| + main_getter_->GetURLRequestContext()
|
| + ->http_transaction_factory()
|
| + ->GetSession()
|
| + ->DisableQuic();
|
| + }
|
| +
|
| + if (system_getter_) {
|
| + system_getter_->GetURLRequestContext()
|
| + ->http_transaction_factory()
|
| + ->GetSession()
|
| + ->DisableQuic();
|
| + }
|
| +
|
| + if (media_getter_) {
|
| + media_getter_->GetURLRequestContext()
|
| + ->http_transaction_factory()
|
| + ->GetSession()
|
| + ->DisableQuic();
|
| + }
|
| +}
|
| +
|
| } // namespace shell
|
| } // namespace chromecast
|
|
|