diff options
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_cache.cc | 38 | ||||
-rw-r--r-- | net/http/http_cache.h | 17 | ||||
-rw-r--r-- | net/http/http_network_layer.cc | 16 | ||||
-rw-r--r-- | net/http/http_network_layer.h | 5 | ||||
-rw-r--r-- | net/http/http_network_layer_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/http_network_session.h | 7 | ||||
-rw-r--r-- | net/http/http_network_session_peer.cc | 3 | ||||
-rw-r--r-- | net/http/http_network_session_peer.h | 6 | ||||
-rw-r--r-- | net/http/http_network_transaction_ssl_unittest.cc | 14 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 402 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/http_response_body_drainer_unittest.cc | 2 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_request_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/http_stream_factory_impl_unittest.cc | 58 | ||||
-rw-r--r-- | net/http/mock_http_cache.cc | 7 |
15 files changed, 281 insertions, 306 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index b3a6b2c..7494b86 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -294,39 +294,20 @@ class HttpCache::QuicServerInfoFactoryAdaptor : public QuicServerInfoFactory { }; //----------------------------------------------------------------------------- -HttpCache::HttpCache(const HttpNetworkSession::Params& params, - BackendFactory* backend_factory) - : net_log_(params.net_log), - backend_factory_(backend_factory), - building_backend_(false), - bypass_lock_for_test_(false), - fail_conditionalization_for_test_(false), - mode_(NORMAL), - network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))), - clock_(new base::DefaultClock()), - weak_factory_(this) { - SetupQuicServerInfoFactory(network_layer_->GetSession()); -} - - // This call doesn't change the shared |session|'s QuicServerInfoFactory because // |session| is shared. HttpCache::HttpCache(HttpNetworkSession* session, - BackendFactory* backend_factory) - : net_log_(session->net_log()), - backend_factory_(backend_factory), - building_backend_(false), - bypass_lock_for_test_(false), - fail_conditionalization_for_test_(false), - mode_(NORMAL), - network_layer_(new HttpNetworkLayer(session)), - clock_(new base::DefaultClock()), - weak_factory_(this) { -} + BackendFactory* backend_factory, + bool set_up_quic_server_info) + : HttpCache(new HttpNetworkLayer(session), + session->net_log(), + backend_factory, + set_up_quic_server_info) {} HttpCache::HttpCache(HttpTransactionFactory* network_layer, NetLog* net_log, - BackendFactory* backend_factory) + BackendFactory* backend_factory, + bool set_up_quic_server_info) : net_log_(net_log), backend_factory_(backend_factory), building_backend_(false), @@ -336,7 +317,8 @@ HttpCache::HttpCache(HttpTransactionFactory* network_layer, network_layer_(network_layer), clock_(new base::DefaultClock()), weak_factory_(this) { - SetupQuicServerInfoFactory(network_layer_->GetSession()); + if (set_up_quic_server_info) + SetupQuicServerInfoFactory(network_layer_->GetSession()); } HttpCache::~HttpCache() { diff --git a/net/http/http_cache.h b/net/http/http_cache.h index 6c58e3a..d504941 100644 --- a/net/http/http_cache.h +++ b/net/http/http_cache.h @@ -126,23 +126,26 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory, static const int kPrefetchReuseMins = 5; // The disk cache is initialized lazily (by CreateTransaction) in this case. - // The HttpCache takes ownership of the |backend_factory|. - HttpCache(const HttpNetworkSession::Params& params, - BackendFactory* backend_factory); - - // The disk cache is initialized lazily (by CreateTransaction) in this case. // Provide an existing HttpNetworkSession, the cache can construct a // network layer with a shared HttpNetworkSession in order for multiple // network layers to share information (e.g. authentication data). The // HttpCache takes ownership of the |backend_factory|. - HttpCache(HttpNetworkSession* session, BackendFactory* backend_factory); + // + // The HttpCache must be destroyed before the HttpNetworkSession. + // + // If |set_up_quic_server_info| is true, configures the cache to track + // information about servers supporting QUIC. + HttpCache(HttpNetworkSession* session, + BackendFactory* backend_factory, + bool set_up_quic_server_info); // Initialize the cache from its component parts. The lifetime of the // |network_layer| and |backend_factory| are managed by the HttpCache and // will be destroyed using |delete| when the HttpCache is destroyed. HttpCache(HttpTransactionFactory* network_layer, NetLog* net_log, - BackendFactory* backend_factory); + BackendFactory* backend_factory, + bool set_up_quic_server_info); ~HttpCache() override; diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index 8e6b35c..169a1cc 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -22,11 +22,11 @@ namespace net { HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session) : session_(session), suspended_(false) { - DCHECK(session_.get()); + DCHECK(session_); #if defined(OS_WIN) - base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); - if (power_monitor) - power_monitor->AddObserver(this); + base::PowerMonitor* power_monitor = base::PowerMonitor::Get(); + if (power_monitor) + power_monitor->AddObserver(this); #endif } @@ -51,13 +51,13 @@ HttpCache* HttpNetworkLayer::GetCache() { return NULL; } -HttpNetworkSession* HttpNetworkLayer::GetSession() { return session_.get(); } +HttpNetworkSession* HttpNetworkLayer::GetSession() { + return session_; +} void HttpNetworkLayer::OnSuspend() { suspended_ = true; - - if (session_.get()) - session_->CloseIdleConnections(); + session_->CloseIdleConnections(); } void HttpNetworkLayer::OnResume() { diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h index 5ade926..89ff8eb 100644 --- a/net/http/http_network_layer.h +++ b/net/http/http_network_layer.h @@ -26,7 +26,8 @@ class NET_EXPORT HttpNetworkLayer NON_EXPORTED_BASE(public base::NonThreadSafe) { public: // Construct a HttpNetworkLayer with an existing HttpNetworkSession which - // contains a valid ProxyService. + // contains a valid ProxyService. The HttpNetworkLayer must be destroyed + // before |session|. explicit HttpNetworkLayer(HttpNetworkSession* session); ~HttpNetworkLayer() override; @@ -41,7 +42,7 @@ class NET_EXPORT HttpNetworkLayer void OnResume() override; private: - const scoped_refptr<HttpNetworkSession> session_; + HttpNetworkSession* const session_; bool suspended_; DISALLOW_COPY_AND_ASSIGN(HttpNetworkLayer); diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc index 153423e..7840902 100644 --- a/net/http/http_network_layer_unittest.cc +++ b/net/http/http_network_layer_unittest.cc @@ -45,7 +45,7 @@ class HttpNetworkLayerTest : public PlatformTest { session_params.ssl_config_service = ssl_config_service_.get(); session_params.http_server_properties = http_server_properties_.GetWeakPtr(); - network_session_ = new HttpNetworkSession(session_params); + network_session_.reset(new HttpNetworkSession(session_params)); factory_.reset(new HttpNetworkLayer(network_session_.get())); } @@ -259,7 +259,7 @@ class HttpNetworkLayerTest : public PlatformTest { scoped_ptr<TransportSecurityState> transport_security_state_; scoped_ptr<ProxyService> proxy_service_; const scoped_refptr<SSLConfigService> ssl_config_service_; - scoped_refptr<HttpNetworkSession> network_session_; + scoped_ptr<HttpNetworkSession> network_session_; scoped_ptr<HttpNetworkLayer> factory_; HttpServerPropertiesImpl http_server_properties_; }; diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index a587acf..27ed595 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -57,8 +57,7 @@ class TransportSecurityState; // This class holds session objects used by HttpNetworkTransaction objects. class NET_EXPORT HttpNetworkSession - : public base::RefCounted<HttpNetworkSession>, - NON_EXPORTED_BASE(public base::NonThreadSafe) { + : NON_EXPORTED_BASE(public base::NonThreadSafe) { public: struct NET_EXPORT Params { Params(); @@ -142,6 +141,7 @@ class NET_EXPORT HttpNetworkSession }; explicit HttpNetworkSession(const Params& params); + ~HttpNetworkSession(); HttpAuthCache* http_auth_cache() { return &http_auth_cache_; } SSLClientAuthCache* ssl_client_auth_cache() { @@ -214,11 +214,8 @@ class NET_EXPORT HttpNetworkSession bool HasSpdyExclusion(HostPortPair host_port_pair) const; private: - friend class base::RefCounted<HttpNetworkSession>; friend class HttpNetworkSessionPeer; - ~HttpNetworkSession(); - ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type); NetLog* const net_log_; diff --git a/net/http/http_network_session_peer.cc b/net/http/http_network_session_peer.cc index a32e48b..a5fb8a5 100644 --- a/net/http/http_network_session_peer.cc +++ b/net/http/http_network_session_peer.cc @@ -14,8 +14,7 @@ namespace net { -HttpNetworkSessionPeer::HttpNetworkSessionPeer( - const scoped_refptr<HttpNetworkSession>& session) +HttpNetworkSessionPeer::HttpNetworkSessionPeer(HttpNetworkSession* session) : session_(session) {} HttpNetworkSessionPeer::~HttpNetworkSessionPeer() {} diff --git a/net/http/http_network_session_peer.h b/net/http/http_network_session_peer.h index 755e539..ae57f39 100644 --- a/net/http/http_network_session_peer.h +++ b/net/http/http_network_session_peer.h @@ -18,8 +18,8 @@ class ProxyService; class NET_EXPORT_PRIVATE HttpNetworkSessionPeer { public: - explicit HttpNetworkSessionPeer( - const scoped_refptr<HttpNetworkSession>& session); + // |session| should outlive the HttpNetworkSessionPeer. + explicit HttpNetworkSessionPeer(HttpNetworkSession* session); ~HttpNetworkSessionPeer(); void SetClientSocketPoolManager( @@ -32,7 +32,7 @@ class NET_EXPORT_PRIVATE HttpNetworkSessionPeer { scoped_ptr<HttpStreamFactory> http_stream_factory_for_websocket); private: - const scoped_refptr<HttpNetworkSession> session_; + HttpNetworkSession* const session_; DISALLOW_COPY_AND_ASSIGN(HttpNetworkSessionPeer); }; diff --git a/net/http/http_network_transaction_ssl_unittest.cc b/net/http/http_network_transaction_ssl_unittest.cc index da28d9c..82b905d 100644 --- a/net/http/http_network_transaction_ssl_unittest.cc +++ b/net/http/http_network_transaction_ssl_unittest.cc @@ -127,16 +127,14 @@ TEST_F(HttpNetworkTransactionSSLTest, SSLFallback) { StaticSocketDataProvider data3(NULL, 0, NULL, 0); mock_socket_factory_.AddSocketDataProvider(&data3); - scoped_refptr<HttpNetworkSession> session( - new HttpNetworkSession(session_params_)); - scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); + HttpNetworkSession session(session_params_); + HttpNetworkTransaction trans(DEFAULT_PRIORITY, &session); TestCompletionCallback callback; // This will consume |ssl_data1|, |ssl_data2| and |ssl_data3|. - int rv = callback.GetResult( - trans->Start(GetRequestInfo("https://www.paypal.com/"), - callback.callback(), BoundNetLog())); + int rv = + callback.GetResult(trans.Start(GetRequestInfo("https://www.paypal.com/"), + callback.callback(), BoundNetLog())); EXPECT_EQ(ERR_SSL_PROTOCOL_ERROR, rv); SocketDataProviderArray<SocketDataProvider>& mock_data = @@ -144,7 +142,7 @@ TEST_F(HttpNetworkTransactionSSLTest, SSLFallback) { // Confirms that |ssl_data1|, |ssl_data2| and |ssl_data3| are consumed. EXPECT_EQ(3u, mock_data.next_index()); - SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); + SSLConfig& ssl_config = GetServerSSLConfig(&trans); // |version_max| fallbacks to TLS 1.0. EXPECT_EQ(SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_max); EXPECT_TRUE(ssl_config.version_fallback); diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 670db0b..2de6429 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -232,7 +232,8 @@ void AddWebSocketHeaders(HttpRequestHeaders* headers) { headers->SetHeader("Sec-WebSocket-Key", "dGhlIHNhbXBsZSBub25jZQ=="); } -HttpNetworkSession* CreateSession(SpdySessionDependencies* session_deps) { +scoped_ptr<HttpNetworkSession> CreateSession( + SpdySessionDependencies* session_deps) { return SpdySessionDependencies::SpdyCreateSession(session_deps); } @@ -328,7 +329,7 @@ class HttpNetworkTransactionTest BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -679,7 +680,7 @@ bool CheckNTLMServerAuth(const AuthChallengeInfo* auth_challenge) { } // namespace TEST_P(HttpNetworkTransactionTest, Basic) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); } @@ -1000,7 +1001,7 @@ TEST_P(HttpNetworkTransactionTest, TwoIdenticalLocationHeaders) { request.url = GURL("http://redirect.com/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1045,7 +1046,7 @@ TEST_P(HttpNetworkTransactionTest, Head) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); BeforeProxyHeadersSentHandler proxy_headers_handler; @@ -1105,7 +1106,7 @@ TEST_P(HttpNetworkTransactionTest, Head) { } TEST_P(HttpNetworkTransactionTest, ReuseConnection) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockRead data_reads[] = { MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"), @@ -1163,7 +1164,7 @@ TEST_P(HttpNetworkTransactionTest, Ignores100) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1205,7 +1206,7 @@ TEST_P(HttpNetworkTransactionTest, Ignores1xx) { request.url = GURL("http://www.foo.com/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1244,7 +1245,7 @@ TEST_P(HttpNetworkTransactionTest, Incomplete100ThenEOF) { request.url = GURL("http://www.foo.com/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1275,7 +1276,7 @@ TEST_P(HttpNetworkTransactionTest, EmptyResponse) { request.url = GURL("http://www.foo.com/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1304,7 +1305,7 @@ void HttpNetworkTransactionTest::KeepAliveConnectionResendRequestTest( TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Written data for successfully sending both requests. MockWrite data1_writes[] = { @@ -1394,7 +1395,7 @@ void HttpNetworkTransactionTest::PreconnectErrorResendRequestTest( TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); SSLSocketDataProvider ssl1(ASYNC, OK); SSLSocketDataProvider ssl2(ASYNC, OK); @@ -1590,7 +1591,7 @@ TEST_P(HttpNetworkTransactionTest, NonKeepAliveConnectionReset) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1644,7 +1645,7 @@ TEST_P(HttpNetworkTransactionTest, ThrottleBeforeNetworkStart) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1693,7 +1694,7 @@ TEST_P(HttpNetworkTransactionTest, ThrottleAndCancelBeforeNetworkStart) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1724,7 +1725,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveEarlyClose) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1765,7 +1766,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveEarlyClose2) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -1807,7 +1808,7 @@ TEST_P(HttpNetworkTransactionTest, KeepAliveAfterUnreadBody) { TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Note that because all these reads happen in the same // StaticSocketDataProvider, it shows that the same socket is being reused for @@ -1916,7 +1917,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuth) { TestNetLog log; session_deps_.net_log = &log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -2027,7 +2028,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthWithAddressChange) { MockHostResolver* resolver = new MockHostResolver(); session_deps_.net_log = &log; session_deps_.host_resolver.reset(resolver); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -2137,7 +2138,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotSendAuth) { request.url = GURL("http://www.example.org/"); request.load_flags = LOAD_DO_NOT_SEND_AUTH_DATA; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -2188,7 +2189,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAlive) { TestNetLog log; session_deps_.net_log = &log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { MockWrite( @@ -2291,7 +2292,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { MockWrite( @@ -2369,7 +2370,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { MockWrite( @@ -2455,7 +2456,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthKeepAliveImpatientServer) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { MockWrite( @@ -2550,7 +2551,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp10) { ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -2674,7 +2675,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyNoKeepAliveHttp11) { ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -2798,7 +2799,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp10) { session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -2905,7 +2906,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHttp11) { session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -3009,7 +3010,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyKeepAliveHangupDuringBody) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -3099,7 +3100,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyCancelTunnel) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -3159,7 +3160,7 @@ TEST_P(HttpNetworkTransactionTest, SanitizeProxyAuthHeaders) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -3220,7 +3221,7 @@ TEST_P(HttpNetworkTransactionTest, UnexpectedProxyAuth) { request.load_flags = 0; // We are using a DIRECT connection (i.e. no proxy) for this session. - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -3268,7 +3269,7 @@ TEST_P(HttpNetworkTransactionTest, session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -3343,7 +3344,7 @@ TEST_P(HttpNetworkTransactionTest, // Add NetLog just so can verify load timing information gets a NetLog ID. NetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -3460,7 +3461,7 @@ TEST_P(HttpNetworkTransactionTest, // Add NetLog just so can verify load timing information gets a NetLog ID. NetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); // Should try to establish tunnel. MockWrite data_writes1[] = { @@ -3582,7 +3583,7 @@ TEST_P(HttpNetworkTransactionTest, // Add NetLog just so can verify load timing information gets a NetLog ID. NetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); // Should try to establish tunnel. MockWrite data_writes1[] = { @@ -3686,7 +3687,7 @@ TEST_P(HttpNetworkTransactionTest, // Add NetLog just so can verify load timing information gets a NetLog ID. NetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); // Should try to establish tunnel. MockWrite data_writes1[] = { @@ -3773,7 +3774,7 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingNoPacTwoRequests) { session_deps_.proxy_service = ProxyService::CreateFixed("PROXY myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -3874,7 +3875,7 @@ TEST_P(HttpNetworkTransactionTest, HttpProxyLoadTimingWithPacTwoRequests) { ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -3971,7 +3972,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyGet) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should use full url MockWrite data_writes1[] = { @@ -4033,7 +4034,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGet) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // fetch http://www.example.org/ via SPDY scoped_ptr<SpdyFrame> req( @@ -4093,7 +4094,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Fetch http://www.example.org/ through the SPDY proxy. scoped_ptr<SpdyFrame> req( @@ -4131,7 +4132,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithSessionRace) { SpdySessionKey key( HostPortPair("proxy", 70), ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = - CreateSecureSpdySession(session, key, log.bound()); + CreateSecureSpdySession(session.get(), key, log.bound()); // Unstall the resolution begun by the transaction. session_deps_.host_resolver->set_ondemand_mode(true); @@ -4162,7 +4163,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyGetWithProxyAuth) { session_deps_.proxy_service = ProxyService::CreateFixed("https://myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // The first request will be a bare GET, the second request will be a // GET with a Proxy-Authorization header. @@ -4262,7 +4263,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectHttps) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -4346,7 +4347,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectSpdy) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -4437,7 +4438,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyConnectFailure) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -4488,7 +4489,7 @@ TEST_P(HttpNetworkTransactionTest, session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps_)); HttpRequestInfo request1; @@ -4630,7 +4631,7 @@ TEST_P(HttpNetworkTransactionTest, session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps_)); HttpRequestInfo request1; @@ -4753,7 +4754,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxySpdyLoadTimingTwoHttpRequests) { session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps_)); HttpRequestInfo request1; @@ -4859,7 +4860,7 @@ TEST_P(HttpNetworkTransactionTest, HttpsProxyAuthRetry) { session_deps_.proxy_service = ProxyService::CreateFixed("https://myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should use full url MockWrite data_writes1[] = { @@ -4956,7 +4957,7 @@ void HttpNetworkTransactionTest::ConnectStatusHelperWithExpectedStatus( // Configure against proxy server "myproxy:70". session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. MockWrite data_writes[] = { @@ -5174,7 +5175,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthProxyThenServer) { // Configure against proxy server "myproxy:70". session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -5310,7 +5311,7 @@ TEST_P(HttpNetworkTransactionTest, NTLMAuth1) { HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(MockGenerateRandom1, MockGetHostName); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { MockWrite("GET /kids/login.aspx HTTP/1.1\r\n" @@ -5439,7 +5440,7 @@ TEST_P(HttpNetworkTransactionTest, NTLMAuth2) { HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(MockGenerateRandom2, MockGetHostName); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes1[] = { MockWrite("GET /kids/login.aspx HTTP/1.1\r\n" @@ -5639,7 +5640,7 @@ TEST_P(HttpNetworkTransactionTest, LargeHeadersNoBody) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -5678,7 +5679,7 @@ TEST_P(HttpNetworkTransactionTest, // Configure against proxy server "myproxy:70". session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -5732,7 +5733,7 @@ TEST_P(HttpNetworkTransactionTest, RecycleSocket) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -5811,7 +5812,7 @@ TEST_P(HttpNetworkTransactionTest, RecycleSSLSocket) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -5881,7 +5882,7 @@ TEST_P(HttpNetworkTransactionTest, RecycleDeadSSLSocket) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -5949,7 +5950,7 @@ TEST_P(HttpNetworkTransactionTest, RecycleSocketAfterZeroContentLength) { "rt=prt.2642,ol.2649,xjs.2951"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -6015,7 +6016,7 @@ TEST_P(HttpNetworkTransactionTest, ResendRequestOnWriteBodyError) { request[1].upload_data_stream = &upload_data_stream; request[1].load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // The first socket is used for transaction 1 and the first attempt of // transaction 2. @@ -6093,7 +6094,7 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURL) { request.url = GURL("http://foo:b@r@www.example.org/"); request.load_flags = LOAD_NORMAL; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -6176,7 +6177,7 @@ TEST_P(HttpNetworkTransactionTest, WrongAuthIdentityInURL) { request.load_flags = LOAD_NORMAL; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -6287,7 +6288,7 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURLSuppressed) { request.url = GURL("http://foo:bar@www.example.org/"); request.load_flags = LOAD_DO_NOT_USE_EMBEDDED_IDENTITY; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -6361,7 +6362,7 @@ TEST_P(HttpNetworkTransactionTest, AuthIdentityInURLSuppressed) { // Test that previously tried username/passwords for a realm get re-used. TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Transaction 1: authenticate (foo, bar) on MyRealm1 { @@ -6761,7 +6762,7 @@ TEST_P(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { new HttpAuthHandlerDigest::FixedNonceGenerator("0123456789abcdef"); digest_factory->set_nonce_generator(nonce_generator); session_deps_.http_auth_handler_factory.reset(digest_factory); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Transaction 1: authenticate (foo, bar) on MyRealm1 { @@ -6893,7 +6894,7 @@ TEST_P(HttpNetworkTransactionTest, DigestPreAuthNonceCount) { // Test the ResetStateForRestart() private method. TEST_P(HttpNetworkTransactionTest, ResetStateForRestart) { // Create a transaction (the dependencies aren't important). - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpNetworkTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -6940,7 +6941,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificate) { request.url = GURL("https://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7048,7 +7049,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaProxy) { for (int i = 0; i < 2; i++) { session_deps_.socket_factory->ResetNextMockIndexes(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7114,7 +7115,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSViaHttpsProxy) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7173,7 +7174,7 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaHttpsProxy) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7254,7 +7255,7 @@ TEST_P(HttpNetworkTransactionTest, RedirectOfHttpsConnectViaSpdyProxy) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7306,7 +7307,7 @@ TEST_P(HttpNetworkTransactionTest, TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7363,7 +7364,7 @@ TEST_P(HttpNetworkTransactionTest, TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7390,7 +7391,7 @@ TEST_P(HttpNetworkTransactionTest, BasicAuthSpdyProxy) { ProxyService::CreateFixedFromPacResult("HTTPS myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since we have proxy, should try to establish tunnel. scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect( @@ -7535,7 +7536,7 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPush) { // Enable cross-origin push. session_deps_.trusted_spdy_proxy = "myproxy:70"; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<SpdyFrame> stream1_syn( spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); @@ -7648,7 +7649,7 @@ TEST_P(HttpNetworkTransactionTest, CrossOriginProxyPushCorrectness) { // Enable cross-origin push. session_deps_.trusted_spdy_proxy = "myproxy:70"; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<SpdyFrame> stream1_syn( spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false)); @@ -7776,7 +7777,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSBadCertificateViaHttpsProxy) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7805,7 +7806,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgent) { request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chromium Ultra Awesome X Edition"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7846,7 +7847,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_UserAgentOverTunnel) { "Chromium Ultra Awesome X Edition"); session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7886,7 +7887,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_Referer) { request.extra_headers.SetHeader(HttpRequestHeaders::kReferer, "http://the.previous.site.com/"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7924,7 +7925,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_PostContentLengthZero) { request.method = "POST"; request.url = GURL("http://www.example.org/"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -7962,7 +7963,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_PutContentLengthZero) { request.method = "PUT"; request.url = GURL("http://www.example.org/"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8000,7 +8001,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_HeadContentLengthZero) { request.method = "HEAD"; request.url = GURL("http://www.example.org/"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8037,7 +8038,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_CacheControlNoCache) { request.url = GURL("http://www.example.org/"); request.load_flags = LOAD_BYPASS_CACHE; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8078,7 +8079,7 @@ TEST_P(HttpNetworkTransactionTest, request.url = GURL("http://www.example.org/"); request.load_flags = LOAD_VALIDATE_CACHE; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8117,7 +8118,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeaders) { request.url = GURL("http://www.example.org/"); request.extra_headers.SetHeader("FooHeader", "Bar"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8158,7 +8159,7 @@ TEST_P(HttpNetworkTransactionTest, BuildRequest_ExtraHeadersStripped) { request.extra_headers.SetHeader("hEllo", "Kitty"); request.extra_headers.SetHeader("FoO", "bar"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8204,7 +8205,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET) { TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8263,7 +8264,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_SSL_GET) { TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8327,7 +8328,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS4_HTTP_GET_no_PAC) { TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8386,7 +8387,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_HTTP_GET) { TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8458,7 +8459,7 @@ TEST_P(HttpNetworkTransactionTest, SOCKS5_SSL_GET) { TestNetLog net_log; session_deps_.net_log = &net_log; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8535,10 +8536,10 @@ struct GroupNameTest { bool ssl; }; -scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests( +scoped_ptr<HttpNetworkSession> SetupSessionForGroupNameTests( NextProto next_proto, SpdySessionDependencies* session_deps_) { - scoped_refptr<HttpNetworkSession> session(CreateSession(session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -8552,16 +8553,15 @@ scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests( return session; } -int GroupNameTransactionHelper( - const std::string& url, - const scoped_refptr<HttpNetworkSession>& session) { +int GroupNameTransactionHelper(const std::string& url, + HttpNetworkSession* session) { HttpRequestInfo request; request.method = "GET"; request.url = GURL(url); request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); TestCompletionCallback callback; @@ -8612,10 +8612,10 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForDirectConnections) { for (size_t i = 0; i < arraysize(tests); ++i) { session_deps_.proxy_service = ProxyService::CreateFixed(tests[i].proxy_server); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SetupSessionForGroupNameTests(GetParam(), &session_deps_)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); CaptureGroupNameTransportSocketPool* transport_conn_pool = new CaptureGroupNameTransportSocketPool(NULL, NULL); CaptureGroupNameSSLSocketPool* ssl_conn_pool = @@ -8627,7 +8627,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForDirectConnections) { peer.SetClientSocketPoolManager(mock_pool_manager.Pass()); EXPECT_EQ(ERR_IO_PENDING, - GroupNameTransactionHelper(tests[i].url, session)); + GroupNameTransactionHelper(tests[i].url, session.get())); if (tests[i].ssl) EXPECT_EQ(tests[i].expected_group_name, ssl_conn_pool->last_group_name_received()); @@ -8674,10 +8674,10 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForHTTPProxyConnections) { for (size_t i = 0; i < arraysize(tests); ++i) { session_deps_.proxy_service = ProxyService::CreateFixed(tests[i].proxy_server); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SetupSessionForGroupNameTests(GetParam(), &session_deps_)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); HostPortPair proxy_host("http_proxy", 80); CaptureGroupNameHttpProxySocketPool* http_proxy_pool = @@ -8692,7 +8692,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForHTTPProxyConnections) { peer.SetClientSocketPoolManager(mock_pool_manager.Pass()); EXPECT_EQ(ERR_IO_PENDING, - GroupNameTransactionHelper(tests[i].url, session)); + GroupNameTransactionHelper(tests[i].url, session.get())); if (tests[i].ssl) EXPECT_EQ(tests[i].expected_group_name, ssl_conn_pool->last_group_name_received()); @@ -8744,10 +8744,10 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForSOCKSConnections) { for (size_t i = 0; i < arraysize(tests); ++i) { session_deps_.proxy_service = ProxyService::CreateFixed(tests[i].proxy_server); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SetupSessionForGroupNameTests(GetParam(), &session_deps_)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); HostPortPair proxy_host("socks_proxy", 1080); CaptureGroupNameSOCKSSocketPool* socks_conn_pool = @@ -8765,7 +8765,7 @@ TEST_P(HttpNetworkTransactionTest, GroupNameForSOCKSConnections) { new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); EXPECT_EQ(ERR_IO_PENDING, - GroupNameTransactionHelper(tests[i].url, session)); + GroupNameTransactionHelper(tests[i].url, session.get())); if (tests[i].ssl) EXPECT_EQ(tests[i].expected_group_name, ssl_conn_pool->last_group_name_received()); @@ -8787,7 +8787,7 @@ TEST_P(HttpNetworkTransactionTest, ReconsiderProxyAfterFailedConnection) { // connecting to both proxies (myproxy:70 and foobar:80). session_deps_.host_resolver->rules()->AddSimulatedFailure("*"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8813,7 +8813,7 @@ void HttpNetworkTransactionTest::BypassHostCacheOnRefreshHelper( // Select a host resolver that does caching. session_deps_.host_resolver.reset(new MockCachingHostResolver); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -8882,7 +8882,7 @@ TEST_P(HttpNetworkTransactionTest, RequestWriteError) { StaticSocketDataProvider data(NULL, 0, write_failure, arraysize(write_failure)); session_deps_.socket_factory->AddSocketDataProvider(&data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); TestCompletionCallback callback; @@ -8914,7 +8914,7 @@ TEST_P(HttpNetworkTransactionTest, ConnectionClosedAfterStartOfHeaders) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); TestCompletionCallback callback; @@ -8992,7 +8992,7 @@ TEST_P(HttpNetworkTransactionTest, DrainResetOK) { StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2), data_writes2, arraysize(data_writes2)); session_deps_.socket_factory->AddSocketDataProvider(&data2); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); TestCompletionCallback callback1; @@ -9048,7 +9048,7 @@ TEST_P(HttpNetworkTransactionTest, HTTPSViaProxyWithExtraData) { session_deps_.socket_factory->ResetNextMockIndexes(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9065,7 +9065,7 @@ TEST_P(HttpNetworkTransactionTest, LargeContentLengthThenClose) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9114,7 +9114,7 @@ TEST_P(HttpNetworkTransactionTest, UploadFileSmallerThanLength) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9169,7 +9169,7 @@ TEST_P(HttpNetworkTransactionTest, UploadUnreadableFile) { request.load_flags = 0; // If we try to upload an unreadable file, the transaction should fail. - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9223,7 +9223,7 @@ TEST_P(HttpNetworkTransactionTest, CancelDuringInitRequestBody) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9330,7 +9330,7 @@ TEST_P(HttpNetworkTransactionTest, ChangeAuthRealms) { TestCompletionCallback callback1; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9425,7 +9425,7 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternativeServiceHeader) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9489,7 +9489,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotHonorAlternativeServiceHeader) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9546,7 +9546,7 @@ TEST_P(HttpNetworkTransactionTest, HonorMultipleAlternativeServiceHeader) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9613,7 +9613,7 @@ TEST_P(HttpNetworkTransactionTest, HonorAlternateProtocolHeader) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9670,7 +9670,7 @@ TEST_P(HttpNetworkTransactionTest, EmptyAlternateProtocolHeader) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); HostPortPair http_host_port_pair("www.example.org", 80); HttpServerProperties& http_server_properties = @@ -9737,7 +9737,7 @@ TEST_P(HttpNetworkTransactionTest, AltSvcOverwritesAlternateProtocol) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -9796,7 +9796,7 @@ TEST_P(HttpNetworkTransactionTest, DisableAlternativeServiceToDifferentHost) { nullptr, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -9840,7 +9840,7 @@ TEST_P(HttpNetworkTransactionTest, data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -9906,7 +9906,7 @@ TEST_P(HttpNetworkTransactionTest, data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -9958,7 +9958,7 @@ TEST_P(HttpNetworkTransactionTest, data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -10009,7 +10009,7 @@ TEST_P(HttpNetworkTransactionTest, data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -10061,7 +10061,7 @@ TEST_P(HttpNetworkTransactionTest, data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -10112,7 +10112,7 @@ TEST_P(HttpNetworkTransactionTest, data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&second_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -10158,7 +10158,7 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolUnsafeBlocked) { data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); @@ -10243,7 +10243,7 @@ TEST_P(HttpNetworkTransactionTest, UseAlternateProtocolForNpnSpdy) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -10345,7 +10345,7 @@ TEST_P(HttpNetworkTransactionTest, AlternateProtocolWithSpdyLateBinding) { // Socket 5 is the unsuccessful non-Alternate-Protocol for transaction 3. session_deps_.socket_factory->AddSocketDataProvider(&hanging_socket); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); TestCompletionCallback callback1; HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); @@ -10436,7 +10436,7 @@ TEST_P(HttpNetworkTransactionTest, StallAlternateProtocolForNpnSpdy) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -10600,7 +10600,7 @@ TEST_P(HttpNetworkTransactionTest, TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -10693,7 +10693,7 @@ TEST_P(HttpNetworkTransactionTest, TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -10716,7 +10716,7 @@ TEST_P(HttpNetworkTransactionTest, SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = - CreateSecureSpdySession(session, key, BoundNetLog()); + CreateSecureSpdySession(session.get(), key, BoundNetLog()); trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -11085,7 +11085,7 @@ TEST_P(HttpNetworkTransactionTest, GenerateAuthToken) { request.url = GURL(test_config.server_url); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); SSLSocketDataProvider ssl_socket_data_provider(SYNCHRONOUS, OK); @@ -11184,12 +11184,12 @@ TEST_P(HttpNetworkTransactionTest, MultiRoundAuth) { request.url = origin; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Use a TCP Socket Pool with only one connection per group. This is used // to validate that the TCP socket is not released to the pool between // each round of multi-round authentication. - HttpNetworkSessionPeer session_peer(session); + HttpNetworkSessionPeer session_peer(session.get()); TransportClientSocketPool* transport_pool = new TransportClientSocketPool( 50, // Max sockets for pool 1, // Max sockets per group @@ -11384,7 +11384,7 @@ TEST_P(HttpNetworkTransactionTest, NpnWithHttpOverSSL) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -11436,7 +11436,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyPostNPNServerHangup) { TestCompletionCallback callback; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -11590,7 +11590,7 @@ TEST_P(HttpNetworkTransactionTest, SpdyAlternateProtocolThroughProxy) { session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); session_deps_.socket_factory->AddSocketDataProvider( &hanging_non_alternate_protocol_socket); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // First round should work and provide the Alternate-Protocol state. TestCompletionCallback callback_1; @@ -11650,7 +11650,7 @@ TEST_P(HttpNetworkTransactionTest, SimpleCancel) { request.load_flags = 0; session_deps_.host_resolver->set_synchronous_mode(true); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -11688,7 +11688,7 @@ TEST_P(HttpNetworkTransactionTest, CancelAfterHeaders) { StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); { HttpRequestInfo request; @@ -11724,7 +11724,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyGet) { ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); HttpRequestInfo request; request.method = "GET"; @@ -11788,7 +11788,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGet) { ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); HttpRequestInfo request; request.method = "GET"; @@ -11865,7 +11865,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyTunnelGetHangup) { session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70"); BoundTestNetLog log; session_deps_.net_log = log.bound().net_log(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); HttpRequestInfo request; request.method = "GET"; @@ -11937,14 +11937,14 @@ TEST_P(HttpNetworkTransactionTest, PreconnectWithExistingSpdySession) { ssl.SetNextProto(GetParam()); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Set up an initial SpdySession in the pool to reuse. HostPortPair host_port_pair("www.example.org", 443); SpdySessionKey key(host_port_pair, ProxyServer::Direct(), PRIVACY_MODE_DISABLED); base::WeakPtr<SpdySession> spdy_session = - CreateInsecureSpdySession(session, key, BoundNetLog()); + CreateInsecureSpdySession(session.get(), key, BoundNetLog()); HttpRequestInfo request; request.method = "GET"; @@ -11980,7 +11980,7 @@ void HttpNetworkTransactionTest::CheckErrorIsPassedBack( session_deps_.socket_factory->AddSocketDataProvider(&data); session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -12067,7 +12067,7 @@ TEST_P(HttpNetworkTransactionTest, StaticSocketDataProvider data4(NULL, 0, NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&data4); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -12184,7 +12184,7 @@ TEST_P(HttpNetworkTransactionTest, StaticSocketDataProvider data5(data2_reads, arraysize(data2_reads), NULL, 0); session_deps_.socket_factory->AddSocketDataProvider(&data5); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -12276,7 +12276,7 @@ TEST_P(HttpNetworkTransactionTest, ClientAuthCertCache_Proxy_Fail) { for (size_t i = 0; i < arraysize(requests); ++i) { session_deps_.socket_factory->ResetNextMockIndexes(); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpNetworkTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -12329,7 +12329,7 @@ TEST_P(HttpNetworkTransactionTest, UseIPConnectionPooling) { // Set up a special HttpNetworkSession with a MockCachingHostResolver. session_deps_.host_resolver.reset(new MockCachingHostResolver()); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); SpdySessionPoolPeer pool_peer(session->spdy_session_pool()); pool_peer.DisableDomainAuthenticationVerification(); @@ -12428,7 +12428,7 @@ TEST_P(HttpNetworkTransactionTest, UseIPConnectionPoolingAfterResolution) { // Set up a special HttpNetworkSession with a MockCachingHostResolver. session_deps_.host_resolver.reset(new MockCachingHostResolver()); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); SpdySessionPoolPeer pool_peer(session->spdy_session_pool()); pool_peer.DisableDomainAuthenticationVerification(); @@ -12558,7 +12558,7 @@ TEST_P(HttpNetworkTransactionTest, HttpNetworkSession::Params params = SpdySessionDependencies::CreateSessionParams(&session_deps_); params.host_resolver = &host_resolver; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); SpdySessionPoolPeer pool_peer(session->spdy_session_pool()); pool_peer.DisableDomainAuthenticationVerification(); @@ -12698,7 +12698,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttp) { session_deps_.socket_factory->AddSocketDataProvider(&data1); session_deps_.socket_factory->AddSocketDataProvider(&data2); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Start the first transaction to set up the SpdySession HttpRequestInfo request1; @@ -12810,7 +12810,7 @@ class AltSvcCertificateVerificationTest : public HttpNetworkTransactionTest { session_deps_.socket_factory->AddSocketDataProvider(&data_refused); session_deps_.use_alternative_services = true; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); AlternativeService alternative_service( @@ -12914,7 +12914,7 @@ TEST_P(HttpNetworkTransactionTest, AlternativeServiceNotOnHttp11) { // Set up alternative service for origin. session_deps_.use_alternative_services = true; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); AlternativeService alternative_service( @@ -12987,7 +12987,7 @@ TEST_P(HttpNetworkTransactionTest, FailedAlternativeServiceIsNotUserVisible) { // Set up alternative service for origin. session_deps_.use_alternative_services = true; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); AlternativeService alternative_service( @@ -13096,7 +13096,7 @@ TEST_P(HttpNetworkTransactionTest, AlternativeServiceShouldNotPoolToHttp11) { // Set up alternative service for origin. session_deps_.use_alternative_services = true; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); base::WeakPtr<HttpServerProperties> http_server_properties = session->http_server_properties(); AlternativeService alternative_service( @@ -13230,7 +13230,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) { session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl2); session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data1); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_)); // Start the first transaction to set up the SpdySession @@ -13365,7 +13365,7 @@ TEST_P(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) { session_deps_.host_resolver->rules()->AddRule("news.example.org", ip_addr); session_deps_.host_resolver->rules()->AddRule("proxy", ip_addr); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_)); // Start the first transaction to set up the SpdySession @@ -13440,7 +13440,7 @@ TEST_P(HttpNetworkTransactionTest, ErrorSocketNotConnected) { session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2); session_deps_.socket_factory->AddSocketDataProvider(&data2); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps_)); // Start the first transaction to set up the SpdySession and verify that @@ -13479,7 +13479,7 @@ TEST_P(HttpNetworkTransactionTest, CloseIdleSpdySessionToOpenNewOne) { // Use two different hosts with different IPs so they don't get pooled. session_deps_.host_resolver->rules()->AddRule("www.a.com", "10.0.0.1"); session_deps_.host_resolver->rules()->AddRule("www.b.com", "10.0.0.2"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); SSLSocketDataProvider ssl1(ASYNC, OK); ssl1.SetNextProto(GetParam()); @@ -13639,7 +13639,7 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncConnectError) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -13676,7 +13676,7 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncConnectError) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -13713,7 +13713,7 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncWriteError) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -13747,7 +13747,7 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncWriteError) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -13781,7 +13781,7 @@ TEST_P(HttpNetworkTransactionTest, HttpSyncReadError) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -13818,7 +13818,7 @@ TEST_P(HttpNetworkTransactionTest, HttpAsyncReadError) { request.url = GURL("http://www.example.org/"); request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -13856,7 +13856,7 @@ TEST_P(HttpNetworkTransactionTest, GetFullRequestHeadersIncludesExtraHeader) { request.load_flags = 0; request.extra_headers.SetHeader("X-Foo", "bar"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -14246,8 +14246,8 @@ class FakeWebSocketStreamCreateHelper : // Make sure that HttpNetworkTransaction passes on its priority to its // stream request on start. TEST_P(HttpNetworkTransactionTest, SetStreamRequestPriorityOnStart) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - HttpNetworkSessionPeer peer(session); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + HttpNetworkSessionPeer peer(session.get()); FakeStreamFactory* fake_factory = new FakeStreamFactory(); peer.SetHttpStreamFactory(scoped_ptr<HttpStreamFactory>(fake_factory)); @@ -14269,8 +14269,8 @@ TEST_P(HttpNetworkTransactionTest, SetStreamRequestPriorityOnStart) { // Make sure that HttpNetworkTransaction passes on its priority // updates to its stream request. TEST_P(HttpNetworkTransactionTest, SetStreamRequestPriority) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - HttpNetworkSessionPeer peer(session); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + HttpNetworkSessionPeer peer(session.get()); FakeStreamFactory* fake_factory = new FakeStreamFactory(); peer.SetHttpStreamFactory(scoped_ptr<HttpStreamFactory>(fake_factory)); @@ -14294,8 +14294,8 @@ TEST_P(HttpNetworkTransactionTest, SetStreamRequestPriority) { // Make sure that HttpNetworkTransaction passes on its priority // updates to its stream. TEST_P(HttpNetworkTransactionTest, SetStreamPriority) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - HttpNetworkSessionPeer peer(session); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + HttpNetworkSessionPeer peer(session.get()); FakeStreamFactory* fake_factory = new FakeStreamFactory(); peer.SetHttpStreamFactory(scoped_ptr<HttpStreamFactory>(fake_factory)); @@ -14324,8 +14324,8 @@ TEST_P(HttpNetworkTransactionTest, CreateWebSocketHandshakeStream) { std::string test_cases[] = {"ws://www.example.org/", "wss://www.example.org/"}; for (size_t i = 0; i < arraysize(test_cases); ++i) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); - HttpNetworkSessionPeer peer(session); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + HttpNetworkSessionPeer peer(session.get()); FakeStreamFactory* fake_factory = new FakeStreamFactory(); FakeWebSocketStreamCreateHelper websocket_stream_create_helper; peer.SetHttpStreamFactoryForWebSocket( @@ -14406,7 +14406,7 @@ TEST_P(HttpNetworkTransactionTest, CloseSSLSocketOnIdleForHttpRequest) { http_writes, arraysize(http_writes)); session_deps_.socket_factory->AddSocketDataProvider(&http_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Start the SSL request. TestCompletionCallback ssl_callback; @@ -14488,7 +14488,7 @@ TEST_P(HttpNetworkTransactionTest, CloseSSLSocketOnIdleForHttpRequest2) { http_writes, arraysize(http_writes)); session_deps_.socket_factory->AddSocketDataProvider(&http_data); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Preconnect an SSL socket. A preconnect is needed because connect jobs are // cancelled when a normal transaction is cancelled. @@ -14529,7 +14529,7 @@ TEST_P(HttpNetworkTransactionTest, PostReadsErrorResponseAfterReset) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -14574,7 +14574,7 @@ TEST_P(HttpNetworkTransactionTest, PostReadsErrorResponseAfterReset) { // response from a server that rejected a POST with a CONNECTION_RESET. TEST_P(HttpNetworkTransactionTest, PostReadsErrorResponseAfterResetOnReusedSocket) { - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes[] = { MockWrite("GET / HTTP/1.1\r\n" "Host: www.foo.com\r\n" @@ -14668,7 +14668,7 @@ TEST_P(HttpNetworkTransactionTest, request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -14723,7 +14723,7 @@ TEST_P(HttpNetworkTransactionTest, ChunkedPostReadsErrorResponseAfterReset) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -14782,7 +14782,7 @@ TEST_P(HttpNetworkTransactionTest, PostReadsErrorResponseAfterResetAnd100) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); @@ -14835,7 +14835,7 @@ TEST_P(HttpNetworkTransactionTest, PostIgnoresNonErrorResponseAfterReset) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -14877,7 +14877,7 @@ TEST_P(HttpNetworkTransactionTest, request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -14920,7 +14920,7 @@ TEST_P(HttpNetworkTransactionTest, PostIgnoresHttp09ResponseAfterReset) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -14960,7 +14960,7 @@ TEST_P(HttpNetworkTransactionTest, PostIgnoresPartial400HeadersAfterReset) { request.upload_data_stream = &upload_data_stream; request.load_flags = 0; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. @@ -15001,7 +15001,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWssTunnel) { session_deps_.proxy_service = ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); // Since a proxy is configured, try to establish a tunnel. MockWrite data_writes[] = { @@ -15108,7 +15108,7 @@ TEST_P(HttpNetworkTransactionTest, ProxyHeadersNotSentOverWsTunnel) { session_deps_.proxy_service = ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"); - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); MockWrite data_writes[] = { // Try to establish a tunnel for the WebSocket connection, with @@ -15184,7 +15184,7 @@ TEST_P(HttpNetworkTransactionTest, TotalNetworkBytesPost) { request.url = GURL("http://www.foo.com/"); request.upload_data_stream = &upload_data_stream; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { @@ -15228,7 +15228,7 @@ TEST_P(HttpNetworkTransactionTest, TotalNetworkBytesPost100Continue) { request.url = GURL("http://www.foo.com/"); request.upload_data_stream = &upload_data_stream; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes[] = { @@ -15273,7 +15273,7 @@ TEST_P(HttpNetworkTransactionTest, TotalNetworkBytesChunkedPost) { request.url = GURL("http://www.foo.com/"); request.upload_data_stream = &upload_data_stream; - scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); + scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Send headers successfully, but get an error while sending the body. diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index 4a36144..bcc6299 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc @@ -287,7 +287,7 @@ class HttpProxyClientSocketPoolTest ssl_data_->SetNextProto(GetParam().protocol); } - HttpNetworkSession* CreateNetworkSession() { + scoped_ptr<HttpNetworkSession> CreateNetworkSession() { return SpdySessionDependencies::SpdyCreateSession(&session_deps_); } @@ -303,7 +303,7 @@ class HttpProxyClientSocketPoolTest scoped_ptr<CertVerifier> cert_verifier_; SSLClientSocketPool ssl_socket_pool_; - const scoped_refptr<HttpNetworkSession> session_; + const scoped_ptr<HttpNetworkSession> session_; protected: SpdyTestUtil spdy_util_; diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 2062d4d..358cea7 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc @@ -232,7 +232,7 @@ class HttpResponseBodyDrainerTest : public testing::Test { scoped_refptr<SSLConfigService> ssl_config_service_; scoped_ptr<HttpServerPropertiesImpl> http_server_properties_; scoped_ptr<TransportSecurityState> transport_security_state_; - const scoped_refptr<HttpNetworkSession> session_; + const scoped_ptr<HttpNetworkSession> session_; CloseResultWaiter result_waiter_; MockHttpStream* const mock_stream_; // Owned by |drainer_|. HttpResponseBodyDrainer* const drainer_; // Deletes itself. diff --git a/net/http/http_stream_factory_impl_request_unittest.cc b/net/http/http_stream_factory_impl_request_unittest.cc index 7a54831..a68d164 100644 --- a/net/http/http_stream_factory_impl_request_unittest.cc +++ b/net/http/http_stream_factory_impl_request_unittest.cc @@ -64,8 +64,8 @@ TEST_P(HttpStreamFactoryImplRequestTest, SetPriority) { SpdySessionDependencies session_deps(GetParam(), ProxyService::CreateDirect()); - scoped_refptr<HttpNetworkSession> - session(SpdySessionDependencies::SpdyCreateSession(&session_deps)); + scoped_ptr<HttpNetworkSession> session = + SpdySessionDependencies::SpdyCreateSession(&session_deps); HttpStreamFactoryImpl* factory = static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory()); diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc index 8c404e7..a5e1a85 100644 --- a/net/http/http_stream_factory_impl_unittest.cc +++ b/net/http/http_stream_factory_impl_unittest.cc @@ -431,9 +431,9 @@ TEST_P(HttpStreamFactoryTest, PreconnectDirect) { for (size_t i = 0; i < arraysize(kTests); ++i) { SpdySessionDependencies session_deps( GetParam(), ProxyService::CreateDirect()); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); CapturePreconnectsTransportSocketPool* transport_conn_pool = new CapturePreconnectsTransportSocketPool( session_deps.host_resolver.get(), @@ -459,9 +459,9 @@ TEST_P(HttpStreamFactoryTest, PreconnectHttpProxy) { for (size_t i = 0; i < arraysize(kTests); ++i) { SpdySessionDependencies session_deps( GetParam(), ProxyService::CreateFixed("http_proxy")); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); HostPortPair proxy_host("http_proxy", 80); CapturePreconnectsHttpProxySocketPool* http_proxy_pool = new CapturePreconnectsHttpProxySocketPool( @@ -488,9 +488,9 @@ TEST_P(HttpStreamFactoryTest, PreconnectSocksProxy) { for (size_t i = 0; i < arraysize(kTests); ++i) { SpdySessionDependencies session_deps( GetParam(), ProxyService::CreateFixed("socks4://socks_proxy:1080")); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); HostPortPair proxy_host("socks_proxy", 1080); CapturePreconnectsSOCKSSocketPool* socks_proxy_pool = new CapturePreconnectsSOCKSSocketPool( @@ -517,9 +517,9 @@ TEST_P(HttpStreamFactoryTest, PreconnectDirectWithExistingSpdySession) { for (size_t i = 0; i < arraysize(kTests); ++i) { SpdySessionDependencies session_deps( GetParam(), ProxyService::CreateDirect()); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); // Put a SpdySession in the pool. HostPortPair host_port_pair("www.google.com", 443); @@ -558,9 +558,9 @@ TEST_P(HttpStreamFactoryTest, PreconnectUnsafePort) { SpdySessionDependencies session_deps( GetParam(), ProxyService::CreateDirect()); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); - HttpNetworkSessionPeer peer(session); + HttpNetworkSessionPeer peer(session.get()); CapturePreconnectsTransportSocketPool* transport_conn_pool = new CapturePreconnectsTransportSocketPool( session_deps.host_resolver.get(), @@ -589,7 +589,7 @@ TEST_P(HttpStreamFactoryTest, JobNotifiesProxy) { socket_data2.set_connect_data(MockConnect(ASYNC, OK)); session_deps.socket_factory->AddSocketDataProvider(&socket_data2); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. It should succeed using the second proxy in the @@ -638,8 +638,7 @@ TEST_P(HttpStreamFactoryTest, UnreachableQuicProxyMarkedAsBad) { params.ssl_config_service = ssl_config_service.get(); params.http_server_properties = http_server_properties.GetWeakPtr(); - scoped_refptr<HttpNetworkSession> session; - session = new HttpNetworkSession(params); + scoped_ptr<HttpNetworkSession> session(new HttpNetworkSession(params)); session->quic_stream_factory()->set_require_confirmation(false); StaticSocketDataProvider socket_data1; @@ -700,8 +699,7 @@ TEST_P(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad) { params.http_server_properties = http_server_properties.GetWeakPtr(); params.quic_max_number_of_lossy_connections = 2; - scoped_refptr<HttpNetworkSession> session; - session = new HttpNetworkSession(params); + scoped_ptr<HttpNetworkSession> session(new HttpNetworkSession(params)); session->quic_stream_factory()->set_require_confirmation(false); session->quic_stream_factory()->number_of_lossy_connections_[99] = @@ -748,7 +746,7 @@ TEST_P(HttpStreamFactoryTest, PrivacyModeDisablesChannelId) { SSLSocketDataProvider ssl(ASYNC, OK); session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Set an existing SpdySession in the pool. @@ -814,7 +812,7 @@ TEST_P(HttpStreamFactoryTest, PrivacyModeUsesDifferentSocketPoolGroup) { SSLSocketDataProvider ssl(ASYNC, OK); session_deps.socket_factory->AddSSLSocketDataProvider(&ssl); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); SSLClientSocketPool* ssl_pool = session->GetSSLSocketPool( HttpNetworkSession::NORMAL_SOCKET_POOL); @@ -864,7 +862,7 @@ TEST_P(HttpStreamFactoryTest, GetLoadState) { socket_data.set_connect_data(MockConnect(ASYNC, OK)); session_deps.socket_factory->AddSocketDataProvider(&socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); HttpRequestInfo request_info; @@ -891,7 +889,7 @@ TEST_P(HttpStreamFactoryTest, RequestHttpStream) { socket_data.set_connect_data(MockConnect(ASYNC, OK)); session_deps.socket_factory->AddSocketDataProvider(&socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. It should succeed using the second proxy in the @@ -941,7 +939,7 @@ TEST_P(HttpStreamFactoryTest, RequestHttpStreamOverSSL) { SSLSocketDataProvider ssl_socket_data(ASYNC, OK); session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. @@ -986,7 +984,7 @@ TEST_P(HttpStreamFactoryTest, RequestHttpStreamOverProxy) { socket_data.set_connect_data(MockConnect(ASYNC, OK)); session_deps.socket_factory->AddSocketDataProvider(&socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. It should succeed using the second proxy in the @@ -1039,7 +1037,7 @@ TEST_P(HttpStreamFactoryTest, RequestWebSocketBasicHandshakeStream) { socket_data.set_connect_data(MockConnect(ASYNC, OK)); session_deps.socket_factory->AddSocketDataProvider(&socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. @@ -1087,7 +1085,7 @@ TEST_P(HttpStreamFactoryTest, RequestWebSocketBasicHandshakeStreamOverSSL) { SSLSocketDataProvider ssl_socket_data(ASYNC, OK); session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. @@ -1132,7 +1130,7 @@ TEST_P(HttpStreamFactoryTest, RequestWebSocketBasicHandshakeStreamOverProxy) { socket_data.set_connect_data(MockConnect(ASYNC, OK)); session_deps.socket_factory->AddSocketDataProvider(&socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. @@ -1193,7 +1191,7 @@ TEST_P(HttpStreamFactoryTest, RequestSpdyHttpStream) { session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data); HostPortPair host_port_pair("www.google.com", 443); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. @@ -1246,8 +1244,8 @@ TEST_P(HttpStreamFactoryTest, RequestWebSocketSpdyHandshakeStreamButGetSSL) { session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data); HostPortPair host_port_pair("www.google.com", 80); - scoped_refptr<HttpNetworkSession> - session(SpdySessionDependencies::SpdyCreateSession(&session_deps)); + scoped_ptr<HttpNetworkSession> session( + SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. HttpRequestInfo request_info; @@ -1298,8 +1296,8 @@ TEST_P(HttpStreamFactoryTest, DISABLED_RequestWebSocketSpdyHandshakeStream) { session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data); HostPortPair host_port_pair("www.google.com", 80); - scoped_refptr<HttpNetworkSession> - session(SpdySessionDependencies::SpdyCreateSession(&session_deps)); + scoped_ptr<HttpNetworkSession> session( + SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. HttpRequestInfo request_info; @@ -1380,7 +1378,7 @@ TEST_P(HttpStreamFactoryTest, DISABLED_OrphanedWebSocketStream) { ssl_socket_data.SetNextProto(GetParam()); session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data); - scoped_refptr<HttpNetworkSession> session( + scoped_ptr<HttpNetworkSession> session( SpdySessionDependencies::SpdyCreateSession(&session_deps)); // Now request a stream. diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc index c483323..ce49d33 100644 --- a/net/http/mock_http_cache.cc +++ b/net/http/mock_http_cache.cc @@ -524,13 +524,10 @@ int MockBackendFactory::CreateBackend(NetLog* net_log, //----------------------------------------------------------------------------- -MockHttpCache::MockHttpCache() - : http_cache_(new MockNetworkLayer(), NULL, new MockBackendFactory()) { -} +MockHttpCache::MockHttpCache() : MockHttpCache(new MockBackendFactory()) {} MockHttpCache::MockHttpCache(HttpCache::BackendFactory* disk_cache_factory) - : http_cache_(new MockNetworkLayer(), NULL, disk_cache_factory) { -} + : http_cache_(new MockNetworkLayer(), nullptr, disk_cache_factory, true) {} disk_cache::Backend* MockHttpCache::backend() { TestCompletionCallback cb; |