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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 1298253002: Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed two comments, fix some tests Created 5 years, 3 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: 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 8760ce944437e91a0749ffdf689e5c52e5994fd3..71ed48a231f94e0dd76c8aa21d62f7f04f0aa0de 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -65,6 +65,7 @@
#include "net/base/keygen_handler.h"
#include "net/cert/cert_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"
@@ -1288,13 +1289,13 @@ void ProfileIOData::DestroyResourceContext() {
resource_context_.reset();
}
-scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
- const ProfileParams* profile_params,
- net::HttpCache::BackendFactory* main_backend) const {
+// Creates the HTTP network session
pauljensen 2015/09/11 13:05:25 Google C++ style guide says "you should not just r
mmenke 2015/09/11 14:46:49 Done. Accidentally copied from the header. Remov
+scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession(
+ const ProfileParams& profile_params) const {
net::HttpNetworkSession::Params params;
net::URLRequestContext* context = main_request_context();
- IOThread* const io_thread = profile_params->io_thread;
+ IOThread* const io_thread = profile_params.io_thread;
io_thread->InitializeNetworkSessionParams(&params);
net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context,
@@ -1304,11 +1305,19 @@ scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
if (data_reduction_proxy_io_data_.get())
params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate();
- net::HttpNetworkSession* session = new net::HttpNetworkSession(params);
+ return scoped_ptr<net::HttpNetworkSession>(
+ new net::HttpNetworkSession(params));
+}
+
+scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
+ net::HttpNetworkSession* session,
+ net::HttpCache::BackendFactory* main_backend) const {
+ net::URLRequestContext* context = main_request_context();
return scoped_ptr<net::HttpCache>(new net::HttpCache(
new DevToolsNetworkTransactionFactory(
network_controller_handle_.GetController(), session),
- context->net_log(), main_backend));
+ context->net_log(), main_backend,
+ true /* set_up_quic_server_info */));
}
scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory(
@@ -1317,7 +1326,8 @@ scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory(
return scoped_ptr<net::HttpCache>(new net::HttpCache(
new DevToolsNetworkTransactionFactory(
network_controller_handle_.GetController(), shared_session),
- shared_session->net_log(), backend));
+ shared_session->net_log(), backend,
+ true /* set_up_quic_server_info */));
}
void ProfileIOData::SetCookieSettingsForTesting(

Powered by Google App Engine
This is Rietveld 408576698