Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: chromecast/browser/url_request_context_factory.cc

Issue 2656283002: [Chromecast] Enable QUIC for Chromecast. (Closed)
Patch Set: fix round 1 of comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/browser/url_request_context_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chromecast/browser/url_request_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698