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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 1342613002: Revert of Remove reference counting from HttpNetworkSession. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index a7b5db0cd10950d616aad63fab0bf6cd3f15f445..7fe1896e24d38751cf1066bd0a513bb83d6ad64b 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -415,27 +415,26 @@
SpdySessionDependencies::~SpdySessionDependencies() {}
// static
-scoped_ptr<HttpNetworkSession> SpdySessionDependencies::SpdyCreateSession(
+HttpNetworkSession* SpdySessionDependencies::SpdyCreateSession(
SpdySessionDependencies* session_deps) {
HttpNetworkSession::Params params = CreateSessionParams(session_deps);
params.client_socket_factory = session_deps->socket_factory.get();
- scoped_ptr<HttpNetworkSession> http_session(new HttpNetworkSession(params));
+ HttpNetworkSession* http_session = new HttpNetworkSession(params);
SpdySessionPoolPeer pool_peer(http_session->spdy_session_pool());
pool_peer.SetEnableSendingInitialData(false);
- return http_session.Pass();
+ return http_session;
}
// static
-scoped_ptr<HttpNetworkSession>
-SpdySessionDependencies::SpdyCreateSessionDeterministic(
+HttpNetworkSession* SpdySessionDependencies::SpdyCreateSessionDeterministic(
SpdySessionDependencies* session_deps) {
HttpNetworkSession::Params params = CreateSessionParams(session_deps);
params.client_socket_factory =
session_deps->deterministic_socket_factory.get();
- scoped_ptr<HttpNetworkSession> http_session(new HttpNetworkSession(params));
+ HttpNetworkSession* http_session = new HttpNetworkSession(params);
SpdySessionPoolPeer pool_peer(http_session->spdy_session_pool());
pool_peer.SetEnableSendingInitialData(false);
- return http_session.Pass();
+ return http_session;
}
// static
@@ -499,14 +498,12 @@
params.enable_spdy_ping_based_connection_checking = false;
params.spdy_default_protocol = protocol;
params.http_server_properties = http_server_properties();
- storage_.set_http_network_session(
- make_scoped_ptr(new HttpNetworkSession(params)));
- SpdySessionPoolPeer pool_peer(
- storage_.http_network_session()->spdy_session_pool());
+ scoped_refptr<HttpNetworkSession> network_session(
+ new HttpNetworkSession(params));
+ SpdySessionPoolPeer pool_peer(network_session->spdy_session_pool());
pool_peer.SetEnableSendingInitialData(false);
- storage_.set_http_transaction_factory(
- new HttpCache(storage_.http_network_session(),
- HttpCache::DefaultBackend::InMemory(0), false));
+ storage_.set_http_transaction_factory(new HttpCache(
+ network_session.get(), HttpCache::DefaultBackend::InMemory(0)));
}
SpdyURLRequestContext::~SpdyURLRequestContext() {
@@ -520,7 +517,7 @@
namespace {
base::WeakPtr<SpdySession> CreateSpdySessionHelper(
- HttpNetworkSession* http_session,
+ const scoped_refptr<HttpNetworkSession>& http_session,
const SpdySessionKey& key,
const BoundNetLog& net_log,
Error expected_status,
@@ -581,7 +578,7 @@
} // namespace
base::WeakPtr<SpdySession> CreateInsecureSpdySession(
- HttpNetworkSession* http_session,
+ const scoped_refptr<HttpNetworkSession>& http_session,
const SpdySessionKey& key,
const BoundNetLog& net_log) {
return CreateSpdySessionHelper(http_session, key, net_log,
@@ -589,7 +586,7 @@
}
base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure(
- HttpNetworkSession* http_session,
+ const scoped_refptr<HttpNetworkSession>& http_session,
const SpdySessionKey& key,
Error expected_error,
const BoundNetLog& net_log) {
@@ -599,7 +596,7 @@
}
base::WeakPtr<SpdySession> CreateSecureSpdySession(
- HttpNetworkSession* http_session,
+ const scoped_refptr<HttpNetworkSession>& http_session,
const SpdySessionKey& key,
const BoundNetLog& net_log) {
return CreateSpdySessionHelper(http_session, key, net_log,
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698