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

Unified Diff: android_webview/browser/net/aw_url_request_context_getter.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 5 years, 2 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
Index: android_webview/browser/net/aw_url_request_context_getter.cc
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc
index 9c13b6582c004c1b43953402ec874c747145c34f..607e1d0e65f63b239a853e479aaf9ec2ccd2f5cc 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -182,11 +182,10 @@ AwURLRequestContextGetter::AwURLRequestContextGetter(
const base::FilePath& cache_path, net::CookieStore* cookie_store,
scoped_ptr<net::ProxyConfigService> config_service)
: cache_path_(cache_path),
+ net_log_(new net::NetLog()),
+ proxy_config_service_(config_service.Pass()),
cookie_store_(cookie_store),
- net_log_(new net::NetLog()) {
- proxy_config_service_ = config_service.Pass();
- http_user_agent_settings_.reset(
- new AwHttpUserAgentSettings());
+ http_user_agent_settings_(new AwHttpUserAgentSettings()) {
// CreateSystemProxyConfigService for Android must be called on main thread.
DCHECK_CURRENTLY_ON(BrowserThread::UI);
}
@@ -230,17 +229,19 @@ void AwURLRequestContextGetter::InitializeURLRequestContext() {
PopulateNetworkSessionParams(url_request_context_.get(),
&network_session_params);
- net::HttpCache* main_cache = new net::HttpCache(
- network_session_params,
+ http_network_session_.reset(
+ new net::HttpNetworkSession(network_session_params));
+ main_http_factory_.reset(new net::HttpCache(
+ http_network_session_.get(),
new net::HttpCache::DefaultBackend(
net::DISK_CACHE,
net::CACHE_BACKEND_SIMPLE,
cache_path_,
20 * 1024 * 1024, // 20M
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)),
+ true /* set_up_quic_server_info */));
- main_http_factory_.reset(main_cache);
- url_request_context_->set_http_transaction_factory(main_cache);
+ url_request_context_->set_http_transaction_factory(main_http_factory_.get());
job_factory_ = CreateJobFactory(&protocol_handlers_,
request_interceptors_.Pass());

Powered by Google App Engine
This is Rietveld 408576698