diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-01 00:39:50 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-01 00:39:50 +0000 |
commit | 90499486eb26f12da3456f01bd28abc4a6191ea4 (patch) | |
tree | aa97aa55048b94b328a11621f0dc73a2622c06e8 /net/http | |
parent | a9030b828efc3b1312264875c1f76b35708eb000 (diff) | |
download | chromium_src-90499486eb26f12da3456f01bd28abc4a6191ea4.zip chromium_src-90499486eb26f12da3456f01bd28abc4a6191ea4.tar.gz chromium_src-90499486eb26f12da3456f01bd28abc4a6191ea4.tar.bz2 |
Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
Linux fixes
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/15829004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
32 files changed, 645 insertions, 610 deletions
diff --git a/net/http/http_auth_controller.cc b/net/http/http_auth_controller.cc index ae39640..00b30d75 100644 --- a/net/http/http_auth_controller.cc +++ b/net/http/http_auth_controller.cc @@ -251,7 +251,7 @@ int HttpAuthController::HandleAuthChallenge( bool establishing_tunnel, const BoundNetLog& net_log) { DCHECK(CalledOnValidThread()); - DCHECK(headers); + DCHECK(headers.get()); DCHECK(auth_origin_.is_valid()); VLOG(1) << "The " << HttpAuth::GetAuthTargetString(target_) << " " << auth_origin_ << " requested auth " @@ -263,8 +263,12 @@ int HttpAuthController::HandleAuthChallenge( // case. if (HaveAuth()) { std::string challenge_used; - HttpAuth::AuthorizationResult result = HttpAuth::HandleChallengeResponse( - handler_.get(), headers, target_, disabled_schemes_, &challenge_used); + HttpAuth::AuthorizationResult result = + HttpAuth::HandleChallengeResponse(handler_.get(), + headers.get(), + target_, + disabled_schemes_, + &challenge_used); switch (result) { case HttpAuth::AUTHORIZATION_RESULT_ACCEPT: break; @@ -314,8 +318,11 @@ int HttpAuthController::HandleAuthChallenge( if (!handler_.get() && can_send_auth) { // Find the best authentication challenge that we support. HttpAuth::ChooseBestChallenge(http_auth_handler_factory_, - headers, target_, auth_origin_, - disabled_schemes_, net_log, + headers.get(), + target_, + auth_origin_, + disabled_schemes_, + net_log, &handler_); if (handler_.get()) HistogramAuthEvent(handler_.get(), AUTH_EVENT_START); diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc index 76ec06a..3eb3f98 100644 --- a/net/http/http_basic_stream.cc +++ b/net/http/http_basic_stream.cc @@ -35,8 +35,8 @@ int HttpBasicStream::InitializeStream( const CompletionCallback& callback) { DCHECK(!parser_.get()); request_info_ = request_info; - parser_.reset(new HttpStreamParser(connection_.get(), request_info, - read_buf_, net_log)); + parser_.reset(new HttpStreamParser( + connection_.get(), request_info, read_buf_.get(), net_log)); return OK; } diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index b689c9e..6fe5a81 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -76,8 +76,14 @@ int HttpCache::DefaultBackend::CreateBackend( NetLog* net_log, disk_cache::Backend** backend, const CompletionCallback& callback) { DCHECK_GE(max_bytes_, 0); - return disk_cache::CreateCacheBackend(type_, backend_type_, path_, max_bytes_, - true, thread_, net_log, backend, + return disk_cache::CreateCacheBackend(type_, + backend_type_, + path_, + max_bytes_, + true, + thread_.get(), + net_log, + backend, callback); } @@ -242,7 +248,8 @@ void HttpCache::MetadataWriter::VerifyResponse(int result) { return SelfDestroy(); result = transaction_->WriteMetadata( - buf_, buf_len_, + buf_.get(), + buf_len_, base::Bind(&MetadataWriter::OnIOComplete, base::Unretained(this))); if (result != ERR_IO_PENDING) SelfDestroy(); diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc index 82b3078..3a23682 100644 --- a/net/http/http_cache_transaction.cc +++ b/net/http/http_cache_transaction.cc @@ -360,7 +360,7 @@ int HttpCache::Transaction::RestartWithCertificate( int HttpCache::Transaction::RestartWithAuth( const AuthCredentials& credentials, const CompletionCallback& callback) { - DCHECK(auth_response_.headers); + DCHECK(auth_response_.headers.get()); DCHECK(!callback.is_null()); // Ensure that we only have one asynchronous call at a time. @@ -400,7 +400,7 @@ int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len, // If we have an intermediate auth response at this point, then it means the // user wishes to read the network response (the error page). If there is a // previous response in the cache then we should leave it intact. - if (auth_response_.headers && mode_ != NONE) { + if (auth_response_.headers.get() && mode_ != NONE) { UpdateTransactionPattern(PATTERN_NOT_COVERED); DCHECK(mode_ & WRITE); DoneWritingToEntry(mode_ == READ_WRITE); @@ -464,10 +464,12 @@ void HttpCache::Transaction::DoneReading() { const HttpResponseInfo* HttpCache::Transaction::GetResponseInfo() const { // Null headers means we encountered an error or haven't a response yet - if (auth_response_.headers) + if (auth_response_.headers.get()) return &auth_response_; - return (response_.headers || response_.ssl_info.cert || - response_.cert_request_info) ? &response_ : NULL; + return (response_.headers.get() || response_.ssl_info.cert.get() || + response_.cert_request_info.get()) + ? &response_ + : NULL; } LoadState HttpCache::Transaction::GetLoadState() const { @@ -918,7 +920,7 @@ int HttpCache::Transaction::DoSuccessfulSendRequest() { } new_response_ = new_response; - if (!ValidatePartialResponse() && !auth_response_.headers) { + if (!ValidatePartialResponse() && !auth_response_.headers.get()) { // Something went wrong with this request and we have to restart it. // If we have an authentication response, we are exposed to weird things // hapenning if the user cancels the authentication before we receive @@ -982,7 +984,7 @@ int HttpCache::Transaction::DoSuccessfulSendRequest() { int HttpCache::Transaction::DoNetworkRead() { ReportNetworkActionStart(); next_state_ = STATE_NETWORK_READ_COMPLETE; - return network_trans_->Read(read_buf_, io_buf_len_, io_callback_); + return network_trans_->Read(read_buf_.get(), io_buf_len_, io_callback_); } int HttpCache::Transaction::DoNetworkReadComplete(int result) { @@ -1238,7 +1240,7 @@ int HttpCache::Transaction::DoUpdateCachedResponse() { int rv = OK; // Update cached response based on headers in new_response. // TODO(wtc): should we update cached certificate (response_.ssl_info), too? - response_.headers->Update(*new_response_->headers); + response_.headers->Update(*new_response_->headers.get()); response_.response_time = new_response_->response_time; response_.request_time = new_response_->request_time; response_.network_accessed = new_response_->network_accessed; @@ -1301,7 +1303,7 @@ int HttpCache::Transaction::DoOverwriteCachedResponse() { // We change the value of Content-Length for partial content. if (handling_206_ && partial_.get()) - partial_->FixContentLength(new_response_->headers); + partial_->FixContentLength(new_response_->headers.get()); response_ = *new_response_; @@ -1309,7 +1311,7 @@ int HttpCache::Transaction::DoOverwriteCachedResponse() { // There is no point in storing this resource because it will never be used. DoneWritingToEntry(false); if (partial_.get()) - partial_->FixResponseHeaders(response_.headers, true); + partial_->FixResponseHeaders(response_.headers.get(), true); next_state_ = STATE_PARTIAL_HEADERS_RECEIVED; return OK; } @@ -1392,7 +1394,7 @@ int HttpCache::Transaction::DoPartialHeadersReceived() { } else if (mode_ != NONE) { // We are about to return the headers for a byte-range request to the user, // so let's fix them. - partial_->FixResponseHeaders(response_.headers, true); + partial_->FixResponseHeaders(response_.headers.get(), true); } return OK; } @@ -1406,9 +1408,8 @@ int HttpCache::Transaction::DoCacheReadResponse() { net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_INFO); ReportCacheActionStart(); - return ResetCacheIOStart( - entry_->disk_entry->ReadData(kResponseInfoIndex, 0, read_buf_, - io_buf_len_, io_callback_)); + return ResetCacheIOStart(entry_->disk_entry->ReadData( + kResponseInfoIndex, 0, read_buf_.get(), io_buf_len_, io_callback_)); } int HttpCache::Transaction::DoCacheReadResponseComplete(int result) { @@ -1496,7 +1497,7 @@ int HttpCache::Transaction::DoCacheWriteResponseComplete(int result) { int HttpCache::Transaction::DoCacheReadMetadata() { DCHECK(entry_); - DCHECK(!response_.metadata); + DCHECK(!response_.metadata.get()); next_state_ = STATE_CACHE_READ_METADATA_COMPLETE; response_.metadata = @@ -1505,7 +1506,9 @@ int HttpCache::Transaction::DoCacheReadMetadata() { net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_INFO); ReportCacheActionStart(); return ResetCacheIOStart( - entry_->disk_entry->ReadData(kMetadataIndex, 0, response_.metadata, + entry_->disk_entry->ReadData(kMetadataIndex, + 0, + response_.metadata.get(), response_.metadata->size(), io_callback_)); } @@ -1542,14 +1545,15 @@ int HttpCache::Transaction::DoCacheReadData() { net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_DATA); ReportCacheActionStart(); if (partial_.get()) { - return ResetCacheIOStart( - partial_->CacheRead(entry_->disk_entry, read_buf_, io_buf_len_, - io_callback_)); + return ResetCacheIOStart(partial_->CacheRead( + entry_->disk_entry, read_buf_.get(), io_buf_len_, io_callback_)); } - return ResetCacheIOStart( - entry_->disk_entry->ReadData(kResponseContentIndex, read_offset_, - read_buf_, io_buf_len_, io_callback_)); + return ResetCacheIOStart(entry_->disk_entry->ReadData(kResponseContentIndex, + read_offset_, + read_buf_.get(), + io_buf_len_, + io_callback_)); } int HttpCache::Transaction::DoCacheReadDataComplete(int result) { @@ -1591,7 +1595,7 @@ int HttpCache::Transaction::DoCacheWriteData(int num_bytes) { } return ResetCacheIOStart( - AppendResponseDataToEntry(read_buf_, num_bytes, io_callback_)); + AppendResponseDataToEntry(read_buf_.get(), num_bytes, io_callback_)); } int HttpCache::Transaction::DoCacheWriteDataComplete(int result) { @@ -1867,8 +1871,8 @@ int HttpCache::Transaction::BeginPartialCacheValidation() { int HttpCache::Transaction::ValidateEntryHeadersAndContinue() { DCHECK(mode_ == READ_WRITE); - if (!partial_->UpdateFromStoredHeaders(response_.headers, entry_->disk_entry, - truncated_)) { + if (!partial_->UpdateFromStoredHeaders( + response_.headers.get(), entry_->disk_entry, truncated_)) { return DoRestartPartialRequest(); } @@ -1962,7 +1966,8 @@ bool HttpCache::Transaction::RequiresValidation() { return false; if (response_.vary_data.is_valid() && - !response_.vary_data.MatchesRequest(*request_, *response_.headers)) { + !response_.vary_data.MatchesRequest(*request_, + *response_.headers.get())) { vary_mismatch_ = true; return true; } @@ -1985,7 +1990,7 @@ bool HttpCache::Transaction::RequiresValidation() { } bool HttpCache::Transaction::ConditionalizeRequest() { - DCHECK(response_.headers); + DCHECK(response_.headers.get()); if (request_->method == "PUT" || request_->method == "DELETE") return false; @@ -2074,7 +2079,7 @@ bool HttpCache::Transaction::ConditionalizeRequest() { // time it is called it will return true so that we don't keep retrying the // request. bool HttpCache::Transaction::ValidatePartialResponse() { - const HttpResponseHeaders* headers = new_response_->headers; + const HttpResponseHeaders* headers = new_response_->headers.get(); int response_code = headers->response_code(); bool partial_response = (response_code == 206); handling_206_ = false; @@ -2184,7 +2189,7 @@ void HttpCache::Transaction::IgnoreRangeRequest() { void HttpCache::Transaction::FailRangeRequest() { response_ = *new_response_; - partial_->FixResponseHeaders(response_.headers, false); + partial_->FixResponseHeaders(response_.headers.get(), false); } int HttpCache::Transaction::SetupEntryForRead() { @@ -2275,9 +2280,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) { data->Done(); io_buf_len_ = data->pickle()->size(); - return ResetCacheIOStart( - entry_->disk_entry->WriteData(kResponseInfoIndex, 0, data, - io_buf_len_, io_callback_, true)); + return ResetCacheIOStart(entry_->disk_entry->WriteData( + kResponseInfoIndex, 0, data.get(), io_buf_len_, io_callback_, true)); } int HttpCache::Transaction::AppendResponseDataToEntry( diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc index 8c0f55d..2a686f2 100644 --- a/net/http/http_cache_unittest.cc +++ b/net/http/http_cache_unittest.cc @@ -543,7 +543,7 @@ void CreateTruncatedEntry(std::string raw_headers, MockHttpCache* cache) { int len = static_cast<int>(base::strlcpy(buf->data(), "rg: 00-09 rg: 10-19 ", 100)); net::TestCompletionCallback cb; - int rv = entry->WriteData(1, 0, buf, len, cb.callback(), true); + int rv = entry->WriteData(1, 0, buf.get(), len, cb.callback(), true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); } @@ -682,12 +682,12 @@ TEST(HttpCache, ReleaseBuffer) { const int kBufferSize = 10; scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(kBufferSize)); - net::ReleaseBufferCompletionCallback cb(buffer); + net::ReleaseBufferCompletionCallback cb(buffer.get()); rv = trans->Start(&request, cb.callback(), net::BoundNetLog()); EXPECT_EQ(net::OK, cb.GetResult(rv)); - rv = trans->Read(buffer, kBufferSize, cb.callback()); + rv = trans->Read(buffer.get(), kBufferSize, cb.callback()); EXPECT_EQ(kBufferSize, cb.GetResult(rv)); } @@ -1748,7 +1748,7 @@ TEST(HttpCache, SimpleGET_AbandonedCacheRead) { ASSERT_EQ(net::OK, rv); scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_EQ(net::ERR_IO_PENDING, rv); // Test that destroying the transaction while it is reading from the cache @@ -3886,7 +3886,7 @@ TEST(HttpCache, GET_Previous206_NotSparse) { int len = static_cast<int>(base::strlcpy(buf->data(), kRangeGET_TransactionOK.data, 500)); net::TestCompletionCallback cb; - int rv = entry->WriteData(1, 0, buf, len, cb.callback(), true); + int rv = entry->WriteData(1, 0, buf.get(), len, cb.callback(), true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -3934,7 +3934,7 @@ TEST(HttpCache, RangeGET_Previous206_NotSparse_2) { int len = static_cast<int>(base::strlcpy(buf->data(), kRangeGET_TransactionOK.data, 500)); net::TestCompletionCallback cb; - int rv = entry->WriteData(1, 0, buf, len, cb.callback(), true); + int rv = entry->WriteData(1, 0, buf.get(), len, cb.callback(), true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -3976,7 +3976,7 @@ TEST(HttpCache, GET_Previous206_NotValidation) { int len = static_cast<int>(base::strlcpy(buf->data(), kRangeGET_TransactionOK.data, 500)); net::TestCompletionCallback cb; - int rv = entry->WriteData(1, 0, buf, len, cb.callback(), true); + int rv = entry->WriteData(1, 0, buf.get(), len, cb.callback(), true); EXPECT_EQ(len, cb.GetResult(rv)); entry->Close(); @@ -4160,7 +4160,7 @@ TEST(HttpCache, RangeGET_Cancel) { // Make sure that the entry has some data stored. scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); EXPECT_EQ(buf->size(), rv); @@ -4201,9 +4201,9 @@ TEST(HttpCache, RangeGET_Cancel2) { // Make sure that we revalidate the entry and read from the cache (a single // read will return while waiting for the network). scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(5)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(5, c->callback.GetResult(rv)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(net::ERR_IO_PENDING, rv); // Destroy the transaction before completing the read. @@ -4247,9 +4247,9 @@ TEST(HttpCache, RangeGET_Cancel3) { // Make sure that we revalidate the entry and read from the cache (a single // read will return while waiting for the network). scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(5)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(5, c->callback.GetResult(rv)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(net::ERR_IO_PENDING, rv); // Destroy the transaction before completing the read. @@ -4666,7 +4666,7 @@ TEST(HttpCache, DoomOnDestruction2) { // Make sure that the entry has some data stored. scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); EXPECT_EQ(buf->size(), rv); @@ -4710,7 +4710,7 @@ TEST(HttpCache, DoomOnDestruction3) { // Make sure that the entry has some data stored. scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); EXPECT_EQ(buf->size(), rv); @@ -4760,13 +4760,13 @@ TEST(HttpCache, SetTruncatedFlag) { // Make sure that the entry has some data stored. scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(10)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); if (rv == net::ERR_IO_PENDING) rv = c->callback.WaitForResult(); EXPECT_EQ(buf->size(), rv); // We want to cancel the request when the transaction is busy. - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(net::ERR_IO_PENDING, rv); EXPECT_FALSE(c->callback.have_result()); @@ -4827,7 +4827,7 @@ TEST(HttpCache, DontSetTruncatedFlag) { // Read everything. scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(22)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(buf->size(), c->callback.GetResult(rv)); // Destroy the transaction. @@ -4984,7 +4984,7 @@ TEST(HttpCache, GET_IncompleteResource_Cancel) { // Make sure that the entry has some data stored. scoped_refptr<net::IOBufferWithSize> buf(new net::IOBufferWithSize(5)); - rv = c->trans->Read(buf, buf->size(), c->callback.callback()); + rv = c->trans->Read(buf.get(), buf->size(), c->callback.callback()); EXPECT_EQ(5, c->callback.GetResult(rv)); // Cancel the requests. @@ -5140,9 +5140,9 @@ TEST(HttpCache, GET_CancelIncompleteResource) { // Read 20 bytes from the cache, and 10 from the net. scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(100)); - rv = c->trans->Read(buf, 20, c->callback.callback()); + rv = c->trans->Read(buf.get(), 20, c->callback.callback()); EXPECT_EQ(20, c->callback.GetResult(rv)); - rv = c->trans->Read(buf, 10, c->callback.callback()); + rv = c->trans->Read(buf.get(), 10, c->callback.callback()); EXPECT_EQ(10, c->callback.GetResult(rv)); // At this point, we are already reading so canceling the request should leave @@ -5553,7 +5553,9 @@ TEST(HttpCache, WriteMetadata_OK) { base::strlcpy(buf->data(), "Hi there", buf->size()); cache.http_cache()->WriteMetadata(GURL(kSimpleGET_Transaction.url), net::DEFAULT_PRIORITY, - response.response_time, buf, buf->size()); + response.response_time, + buf.get(), + buf->size()); // Release the buffer before the operation takes place. buf = NULL; @@ -5590,7 +5592,9 @@ TEST(HttpCache, WriteMetadata_Fail) { base::TimeDelta::FromMilliseconds(20); cache.http_cache()->WriteMetadata(GURL(kSimpleGET_Transaction.url), net::DEFAULT_PRIORITY, - expected_time, buf, buf->size()); + expected_time, + buf.get(), + buf->size()); // Makes sure we finish pending operations. base::MessageLoop::current()->RunUntilIdle(); @@ -5621,7 +5625,9 @@ TEST(HttpCache, ReadMetadata) { base::strlcpy(buf->data(), "Hi there", buf->size()); cache.http_cache()->WriteMetadata(GURL(kTypicalGET_Transaction.url), net::DEFAULT_PRIORITY, - response.response_time, buf, buf->size()); + response.response_time, + buf.get(), + buf->size()); // Makes sure we finish pending operations. base::MessageLoop::current()->RunUntilIdle(); @@ -5683,7 +5689,7 @@ TEST(HttpCache, FilterCompletion) { EXPECT_EQ(net::OK, callback.GetResult(rv)); scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_GT(callback.GetResult(rv), 0); // Now make sure that the entry is preserved. @@ -5717,15 +5723,15 @@ TEST(HttpCache, StopCachingDeletesEntry) { EXPECT_EQ(net::OK, callback.GetResult(rv)); scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - rv = trans->Read(buf, 10, callback.callback()); + rv = trans->Read(buf.get(), 10, callback.callback()); EXPECT_EQ(callback.GetResult(rv), 10); trans->StopCaching(); // We should be able to keep reading. - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_GT(callback.GetResult(rv), 0); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_EQ(callback.GetResult(rv), 0); } @@ -5763,15 +5769,15 @@ TEST(HttpCache, StopCachingSavesEntry) { EXPECT_EQ(net::OK, callback.GetResult(rv)); scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - rv = trans->Read(buf, 10, callback.callback()); + rv = trans->Read(buf.get(), 10, callback.callback()); EXPECT_EQ(callback.GetResult(rv), 10); trans->StopCaching(); // We should be able to keep reading. - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_GT(callback.GetResult(rv), 0); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_EQ(callback.GetResult(rv), 0); RemoveMockTransaction(&mock_transaction); @@ -5814,18 +5820,18 @@ TEST(HttpCache, StopCachingTruncatedEntry) { EXPECT_EQ(net::OK, callback.GetResult(rv)); scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - rv = trans->Read(buf, 10, callback.callback()); + rv = trans->Read(buf.get(), 10, callback.callback()); EXPECT_EQ(callback.GetResult(rv), 10); // This is actually going to do nothing. trans->StopCaching(); // We should be able to keep reading. - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_GT(callback.GetResult(rv), 0); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_GT(callback.GetResult(rv), 0); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); EXPECT_EQ(callback.GetResult(rv), 0); } diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc index e99cf5b..5fa5c81 100644 --- a/net/http/http_network_layer.cc +++ b/net/http/http_network_layer.cc @@ -62,14 +62,12 @@ HttpCache* HttpNetworkLayer::GetCache() { return NULL; } -HttpNetworkSession* HttpNetworkLayer::GetSession() { - return session_; -} +HttpNetworkSession* HttpNetworkLayer::GetSession() { return session_.get(); } void HttpNetworkLayer::OnSuspend() { suspended_ = true; - if (session_) + if (session_.get()) session_->CloseIdleConnections(); } diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc index 108e683..dde37bc 100644 --- a/net/http/http_network_layer_unittest.cc +++ b/net/http/http_network_layer_unittest.cc @@ -38,10 +38,10 @@ class HttpNetworkLayerTest : public PlatformTest { session_params.host_resolver = &host_resolver_; session_params.cert_verifier = cert_verifier_.get(); session_params.proxy_service = proxy_service_.get(); - session_params.ssl_config_service = ssl_config_service_; + session_params.ssl_config_service = ssl_config_service_.get(); session_params.http_server_properties = &http_server_properties_; network_session_ = new HttpNetworkSession(session_params); - factory_.reset(new HttpNetworkLayer(network_session_)); + factory_.reset(new HttpNetworkLayer(network_session_.get())); } MockClientSocketFactory mock_socket_factory_; diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc index ffbc72d..828583c 100644 --- a/net/http/http_network_session.cc +++ b/net/http/http_network_session.cc @@ -130,7 +130,7 @@ HttpNetworkSession::HttpNetworkSession(const Params& params) http_stream_factory_(new HttpStreamFactoryImpl(this)), params_(params) { DCHECK(proxy_service_); - DCHECK(ssl_config_service_); + DCHECK(ssl_config_service_.get()); CHECK(http_server_properties_); } diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h index b43c301..c94025f 100644 --- a/net/http/http_network_session.h +++ b/net/http/http_network_session.h @@ -121,7 +121,7 @@ class NET_EXPORT HttpNetworkSession CertVerifier* cert_verifier() { return cert_verifier_; } ProxyService* proxy_service() { return proxy_service_; } - SSLConfigService* ssl_config_service() { return ssl_config_service_; } + SSLConfigService* ssl_config_service() { return ssl_config_service_.get(); } SpdySessionPool* spdy_session_pool() { return &spdy_session_pool_; } QuicStreamFactory* quic_stream_factory() { return &quic_stream_factory_; } HttpAuthHandlerFactory* http_auth_handler_factory() { diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index ab991e4..1c55202 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -157,7 +157,7 @@ HttpNetworkTransaction::~HttpNetworkTransaction() { } else { // Otherwise, we try to drain the response body. HttpStreamBase* stream = stream_.release(); - stream->Drain(session_); + stream->Drain(session_.get()); } } } @@ -362,8 +362,10 @@ int HttpNetworkTransaction::Read(IOBuffer* buf, int buf_len, } const HttpResponseInfo* HttpNetworkTransaction::GetResponseInfo() const { - return ((headers_valid_ && response_.headers) || response_.ssl_info.cert || - response_.cert_request_info) ? &response_ : NULL; + return ((headers_valid_ && response_.headers.get()) || + response_.ssl_info.cert.get() || response_.cert_request_info.get()) + ? &response_ + : NULL; } LoadState HttpNetworkTransaction::GetLoadState() const { @@ -841,7 +843,7 @@ int HttpNetworkTransaction::DoReadHeaders() { } int HttpNetworkTransaction::HandleConnectionClosedBeforeEndOfHeaders() { - if (!response_.headers && !stream_->IsConnectionReused()) { + if (!response_.headers.get() && !stream_->IsConnectionReused()) { // The connection was closed before any data was sent. Likely an error // rather than empty HTTP/0.9 response. return ERR_EMPTY_RESPONSE; @@ -865,7 +867,7 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { DCHECK(stream_.get()); DCHECK(is_https_request()); response_.cert_request_info = new SSLCertRequestInfo; - stream_->GetSSLCertRequestInfo(response_.cert_request_info); + stream_->GetSSLCertRequestInfo(response_.cert_request_info.get()); result = HandleCertificateRequest(result); if (result == OK) return result; @@ -892,12 +894,12 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { if (rv != OK) return rv; } - DCHECK(response_.headers); + DCHECK(response_.headers.get()); // Server-induced fallback is supported only if this is a PAC configured // proxy. See: http://crbug.com/143712 if (response_.was_fetched_via_proxy && proxy_info_.did_use_pac_script() && - response_.headers != NULL) { + response_.headers.get() != NULL) { bool should_fallback = response_.headers->HasHeaderValue("connection", "proxy-bypass"); // Additionally, fallback if a 500 is returned via the data reduction proxy. @@ -958,7 +960,7 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { request_->url.EffectiveIntPort()); ProcessAlternateProtocol(session_->http_stream_factory(), session_->http_server_properties(), - *response_.headers, + *response_.headers.get(), endpoint); int rv = HandleAuthChallenge(); @@ -973,12 +975,13 @@ int HttpNetworkTransaction::DoReadHeadersComplete(int result) { } int HttpNetworkTransaction::DoReadBody() { - DCHECK(read_buf_); + DCHECK(read_buf_.get()); DCHECK_GT(read_buf_len_, 0); DCHECK(stream_ != NULL); next_state_ = STATE_READ_BODY_COMPLETE; - return stream_->ReadResponseBody(read_buf_, read_buf_len_, io_callback_); + return stream_->ReadResponseBody( + read_buf_.get(), read_buf_len_, io_callback_); } int HttpNetworkTransaction::DoReadBodyComplete(int result) { @@ -1164,7 +1167,7 @@ int HttpNetworkTransaction::HandleCertificateRequest(int error) { // Check that the certificate selected is still a certificate the server // is likely to accept, based on the criteria supplied in the // CertificateRequest message. - if (client_cert) { + if (client_cert.get()) { const std::vector<std::string>& cert_authorities = response_.cert_request_info->cert_authorities; @@ -1322,7 +1325,7 @@ void HttpNetworkTransaction::ResetStateForAuthRestart() { } HttpResponseHeaders* HttpNetworkTransaction::GetResponseHeaders() const { - return response_.headers; + return response_.headers.get(); } bool HttpNetworkTransaction::ShouldResendRequest(int error) const { @@ -1361,7 +1364,7 @@ bool HttpNetworkTransaction::ShouldApplyServerAuth() const { int HttpNetworkTransaction::HandleAuthChallenge() { scoped_refptr<HttpResponseHeaders> headers(GetResponseHeaders()); - DCHECK(headers); + DCHECK(headers.get()); int status = headers->response_code(); if (status != HTTP_UNAUTHORIZED && diff --git a/net/http/http_network_transaction_spdy2_unittest.cc b/net/http/http_network_transaction_spdy2_unittest.cc index c6e0052..54f1a43 100644 --- a/net/http/http_network_transaction_spdy2_unittest.cc +++ b/net/http/http_network_transaction_spdy2_unittest.cc @@ -325,7 +325,7 @@ class HttpNetworkTransactionSpdy2Test : public PlatformTest { const HttpResponseInfo* response = trans->GetResponseInfo(); // Can't use ASSERT_* inside helper functions like this, so // return an error. - if (response == NULL || response->headers == NULL) { + if (response == NULL || response->headers.get() == NULL) { out.rv = ERR_UNEXPECTED; return out; } @@ -873,7 +873,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, TwoIdenticalLocationHeaders) { EXPECT_EQ(OK, callback.WaitForResult()); const HttpResponseInfo* response = trans->GetResponseInfo(); - ASSERT_TRUE(response != NULL && response->headers != NULL); + ASSERT_TRUE(response != NULL && response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 302 Redirect", response->headers->GetStatusLine()); std::string url; EXPECT_TRUE(response->headers->IsRedirect(&url)); @@ -937,7 +937,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, Head) { ASSERT_TRUE(response != NULL); // Check that the headers got parsed. - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ(1234, response->headers->GetContentLength()); EXPECT_EQ("HTTP/1.1 404 Not Found", response->headers->GetStatusLine()); @@ -980,7 +980,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ReuseConnection) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; @@ -993,7 +993,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ReuseConnection) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1038,7 +1038,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, Ignores100) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1080,7 +1080,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, Ignores1xx) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1203,7 +1203,7 @@ void HttpNetworkTransactionSpdy2Test::KeepAliveConnectionResendRequestTest( TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1224,7 +1224,7 @@ void HttpNetworkTransactionSpdy2Test::KeepAliveConnectionResendRequestTest( const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1314,7 +1314,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveEarlyClose) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { MockRead("HTTP/1.0 200 OK\r\n"), @@ -1335,11 +1335,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveEarlyClose) { EXPECT_EQ(OK, rv); scoped_refptr<IOBufferWithSize> io_buf(new IOBufferWithSize(100)); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(5, rv); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); trans.reset(); @@ -1355,7 +1355,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveEarlyClose2) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { MockRead("HTTP/1.0 200 OK\r\n"), @@ -1375,7 +1375,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveEarlyClose2) { EXPECT_EQ(OK, rv); scoped_refptr<IOBufferWithSize> io_buf(new IOBufferWithSize(100)); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); @@ -1434,7 +1434,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveAfterUnreadBody) { TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1455,7 +1455,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveAfterUnreadBody) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); response_lines[i] = response->headers->GetStatusLine(); // We intentionally don't read the response bodies. @@ -1479,14 +1479,14 @@ TEST_F(HttpNetworkTransactionSpdy2Test, KeepAliveAfterUnreadBody) { TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); EXPECT_EQ(OK, rv); const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -1687,7 +1687,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthKeepAlive) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1776,7 +1776,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthKeepAliveNoBody) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1860,7 +1860,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthKeepAliveLargeBody) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1946,7 +1946,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthKeepAliveImpatientServer) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2031,7 +2031,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthProxyNoKeepAlive) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2050,7 +2050,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthProxyNoKeepAlive) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); @@ -2105,7 +2105,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthProxyKeepAlive) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -2161,7 +2161,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthProxyKeepAlive) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_TRUE(response->headers->IsKeepAlive()); EXPECT_EQ(407, response->headers->response_code()); EXPECT_EQ(10, response->headers->GetContentLength()); @@ -2180,7 +2180,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthProxyKeepAlive) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_TRUE(response->headers->IsKeepAlive()); EXPECT_EQ(407, response->headers->response_code()); EXPECT_EQ(10, response->headers->GetContentLength()); @@ -2206,7 +2206,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthProxyCancelTunnel) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Since we have proxy, should try to establish tunnel. MockWrite data_writes[] = { @@ -2338,7 +2338,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2410,7 +2410,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingNoPacTwoRequests) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans1( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans1->Start(&request1, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2420,7 +2420,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingNoPacTwoRequests) { const HttpResponseInfo* response1 = trans1->GetResponseInfo(); ASSERT_TRUE(response1 != NULL); - ASSERT_TRUE(response1->headers != NULL); + ASSERT_TRUE(response1->headers.get() != NULL); EXPECT_EQ(1, response1->headers->GetContentLength()); LoadTimingInfo load_timing_info1; @@ -2431,7 +2431,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingNoPacTwoRequests) { TestCompletionCallback callback2; scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback2.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2441,7 +2441,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingNoPacTwoRequests) { const HttpResponseInfo* response2 = trans2->GetResponseInfo(); ASSERT_TRUE(response2 != NULL); - ASSERT_TRUE(response2->headers != NULL); + ASSERT_TRUE(response2->headers.get() != NULL); EXPECT_EQ(2, response2->headers->GetContentLength()); LoadTimingInfo load_timing_info2; @@ -2508,7 +2508,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingWithPacTwoRequests) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans1( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans1->Start(&request1, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2518,7 +2518,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingWithPacTwoRequests) { const HttpResponseInfo* response1 = trans1->GetResponseInfo(); ASSERT_TRUE(response1 != NULL); - ASSERT_TRUE(response1->headers != NULL); + ASSERT_TRUE(response1->headers.get() != NULL); EXPECT_EQ(1, response1->headers->GetContentLength()); LoadTimingInfo load_timing_info1; @@ -2530,7 +2530,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingWithPacTwoRequests) { TestCompletionCallback callback2; scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback2.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2540,7 +2540,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpProxyLoadTimingWithPacTwoRequests) { const HttpResponseInfo* response2 = trans2->GetResponseInfo(); ASSERT_TRUE(response2 != NULL); - ASSERT_TRUE(response2->headers != NULL); + ASSERT_TRUE(response2->headers.get() != NULL); EXPECT_EQ(2, response2->headers->GetContentLength()); LoadTimingInfo load_timing_info2; @@ -2589,7 +2589,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxyGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2654,7 +2654,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2669,7 +2669,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGet) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -2745,7 +2745,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGetWithProxyAuth) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2756,7 +2756,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGetWithProxyAuth) { const HttpResponseInfo* const response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); @@ -2773,7 +2773,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyGetWithProxyAuth) { const HttpResponseInfo* const response_restart = trans->GetResponseInfo(); ASSERT_TRUE(response_restart != NULL); - ASSERT_TRUE(response_restart->headers != NULL); + ASSERT_TRUE(response_restart->headers.get() != NULL); EXPECT_EQ(200, response_restart->headers->response_code()); // The password prompt info should not be set. EXPECT_TRUE(response_restart->auth_challenge.get() == NULL); @@ -2794,7 +2794,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectHttps) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1)); @@ -2856,7 +2856,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectHttps) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -2879,7 +2879,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1)); @@ -2940,7 +2940,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectSpdy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -2963,7 +2963,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxySpdyConnectFailure) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1)); @@ -3115,7 +3115,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first connect and request, each of their responses, and the body. @@ -3130,15 +3130,15 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - EXPECT_EQ(1, trans->Read(buf, 256, callback.callback())); + EXPECT_EQ(1, trans->Read(buf.get(), 256, callback.callback())); scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3157,7 +3157,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, // separate stream. EXPECT_NE(load_timing_info.socket_log_id, load_timing_info2.socket_log_id); - EXPECT_EQ(2, trans2->Read(buf, 256, callback.callback())); + EXPECT_EQ(2, trans2->Read(buf.get(), 256, callback.callback())); } // Test load timing in the case of two HTTPS (non-SPDY) requests through a SPDY @@ -3244,7 +3244,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first connect and request, each of their responses, and the body. @@ -3259,16 +3259,16 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - EXPECT_EQ(1, trans->Read(buf, 256, callback.callback())); + EXPECT_EQ(1, trans->Read(buf.get(), 256, callback.callback())); trans.reset(); scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3285,7 +3285,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, // The requests should have the same ID. EXPECT_EQ(load_timing_info.socket_log_id, load_timing_info2.socket_log_id); - EXPECT_EQ(2, trans2->Read(buf, 256, callback.callback())); + EXPECT_EQ(2, trans2->Read(buf.get(), 256, callback.callback())); } // Test load timing in the case of of two HTTP requests through a SPDY HTTPS @@ -3363,7 +3363,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); spdy_data.RunFor(2); @@ -3378,19 +3378,19 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - EXPECT_EQ(ERR_IO_PENDING, trans->Read(buf, 256, callback.callback())); + EXPECT_EQ(ERR_IO_PENDING, trans->Read(buf.get(), 256, callback.callback())); spdy_data.RunFor(1); EXPECT_EQ(1, callback.WaitForResult()); // Delete the first request, so the second one can reuse the socket. trans.reset(); scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3405,7 +3405,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, // The requests should have the same ID. EXPECT_EQ(load_timing_info.socket_log_id, load_timing_info2.socket_log_id); - EXPECT_EQ(ERR_IO_PENDING, trans2->Read(buf, 256, callback.callback())); + EXPECT_EQ(ERR_IO_PENDING, trans2->Read(buf.get(), 256, callback.callback())); spdy_data.RunFor(1); EXPECT_EQ(2, callback.WaitForResult()); } @@ -3463,7 +3463,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxyAuthRetry) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3478,7 +3478,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HttpsProxyAuthRetry) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); @@ -3542,7 +3542,7 @@ void HttpNetworkTransactionSpdy2Test::ConnectStatusHelperWithExpectedStatus( TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3938,7 +3938,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NTLMAuth1) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4118,7 +4118,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NTLMAuth2) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4235,7 +4235,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -4274,11 +4274,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, // We now check to make sure the TCPClientSocket was not added back to // the pool. - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); trans.reset(); base::MessageLoop::current()->RunUntilIdle(); // Make sure that the socket didn't get recycled after calling the destructor. - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); } // Make sure that we recycle a socket after reading all of the response body. @@ -4291,7 +4291,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocket) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { // A part of the response body is received with the response headers. @@ -4317,11 +4317,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocket) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); std::string status_line = response->headers->GetStatusLine(); EXPECT_EQ("HTTP/1.1 200 OK", status_line); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4333,7 +4333,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session.get())); } // Make sure that we recycle a SSL socket after reading all of the response @@ -4368,7 +4368,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSSLSocket) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -4377,10 +4377,10 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSSLSocket) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4392,7 +4392,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSSLSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); } // Grab a SSL socket, use it, and put it back into the pool. Then, reuse it @@ -4436,7 +4436,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -4445,10 +4445,10 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4460,11 +4460,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); // Now start the second transaction, which should reuse the previous socket. - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -4473,10 +4473,10 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); rv = ReadTransaction(trans.get(), &response_data); EXPECT_EQ(OK, rv); @@ -4487,7 +4487,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleDeadSSLSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); } // Make sure that we recycle a socket after a zero-length response. @@ -4504,7 +4504,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocketAfterZeroContentLength) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { MockRead("HTTP/1.1 204 No Content\r\n" @@ -4528,11 +4528,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocketAfterZeroContentLength) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); std::string status_line = response->headers->GetStatusLine(); EXPECT_EQ("HTTP/1.1 204 No Content", status_line); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4544,7 +4544,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, RecycleSocketAfterZeroContentLength) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session.get())); } TEST_F(HttpNetworkTransactionSpdy2Test, ResendRequestOnWriteBodyError) { @@ -4613,7 +4613,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ResendRequestOnWriteBodyError) { for (int i = 0; i < 2; ++i) { scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; @@ -4626,7 +4626,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ResendRequestOnWriteBodyError) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -4836,7 +4836,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/z HTTP/1.1\r\n" @@ -4912,7 +4912,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/a/b HTTP/1.1\r\n" @@ -4996,7 +4996,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/z2 HTTP/1.1\r\n" @@ -5044,7 +5044,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/1 HTTP/1.1\r\n" @@ -5114,7 +5114,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /p/q/t HTTP/1.1\r\n" @@ -5226,7 +5226,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DigestPreAuthNonceCount) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/z HTTP/1.1\r\n" @@ -5305,7 +5305,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DigestPreAuthNonceCount) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/a/b HTTP/1.1\r\n" @@ -5368,7 +5368,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ResetStateForRestart) { scoped_refptr<HttpResponseHeaders> headers(new HttpResponseHeaders(temp)); request.extra_headers.SetHeader("Foo", "1"); request.extra_headers.SetHeader("bar", "23"); - EXPECT_TRUE(response->vary_data.Init(request, *headers)); + EXPECT_TRUE(response->vary_data.Init(request, *headers.get())); } // Cause the above state to be reset. @@ -5918,7 +5918,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthSpdyProxy) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5937,7 +5937,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, BasicAuthSpdyProxy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(response->auth_challenge.get() != NULL); @@ -6039,7 +6039,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CrossOriginProxyPush) { session_deps_.socket_factory->AddSSLSocketDataProvider(&proxy); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6049,9 +6049,8 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CrossOriginProxyPush) { const HttpResponseInfo* response = trans->GetResponseInfo(); scoped_ptr<HttpTransaction> push_trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); - rv = push_trans->Start(&push_request, - callback.callback(), log.bound()); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); + rv = push_trans->Start(&push_request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); @@ -6075,7 +6074,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CrossOriginProxyPush) { CONNECT_TIMING_HAS_CONNECT_TIMES_ONLY); // Verify the pushed stream. - EXPECT_TRUE(push_response->headers != NULL); + EXPECT_TRUE(push_response->headers.get() != NULL); EXPECT_EQ(200, push_response->headers->response_code()); rv = ReadTransaction(push_trans.get(), &response_data); @@ -6154,7 +6153,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CrossOriginProxyPushCorrectness) { session_deps_.socket_factory->AddSSLSocketDataProvider(&proxy); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7014,7 +7013,7 @@ int GroupNameTransactionHelper( request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; @@ -7216,7 +7215,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, GroupNameForSOCKSConnections) { peer.SetClientSocketPoolManager(mock_pool_manager); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); EXPECT_EQ(ERR_IO_PENDING, GroupNameTransactionHelper(tests[i].url, session)); @@ -7383,7 +7382,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ConnectionClosedAfterStartOfHeaders) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -7445,7 +7444,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DrainResetOK) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7535,7 +7534,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, LargeContentLengthThenClose) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -7585,7 +7584,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UploadFileSmallerThanLength) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -7647,7 +7646,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UploadUnreadableFile) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); file_util::Delete(temp_file, false); @@ -7716,7 +7715,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UnreadableUploadFileAfterAuthRestart) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 401 Unauthorized", response->headers->GetStatusLine()); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); @@ -7734,7 +7733,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UnreadableUploadFileAfterAuthRestart) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_TRUE(response->auth_challenge.get() == NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); @@ -7918,7 +7917,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HonorAlternateProtocolHeader) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7933,7 +7932,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, HonorAlternateProtocolHeader) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); @@ -7988,7 +7987,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_2); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -7997,7 +7996,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8050,7 +8049,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_2); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8101,7 +8100,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; EXPECT_EQ(ERR_IO_PENDING, trans->Start( @@ -8149,7 +8148,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_2); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8198,7 +8197,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_2); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8246,7 +8245,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_2); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8290,7 +8289,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NPN_SPDY_2); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -8303,7 +8302,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8366,7 +8365,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseAlternateProtocolForNpnSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8374,14 +8373,14 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseAlternateProtocolForNpnSpdy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello world", response_data); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8389,7 +8388,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseAlternateProtocolForNpnSpdy) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8465,7 +8464,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AlternateProtocolWithSpdyLateBinding) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); TestCompletionCallback callback1; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8473,7 +8472,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AlternateProtocolWithSpdyLateBinding) { const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8481,12 +8480,12 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AlternateProtocolWithSpdyLateBinding) { EXPECT_EQ("hello world", response_data); TestCompletionCallback callback2; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request, callback2.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback3; - HttpNetworkTransaction trans3(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans3(DEFAULT_PRIORITY, session.get()); rv = trans3.Start(&request, callback3.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8495,7 +8494,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AlternateProtocolWithSpdyLateBinding) { response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8504,7 +8503,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, AlternateProtocolWithSpdyLateBinding) { response = trans3.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8552,7 +8551,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, StallAlternateProtocolForNpnSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8560,14 +8559,14 @@ TEST_F(HttpNetworkTransactionSpdy2Test, StallAlternateProtocolForNpnSpdy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello world", response_data); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8575,7 +8574,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, StallAlternateProtocolForNpnSpdy) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); @@ -8702,7 +8701,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8710,7 +8709,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); @@ -8719,7 +8718,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello world", response_data); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8727,7 +8726,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8794,7 +8793,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8802,7 +8801,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8848,7 +8847,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, EXPECT_EQ(OK, spdy_session->InitializeWithSocket(ssl_connection.release(), true, OK)); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8856,7 +8855,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -9325,7 +9324,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MultiRoundAuth) { session_peer.SetClientSocketPoolManager(mock_pool_manager); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; const MockWrite kGet( @@ -9395,7 +9394,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MultiRoundAuth) { // It should not be able to grab the TCP socket that trans has already // claimed. scoped_ptr<HttpTransaction> trans_compete( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback_compete; rv = trans_compete->Start( &request, callback_compete.callback(), BoundNetLog()); @@ -9440,11 +9439,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MultiRoundAuth) { // Read the body since the fourth round was successful. This will also // release the socket back to the pool. scoped_refptr<IOBufferWithSize> io_buf(new IOBufferWithSize(50)); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(3, rv); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); EXPECT_EQ(0, rv); // There are still 0 idle sockets, since the trans_compete transaction // will be handed it immediately after trans releases it to the group. @@ -9454,11 +9453,11 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MultiRoundAuth) { // read the body. rv = callback_compete.WaitForResult(); EXPECT_EQ(OK, rv); - rv = trans_compete->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans_compete->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(3, rv); - rv = trans_compete->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans_compete->Read(io_buf.get(), io_buf->size(), callback.callback()); EXPECT_EQ(0, rv); // Finally, the socket is released to the group. @@ -9504,7 +9503,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NpnWithHttpOverSSL) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -9513,7 +9512,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, NpnWithHttpOverSSL) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -9558,7 +9557,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, SpdyPostNPNServerHangup) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9688,7 +9687,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, SpdyAlternateProtocolThroughProxy) { // First round should work and provide the Alternate-Protocol state. TestCompletionCallback callback_1; scoped_ptr<HttpTransaction> trans_1( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans_1->Start(&request, callback_1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback_1.WaitForResult()); @@ -9696,7 +9695,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, SpdyAlternateProtocolThroughProxy) { // Second round should attempt a tunnel connect and get an auth challenge. TestCompletionCallback callback_2; scoped_ptr<HttpTransaction> trans_2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans_2->Start(&request, callback_2.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback_2.WaitForResult()); @@ -9794,7 +9793,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ProxyGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9858,7 +9857,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ProxyTunnelGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9928,7 +9927,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ProxyTunnelGetHangup) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10005,7 +10004,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, PreconnectWithExistingSpdySession) { request.motivation = HttpRequestInfo::PRECONNECT_MOTIVATED; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10032,7 +10031,7 @@ void HttpNetworkTransactionSpdy2Test::CheckErrorIsPassedBack( scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request_info, callback.callback(), net::BoundNetLog()); @@ -10126,7 +10125,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Begin the SSL handshake with the peer. This consumes ssl_data1. TestCompletionCallback callback; @@ -10247,7 +10246,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Begin the initial SSL handshake. TestCompletionCallback callback; @@ -10340,7 +10339,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ClientAuthCertCache_Proxy_Fail) { session_deps_.socket_factory->ResetNextMockIndexes(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Begin the SSL handshake with the proxy. TestCompletionCallback callback; @@ -10441,7 +10440,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MAYBE_UseIPConnectionPooling) { request1.method = "GET"; request1.url = GURL("https://www.google.com/"); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10449,7 +10448,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MAYBE_UseIPConnectionPooling) { const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -10471,7 +10470,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MAYBE_UseIPConnectionPooling) { request2.method = "GET"; request2.url = GURL("https://www.gmail.com/"); request2.load_flags = 0; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10479,7 +10478,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, MAYBE_UseIPConnectionPooling) { response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -10537,7 +10536,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseIPConnectionPoolingAfterResolution) { request1.method = "GET"; request1.url = GURL("https://www.google.com/"); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10545,7 +10544,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseIPConnectionPoolingAfterResolution) { const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -10556,7 +10555,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseIPConnectionPoolingAfterResolution) { request2.method = "GET"; request2.url = GURL("https://www.gmail.com/"); request2.load_flags = 0; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10564,7 +10563,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseIPConnectionPoolingAfterResolution) { response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -10673,7 +10672,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, request1.method = "GET"; request1.url = GURL("https://www.google.com/"); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10681,7 +10680,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -10701,7 +10700,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, request2.method = "GET"; request2.url = GURL("https://www.gmail.com/"); request2.load_flags = 0; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10709,7 +10708,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -10822,7 +10821,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttp) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -10836,7 +10835,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttp) { request2.method = "GET"; request2.url = GURL(http_url); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -10915,7 +10914,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttpOverTunnel) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -10935,7 +10934,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionForHttpOverTunnel) { request2.method = "GET"; request2.url = GURL(http_url); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -10998,7 +10997,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseSpdySessionForHttpWhenForced) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -11012,7 +11011,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, UseSpdySessionForHttpWhenForced) { request2.method = "GET"; request2.url = GURL(http_url); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -11130,7 +11129,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionIfCertDoesNotMatch) { request1.method = "GET"; request1.url = GURL(url1); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; ASSERT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -11145,7 +11144,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, DoNotUseSpdySessionIfCertDoesNotMatch) { request2.method = "GET"; request2.url = GURL(url2); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -11211,7 +11210,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ErrorSocketNotConnected) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(MEDIUM, session); + HttpNetworkTransaction trans1(MEDIUM, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -11223,7 +11222,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, ErrorSocketNotConnected) { request2.method = "GET"; request2.url = GURL(https_url); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -11320,7 +11319,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { request1.url = GURL("https://www.a.com/"); request1.load_flags = 0; scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -11328,7 +11327,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -11349,7 +11348,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { request2.method = "GET"; request2.url = GURL("https://www.b.com/"); request2.load_flags = 0; - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -11357,7 +11356,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -11377,7 +11376,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { request3.method = "GET"; request3.url = GURL("http://www.a.com/"); request3.load_flags = 0; - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request3, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -11385,7 +11384,7 @@ TEST_F(HttpNetworkTransactionSpdy2Test, CloseIdleSpdySessionToOpenNewOne) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); diff --git a/net/http/http_network_transaction_spdy3_unittest.cc b/net/http/http_network_transaction_spdy3_unittest.cc index ac59b50..24b0b11 100644 --- a/net/http/http_network_transaction_spdy3_unittest.cc +++ b/net/http/http_network_transaction_spdy3_unittest.cc @@ -326,7 +326,7 @@ class HttpNetworkTransactionSpdy3Test : public PlatformTest { const HttpResponseInfo* response = trans->GetResponseInfo(); // Can't use ASSERT_* inside helper functions like this, so // return an error. - if (response == NULL || response->headers == NULL) { + if (response == NULL || response->headers.get() == NULL) { out.rv = ERR_UNEXPECTED; return out; } @@ -874,7 +874,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, TwoIdenticalLocationHeaders) { EXPECT_EQ(OK, callback.WaitForResult()); const HttpResponseInfo* response = trans->GetResponseInfo(); - ASSERT_TRUE(response != NULL && response->headers != NULL); + ASSERT_TRUE(response != NULL && response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 302 Redirect", response->headers->GetStatusLine()); std::string url; EXPECT_TRUE(response->headers->IsRedirect(&url)); @@ -938,7 +938,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, Head) { ASSERT_TRUE(response != NULL); // Check that the headers got parsed. - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ(1234, response->headers->GetContentLength()); EXPECT_EQ("HTTP/1.1 404 Not Found", response->headers->GetStatusLine()); @@ -981,7 +981,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ReuseConnection) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; @@ -994,7 +994,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ReuseConnection) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1039,7 +1039,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, Ignores100) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1081,7 +1081,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, Ignores1xx) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1204,7 +1204,7 @@ void HttpNetworkTransactionSpdy3Test::KeepAliveConnectionResendRequestTest( TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1225,7 +1225,7 @@ void HttpNetworkTransactionSpdy3Test::KeepAliveConnectionResendRequestTest( const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -1315,7 +1315,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveEarlyClose) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { MockRead("HTTP/1.0 200 OK\r\n"), @@ -1336,11 +1336,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveEarlyClose) { EXPECT_EQ(OK, rv); scoped_refptr<IOBufferWithSize> io_buf(new IOBufferWithSize(100)); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(5, rv); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); trans.reset(); @@ -1356,7 +1356,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveEarlyClose2) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { MockRead("HTTP/1.0 200 OK\r\n"), @@ -1376,7 +1376,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveEarlyClose2) { EXPECT_EQ(OK, rv); scoped_refptr<IOBufferWithSize> io_buf(new IOBufferWithSize(100)); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(ERR_CONTENT_LENGTH_MISMATCH, rv); @@ -1435,7 +1435,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveAfterUnreadBody) { TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1456,7 +1456,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveAfterUnreadBody) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); response_lines[i] = response->headers->GetStatusLine(); // We intentionally don't read the response bodies. @@ -1480,14 +1480,14 @@ TEST_F(HttpNetworkTransactionSpdy3Test, KeepAliveAfterUnreadBody) { TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); rv = callback.WaitForResult(); EXPECT_EQ(OK, rv); const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -1688,7 +1688,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthKeepAlive) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1777,7 +1777,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthKeepAliveNoBody) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1861,7 +1861,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthKeepAliveLargeBody) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -1947,7 +1947,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthKeepAliveImpatientServer) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2032,7 +2032,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthProxyNoKeepAlive) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2051,7 +2051,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthProxyNoKeepAlive) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); @@ -2106,7 +2106,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthProxyKeepAlive) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -2162,7 +2162,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthProxyKeepAlive) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_TRUE(response->headers->IsKeepAlive()); EXPECT_EQ(407, response->headers->response_code()); EXPECT_EQ(10, response->headers->GetContentLength()); @@ -2181,7 +2181,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthProxyKeepAlive) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_TRUE(response->headers->IsKeepAlive()); EXPECT_EQ(407, response->headers->response_code()); EXPECT_EQ(10, response->headers->GetContentLength()); @@ -2207,7 +2207,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthProxyCancelTunnel) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Since we have proxy, should try to establish tunnel. MockWrite data_writes[] = { @@ -2339,7 +2339,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2411,7 +2411,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingNoPacTwoRequests) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans1( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans1->Start(&request1, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2421,7 +2421,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingNoPacTwoRequests) { const HttpResponseInfo* response1 = trans1->GetResponseInfo(); ASSERT_TRUE(response1 != NULL); - ASSERT_TRUE(response1->headers != NULL); + ASSERT_TRUE(response1->headers.get() != NULL); EXPECT_EQ(1, response1->headers->GetContentLength()); LoadTimingInfo load_timing_info1; @@ -2432,7 +2432,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingNoPacTwoRequests) { TestCompletionCallback callback2; scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback2.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2442,7 +2442,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingNoPacTwoRequests) { const HttpResponseInfo* response2 = trans2->GetResponseInfo(); ASSERT_TRUE(response2 != NULL); - ASSERT_TRUE(response2->headers != NULL); + ASSERT_TRUE(response2->headers.get() != NULL); EXPECT_EQ(2, response2->headers->GetContentLength()); LoadTimingInfo load_timing_info2; @@ -2509,7 +2509,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingWithPacTwoRequests) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans1( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans1->Start(&request1, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2519,7 +2519,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingWithPacTwoRequests) { const HttpResponseInfo* response1 = trans1->GetResponseInfo(); ASSERT_TRUE(response1 != NULL); - ASSERT_TRUE(response1->headers != NULL); + ASSERT_TRUE(response1->headers.get() != NULL); EXPECT_EQ(1, response1->headers->GetContentLength()); LoadTimingInfo load_timing_info1; @@ -2531,7 +2531,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingWithPacTwoRequests) { TestCompletionCallback callback2; scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback2.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2541,7 +2541,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpProxyLoadTimingWithPacTwoRequests) { const HttpResponseInfo* response2 = trans2->GetResponseInfo(); ASSERT_TRUE(response2 != NULL); - ASSERT_TRUE(response2->headers != NULL); + ASSERT_TRUE(response2->headers.get() != NULL); EXPECT_EQ(2, response2->headers->GetContentLength()); LoadTimingInfo load_timing_info2; @@ -2590,7 +2590,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxyGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2655,7 +2655,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2670,7 +2670,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGet) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -2743,7 +2743,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGetWithProxyAuth) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -2754,7 +2754,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGetWithProxyAuth) { const HttpResponseInfo* const response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); @@ -2771,7 +2771,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyGetWithProxyAuth) { const HttpResponseInfo* const response_restart = trans->GetResponseInfo(); ASSERT_TRUE(response_restart != NULL); - ASSERT_TRUE(response_restart->headers != NULL); + ASSERT_TRUE(response_restart->headers.get() != NULL); EXPECT_EQ(200, response_restart->headers->response_code()); // The password prompt info should not be set. EXPECT_TRUE(response_restart->auth_challenge.get() == NULL); @@ -2792,7 +2792,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectHttps) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1)); @@ -2854,7 +2854,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectHttps) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -2877,7 +2877,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1)); @@ -2938,7 +2938,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectSpdy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -2961,7 +2961,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxySpdyConnectFailure) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // CONNECT to www.google.com:443 via SPDY scoped_ptr<SpdyFrame> connect(spdy_util_.ConstructSpdyConnect(NULL, 0, 1)); @@ -3113,7 +3113,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first connect and request, each of their responses, and the body. @@ -3128,15 +3128,15 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - EXPECT_EQ(1, trans->Read(buf, 256, callback.callback())); + EXPECT_EQ(1, trans->Read(buf.get(), 256, callback.callback())); scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3155,7 +3155,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, // separate stream. EXPECT_NE(load_timing_info.socket_log_id, load_timing_info2.socket_log_id); - EXPECT_EQ(2, trans2->Read(buf, 256, callback.callback())); + EXPECT_EQ(2, trans2->Read(buf.get(), 256, callback.callback())); } // Test load timing in the case of two HTTPS (non-SPDY) requests through a SPDY @@ -3242,7 +3242,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); // The first connect and request, each of their responses, and the body. @@ -3257,17 +3257,17 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - EXPECT_EQ(1, trans->Read(buf, 256, callback.callback())); + EXPECT_EQ(1, trans->Read(buf.get(), 256, callback.callback())); // Delete the first request, so the second one can reuse the socket. trans.reset(); scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3284,7 +3284,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, // The requests should have the same ID. EXPECT_EQ(load_timing_info.socket_log_id, load_timing_info2.socket_log_id); - EXPECT_EQ(2, trans2->Read(buf, 256, callback.callback())); + EXPECT_EQ(2, trans2->Read(buf.get(), 256, callback.callback())); } // Test load timing in the case of of two HTTP requests through a SPDY HTTPS @@ -3348,7 +3348,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); spdy_data.RunFor(2); @@ -3363,19 +3363,19 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - EXPECT_EQ(ERR_IO_PENDING, trans->Read(buf, 256, callback.callback())); + EXPECT_EQ(ERR_IO_PENDING, trans->Read(buf.get(), 256, callback.callback())); spdy_data.RunFor(1); EXPECT_EQ(1, callback.WaitForResult()); // Delete the first request, so the second one can reuse the socket. trans.reset(); scoped_ptr<HttpTransaction> trans2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans2->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3390,7 +3390,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, // The requests should have the same ID. EXPECT_EQ(load_timing_info.socket_log_id, load_timing_info2.socket_log_id); - EXPECT_EQ(ERR_IO_PENDING, trans2->Read(buf, 256, callback.callback())); + EXPECT_EQ(ERR_IO_PENDING, trans2->Read(buf.get(), 256, callback.callback())); spdy_data.RunFor(1); EXPECT_EQ(2, callback.WaitForResult()); } @@ -3448,7 +3448,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxyAuthRetry) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3463,7 +3463,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HttpsProxyAuthRetry) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(CheckBasicProxyAuth(response->auth_challenge.get())); @@ -3527,7 +3527,7 @@ void HttpNetworkTransactionSpdy3Test::ConnectStatusHelperWithExpectedStatus( TestCompletionCallback callback; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -3923,7 +3923,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NTLMAuth1) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4103,7 +4103,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NTLMAuth2) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -4220,7 +4220,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Since we have proxy, should try to establish tunnel. MockWrite data_writes1[] = { @@ -4259,11 +4259,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, // We now check to make sure the TCPClientSocket was not added back to // the pool. - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); trans.reset(); base::MessageLoop::current()->RunUntilIdle(); // Make sure that the socket didn't get recycled after calling the destructor. - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); } // Make sure that we recycle a socket after reading all of the response body. @@ -4276,7 +4276,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocket) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { // A part of the response body is received with the response headers. @@ -4302,11 +4302,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocket) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); std::string status_line = response->headers->GetStatusLine(); EXPECT_EQ("HTTP/1.1 200 OK", status_line); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4318,7 +4318,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session.get())); } // Make sure that we recycle a SSL socket after reading all of the response @@ -4353,7 +4353,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSSLSocket) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -4362,10 +4362,10 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSSLSocket) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4377,7 +4377,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSSLSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); } // Grab a SSL socket, use it, and put it back into the pool. Then, reuse it @@ -4421,7 +4421,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -4430,10 +4430,10 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4445,11 +4445,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); // Now start the second transaction, which should reuse the previous socket. - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -4458,10 +4458,10 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); rv = ReadTransaction(trans.get(), &response_data); EXPECT_EQ(OK, rv); @@ -4472,7 +4472,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleDeadSSLSocket) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInSSLSocketPool(session.get())); } // Make sure that we recycle a socket after a zero-length response. @@ -4489,7 +4489,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocketAfterZeroContentLength) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockRead data_reads[] = { MockRead("HTTP/1.1 204 No Content\r\n" @@ -4513,11 +4513,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocketAfterZeroContentLength) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); std::string status_line = response->headers->GetStatusLine(); EXPECT_EQ("HTTP/1.1 204 No Content", status_line); - EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(0, GetIdleSocketCountInTransportSocketPool(session.get())); std::string response_data; rv = ReadTransaction(trans.get(), &response_data); @@ -4529,7 +4529,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, RecycleSocketAfterZeroContentLength) { base::MessageLoop::current()->RunUntilIdle(); // We now check to make sure the socket was added back to the pool. - EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session)); + EXPECT_EQ(1, GetIdleSocketCountInTransportSocketPool(session.get())); } TEST_F(HttpNetworkTransactionSpdy3Test, ResendRequestOnWriteBodyError) { @@ -4598,7 +4598,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ResendRequestOnWriteBodyError) { for (int i = 0; i < 2; ++i) { scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; @@ -4611,7 +4611,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ResendRequestOnWriteBodyError) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -4821,7 +4821,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/z HTTP/1.1\r\n" @@ -4897,7 +4897,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/a/b HTTP/1.1\r\n" @@ -4981,7 +4981,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/z2 HTTP/1.1\r\n" @@ -5029,7 +5029,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/1 HTTP/1.1\r\n" @@ -5099,7 +5099,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthCacheAndPreauth) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /p/q/t HTTP/1.1\r\n" @@ -5211,7 +5211,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DigestPreAuthNonceCount) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/z HTTP/1.1\r\n" @@ -5290,7 +5290,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DigestPreAuthNonceCount) { request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); MockWrite data_writes1[] = { MockWrite("GET /x/y/a/b HTTP/1.1\r\n" @@ -5353,7 +5353,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ResetStateForRestart) { scoped_refptr<HttpResponseHeaders> headers(new HttpResponseHeaders(temp)); request.extra_headers.SetHeader("Foo", "1"); request.extra_headers.SetHeader("bar", "23"); - EXPECT_TRUE(response->vary_data.Init(request, *headers)); + EXPECT_TRUE(response->vary_data.Init(request, *headers.get())); } // Cause the above state to be reset. @@ -5903,7 +5903,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthSpdyProxy) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -5922,7 +5922,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, BasicAuthSpdyProxy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_FALSE(response->headers == NULL); + ASSERT_FALSE(response->headers.get() == NULL); EXPECT_EQ(407, response->headers->response_code()); EXPECT_TRUE(HttpVersion(1, 1) == response->headers->GetHttpVersion()); EXPECT_TRUE(response->auth_challenge.get() != NULL); @@ -6024,7 +6024,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CrossOriginProxyPush) { session_deps_.socket_factory->AddSSLSocketDataProvider(&proxy); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6034,7 +6034,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CrossOriginProxyPush) { const HttpResponseInfo* response = trans->GetResponseInfo(); scoped_ptr<HttpTransaction> push_trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = push_trans->Start(&push_request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6059,7 +6059,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CrossOriginProxyPush) { CONNECT_TIMING_HAS_CONNECT_TIMES_ONLY); // Verify the pushed stream. - EXPECT_TRUE(push_response->headers != NULL); + EXPECT_TRUE(push_response->headers.get() != NULL); EXPECT_EQ(200, push_response->headers->response_code()); rv = ReadTransaction(push_trans.get(), &response_data); @@ -6138,7 +6138,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CrossOriginProxyPushCorrectness) { session_deps_.socket_factory->AddSSLSocketDataProvider(&proxy); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -6998,7 +6998,7 @@ int GroupNameTransactionHelper( request.load_flags = 0; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; @@ -7200,7 +7200,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, GroupNameForSOCKSConnections) { peer.SetClientSocketPoolManager(mock_pool_manager); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); EXPECT_EQ(ERR_IO_PENDING, GroupNameTransactionHelper(tests[i].url, session)); @@ -7368,7 +7368,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ConnectionClosedAfterStartOfHeaders) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -7430,7 +7430,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DrainResetOK) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7520,7 +7520,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, LargeContentLengthThenClose) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -7570,7 +7570,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UploadFileSmallerThanLength) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -7632,7 +7632,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UploadUnreadableFile) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.0 200 OK", response->headers->GetStatusLine()); file_util::Delete(temp_file, false); @@ -7701,7 +7701,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UnreadableUploadFileAfterAuthRestart) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 401 Unauthorized", response->headers->GetStatusLine()); EXPECT_TRUE(CheckBasicServerAuth(response->auth_challenge.get())); @@ -7719,7 +7719,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UnreadableUploadFileAfterAuthRestart) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - EXPECT_TRUE(response->headers != NULL); + EXPECT_TRUE(response->headers.get() != NULL); EXPECT_TRUE(response->auth_challenge.get() == NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); @@ -7904,7 +7904,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HonorAlternateProtocolHeader) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -7919,7 +7919,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, HonorAlternateProtocolHeader) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); @@ -7974,7 +7974,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -7983,7 +7983,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8036,7 +8036,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8086,7 +8086,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; EXPECT_EQ(ERR_IO_PENDING, trans->Start( @@ -8133,7 +8133,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8181,7 +8181,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8229,7 +8229,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start( @@ -8272,7 +8272,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolUnsafeBlocked) { NPN_SPDY_3); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -8285,7 +8285,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolUnsafeBlocked) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8348,7 +8348,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseAlternateProtocolForNpnSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8356,14 +8356,14 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseAlternateProtocolForNpnSpdy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello world", response_data); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8371,7 +8371,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseAlternateProtocolForNpnSpdy) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8447,7 +8447,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolWithSpdyLateBinding) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); TestCompletionCallback callback1; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request, callback1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8455,7 +8455,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolWithSpdyLateBinding) { const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8463,12 +8463,12 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolWithSpdyLateBinding) { EXPECT_EQ("hello world", response_data); TestCompletionCallback callback2; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request, callback2.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); TestCompletionCallback callback3; - HttpNetworkTransaction trans3(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans3(DEFAULT_PRIORITY, session.get()); rv = trans3.Start(&request, callback3.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8477,7 +8477,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolWithSpdyLateBinding) { response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8486,7 +8486,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, AlternateProtocolWithSpdyLateBinding) { response = trans3.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8534,7 +8534,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, StallAlternateProtocolForNpnSpdy) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8542,14 +8542,14 @@ TEST_F(HttpNetworkTransactionSpdy3Test, StallAlternateProtocolForNpnSpdy) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello world", response_data); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8557,7 +8557,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, StallAlternateProtocolForNpnSpdy) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); @@ -8684,7 +8684,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8692,7 +8692,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); @@ -8701,7 +8701,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); EXPECT_EQ("hello world", response_data); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8709,7 +8709,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -8776,7 +8776,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8784,7 +8784,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -8830,7 +8830,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, EXPECT_EQ(OK, spdy_session->InitializeWithSocket(ssl_connection.release(), true, OK)); - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -8838,7 +8838,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -9307,7 +9307,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, MultiRoundAuth) { session_peer.SetClientSocketPoolManager(mock_pool_manager); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; const MockWrite kGet( @@ -9377,7 +9377,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, MultiRoundAuth) { // It should not be able to grab the TCP socket that trans has already // claimed. scoped_ptr<HttpTransaction> trans_compete( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback_compete; rv = trans_compete->Start( &request, callback_compete.callback(), BoundNetLog()); @@ -9422,11 +9422,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, MultiRoundAuth) { // Read the body since the fourth round was successful. This will also // release the socket back to the pool. scoped_refptr<IOBufferWithSize> io_buf(new IOBufferWithSize(50)); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(3, rv); - rv = trans->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans->Read(io_buf.get(), io_buf->size(), callback.callback()); EXPECT_EQ(0, rv); // There are still 0 idle sockets, since the trans_compete transaction // will be handed it immediately after trans releases it to the group. @@ -9436,11 +9436,11 @@ TEST_F(HttpNetworkTransactionSpdy3Test, MultiRoundAuth) { // read the body. rv = callback_compete.WaitForResult(); EXPECT_EQ(OK, rv); - rv = trans_compete->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans_compete->Read(io_buf.get(), io_buf->size(), callback.callback()); if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); EXPECT_EQ(3, rv); - rv = trans_compete->Read(io_buf, io_buf->size(), callback.callback()); + rv = trans_compete->Read(io_buf.get(), io_buf->size(), callback.callback()); EXPECT_EQ(0, rv); // Finally, the socket is released to the group. @@ -9486,7 +9486,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NpnWithHttpOverSSL) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); @@ -9495,7 +9495,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, NpnWithHttpOverSSL) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -9540,7 +9540,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SpdyPostNPNServerHangup) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9671,7 +9671,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SpdyAlternateProtocolThroughProxy) { // First round should work and provide the Alternate-Protocol state. TestCompletionCallback callback_1; scoped_ptr<HttpTransaction> trans_1( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans_1->Start(&request, callback_1.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback_1.WaitForResult()); @@ -9679,7 +9679,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, SpdyAlternateProtocolThroughProxy) { // Second round should attempt a tunnel connect and get an auth challenge. TestCompletionCallback callback_2; scoped_ptr<HttpTransaction> trans_2( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans_2->Start(&request, callback_2.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); EXPECT_EQ(OK, callback_2.WaitForResult()); @@ -9777,7 +9777,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ProxyGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9841,7 +9841,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ProxyTunnelGet) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9911,7 +9911,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ProxyTunnelGetHangup) { TestCompletionCallback callback1; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback1.callback(), log.bound()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -9988,7 +9988,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, PreconnectWithExistingSpdySession) { request.motivation = HttpRequestInfo::PRECONNECT_MOTIVATED; scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10016,7 +10016,7 @@ void HttpNetworkTransactionSpdy3Test::CheckErrorIsPassedBack( scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); TestCompletionCallback callback; int rv = trans->Start(&request_info, callback.callback(), net::BoundNetLog()); @@ -10111,7 +10111,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Begin the SSL handshake with the peer. This consumes ssl_data1. TestCompletionCallback callback; @@ -10232,7 +10232,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ClientAuthCertCache_Direct_FalseStart) { scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Begin the initial SSL handshake. TestCompletionCallback callback; @@ -10326,7 +10326,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ClientAuthCertCache_Proxy_Fail) { session_deps_.socket_factory->ResetNextMockIndexes(); scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_)); scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); // Begin the SSL handshake with the proxy. TestCompletionCallback callback; @@ -10421,7 +10421,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { request1.method = "GET"; request1.url = GURL("https://www.google.com/"); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10429,7 +10429,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -10451,7 +10451,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { request2.method = "GET"; request2.url = GURL("https://www.gmail.com/"); request2.load_flags = 0; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10459,7 +10459,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPooling) { response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -10516,7 +10516,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPoolingAfterResolution) { request1.method = "GET"; request1.url = GURL("https://www.google.com/"); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10524,7 +10524,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPoolingAfterResolution) { const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -10535,7 +10535,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPoolingAfterResolution) { request2.method = "GET"; request2.url = GURL("https://www.gmail.com/"); request2.load_flags = 0; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10543,7 +10543,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseIPConnectionPoolingAfterResolution) { response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -10644,7 +10644,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, request1.method = "GET"; request1.url = GURL("https://www.google.com/"); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); int rv = trans1.Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10652,7 +10652,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, const HttpResponseInfo* response = trans1.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); std::string response_data; @@ -10672,7 +10672,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, request2.method = "GET"; request2.url = GURL("https://www.gmail.com/"); request2.load_flags = 0; - HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, session.get()); rv = trans2.Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -10680,7 +10680,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, response = trans2.GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -10792,7 +10792,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttp) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -10806,7 +10806,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttp) { request2.method = "GET"; request2.url = GURL(httpUrl); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -10877,7 +10877,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttpOverTunnel) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -10897,7 +10897,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionForHttpOverTunnel) { request2.method = "GET"; request2.url = GURL(httpUrl); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -10959,7 +10959,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseSpdySessionForHttpWhenForced) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(LOWEST, session); + HttpNetworkTransaction trans1(LOWEST, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -10973,7 +10973,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, UseSpdySessionForHttpWhenForced) { request2.method = "GET"; request2.url = GURL(http_url); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -11082,7 +11082,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionIfCertDoesNotMatch) { request1.method = "GET"; request1.url = GURL(url1); request1.load_flags = 0; - HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session); + HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get()); TestCompletionCallback callback1; ASSERT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -11097,7 +11097,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, DoNotUseSpdySessionIfCertDoesNotMatch) { request2.method = "GET"; request2.url = GURL(url2); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -11163,7 +11163,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ErrorSocketNotConnected) { request1.method = "GET"; request1.url = GURL(https_url); request1.load_flags = 0; - HttpNetworkTransaction trans1(MEDIUM, session); + HttpNetworkTransaction trans1(MEDIUM, session.get()); TestCompletionCallback callback1; EXPECT_EQ(ERR_IO_PENDING, trans1.Start(&request1, callback1.callback(), BoundNetLog())); @@ -11175,7 +11175,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, ErrorSocketNotConnected) { request2.method = "GET"; request2.url = GURL(https_url); request2.load_flags = 0; - HttpNetworkTransaction trans2(MEDIUM, session); + HttpNetworkTransaction trans2(MEDIUM, session.get()); TestCompletionCallback callback2; EXPECT_EQ(ERR_IO_PENDING, trans2.Start(&request2, callback2.callback(), BoundNetLog())); @@ -11272,7 +11272,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { request1.url = GURL("https://www.a.com/"); request1.load_flags = 0; scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); int rv = trans->Start(&request1, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -11280,7 +11280,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { const HttpResponseInfo* response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -11301,7 +11301,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { request2.method = "GET"; request2.url = GURL("https://www.b.com/"); request2.load_flags = 0; - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request2, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -11309,7 +11309,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_TRUE(response->was_fetched_via_spdy); EXPECT_TRUE(response->was_npn_negotiated); @@ -11329,7 +11329,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { request3.method = "GET"; request3.url = GURL("http://www.a.com/"); request3.load_flags = 0; - trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); rv = trans->Start(&request3, callback.callback(), BoundNetLog()); EXPECT_EQ(ERR_IO_PENDING, rv); @@ -11337,7 +11337,7 @@ TEST_F(HttpNetworkTransactionSpdy3Test, CloseIdleSpdySessionToOpenNewOne) { response = trans->GetResponseInfo(); ASSERT_TRUE(response != NULL); - ASSERT_TRUE(response->headers != NULL); + ASSERT_TRUE(response->headers.get() != NULL); EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); EXPECT_FALSE(response->was_fetched_via_spdy); EXPECT_FALSE(response->was_npn_negotiated); diff --git a/net/http/http_network_transaction_ssl_unittest.cc b/net/http/http_network_transaction_ssl_unittest.cc index ba5d3f5..6b3c3c7 100644 --- a/net/http/http_network_transaction_ssl_unittest.cc +++ b/net/http/http_network_transaction_ssl_unittest.cc @@ -129,7 +129,7 @@ TEST_F(HttpNetworkTransactionSSLTest, SSL3FallbackDisabled_Google) { scoped_refptr<HttpNetworkSession> session( new HttpNetworkSession(session_params_)); scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); ssl_config.unrestricted_ssl3_fallback_enabled = false; @@ -175,7 +175,7 @@ TEST_F(HttpNetworkTransactionSSLTest, SSL3FallbackEnabled_Google) { scoped_refptr<HttpNetworkSession> session( new HttpNetworkSession(session_params_)); scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); ssl_config.unrestricted_ssl3_fallback_enabled = true; @@ -222,7 +222,7 @@ TEST_F(HttpNetworkTransactionSSLTest, SSL3FallbackDisabled_Paypal) { scoped_refptr<HttpNetworkSession> session( new HttpNetworkSession(session_params_)); scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); ssl_config.unrestricted_ssl3_fallback_enabled = false; @@ -275,7 +275,7 @@ TEST_F(HttpNetworkTransactionSSLTest, SSLFallback) { scoped_refptr<HttpNetworkSession> session( new HttpNetworkSession(session_params_)); scoped_ptr<HttpNetworkTransaction> trans( - new HttpNetworkTransaction(DEFAULT_PRIORITY, session)); + new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); SSLConfig& ssl_config = GetServerSSLConfig(trans.get()); ssl_config.unrestricted_ssl3_fallback_enabled = true; diff --git a/net/http/http_pipelined_connection_impl.cc b/net/http/http_pipelined_connection_impl.cc index c5ca00c..471b26adef 100644 --- a/net/http/http_pipelined_connection_impl.cc +++ b/net/http/http_pipelined_connection_impl.cc @@ -680,7 +680,7 @@ void HttpPipelinedConnectionImpl::GetSSLCertRequestInfo( void HttpPipelinedConnectionImpl::Drain(HttpPipelinedStream* stream, HttpNetworkSession* session) { - HttpResponseHeaders* headers = stream->GetResponseInfo()->headers; + HttpResponseHeaders* headers = stream->GetResponseInfo()->headers.get(); if (!stream->CanFindEndOfResponse() || headers->IsChunkEncoded() || !usable_) { // TODO(simonjam): Drain chunk-encoded responses if they're relatively diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index 6c642a6..fc9c2b3 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc @@ -95,7 +95,7 @@ NextProto HttpProxyClientSocket::GetProtocolNegotiated() const { } const HttpResponseInfo* HttpProxyClientSocket::GetConnectResponseInfo() const { - return response_.headers ? &response_ : NULL; + return response_.headers.get() ? &response_ : NULL; } HttpStream* HttpProxyClientSocket::CreateConnectResponseStream() { @@ -414,8 +414,8 @@ int HttpProxyClientSocket::DoSendRequest() { } parser_buf_ = new GrowableIOBuffer(); - http_stream_parser_.reset( - new HttpStreamParser(transport_.get(), &request_, parser_buf_, net_log_)); + http_stream_parser_.reset(new HttpStreamParser( + transport_.get(), &request_, parser_buf_.get(), net_log_)); return http_stream_parser_->SendRequest( request_line_, request_headers_, &response_, io_callback_); } @@ -478,7 +478,7 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) { // authentication code is smart enough to avoid being tricked by an // active network attacker. // The next state is intentionally not set as it should be STATE_NONE; - return HandleProxyAuthChallenge(auth_, &response_, net_log_); + return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_); default: // Ignore response to avoid letting the proxy impersonate the target @@ -493,11 +493,11 @@ int HttpProxyClientSocket::DoReadHeadersComplete(int result) { } int HttpProxyClientSocket::DoDrainBody() { - DCHECK(drain_buf_); + DCHECK(drain_buf_.get()); DCHECK(transport_->is_initialized()); next_state_ = STATE_DRAIN_BODY_COMPLETE; - return http_stream_parser_->ReadResponseBody(drain_buf_, kDrainBodyBufferSize, - io_callback_); + return http_stream_parser_->ReadResponseBody( + drain_buf_.get(), kDrainBodyBufferSize, io_callback_); } int HttpProxyClientSocket::DoDrainBodyComplete(int result) { diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc index 3b99de7..cfff600 100644 --- a/net/http/http_proxy_client_socket_pool.cc +++ b/net/http/http_proxy_client_socket_pool.cc @@ -47,9 +47,9 @@ HttpProxySocketParams::HttpProxySocketParams( http_auth_cache_(tunnel ? http_auth_cache : NULL), http_auth_handler_factory_(tunnel ? http_auth_handler_factory : NULL), tunnel_(tunnel) { - DCHECK((transport_params == NULL && ssl_params != NULL) || - (transport_params != NULL && ssl_params == NULL)); - if (transport_params_) { + DCHECK((transport_params.get() == NULL && ssl_params.get() != NULL) || + (transport_params.get() != NULL && ssl_params.get() == NULL)); + if (transport_params_.get()) { ignore_limits_ = transport_params->ignore_limits(); } else { ignore_limits_ = ssl_params->ignore_limits(); @@ -57,7 +57,7 @@ HttpProxySocketParams::HttpProxySocketParams( } const HostResolver::RequestInfo& HttpProxySocketParams::destination() const { - if (transport_params_ == NULL) { + if (transport_params_.get() == NULL) { return ssl_params_->transport_params()->destination(); } else { return transport_params_->destination(); @@ -118,7 +118,7 @@ LoadState HttpProxyConnectJob::GetLoadState() const { } void HttpProxyConnectJob::GetAdditionalErrorState(ClientSocketHandle * handle) { - if (error_response_info_.cert_request_info) { + if (error_response_info_.cert_request_info.get()) { handle->set_ssl_error_response_info(error_response_info_); handle->set_is_ssl_error(true); } @@ -282,7 +282,7 @@ int HttpProxyConnectJob::DoHttpProxyConnect() { params_->tunnel(), using_spdy_, protocol_negotiated_, - params_->ssl_params() != NULL)); + params_->ssl_params().get() != NULL)); return transport_socket_->Connect(callback_); } @@ -347,7 +347,7 @@ int HttpProxyConnectJob::DoSpdyProxyCreateStreamComplete(int result) { } int HttpProxyConnectJob::ConnectInternal() { - if (params_->transport_params()) { + if (params_->transport_params().get()) { next_state_ = STATE_TCP_CONNECT; } else { next_state_ = STATE_SSL_CONNECT; diff --git a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc index 50b6bf6..ea23e48 100644 --- a/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy2_unittest.cc @@ -603,7 +603,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy2Test, TunnelSetupRedirect) { const ProxyClientSocket* tunnel_socket = static_cast<ProxyClientSocket*>(handle_.socket()); const HttpResponseInfo* response = tunnel_socket->GetConnectResponseInfo(); - const HttpResponseHeaders* headers = response->headers; + const HttpResponseHeaders* headers = response->headers.get(); // Make sure Set-Cookie header was stripped. EXPECT_FALSE(headers->HasHeader("set-cookie")); diff --git a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc index a612b9d..c1086d5 100644 --- a/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_spdy3_unittest.cc @@ -604,7 +604,7 @@ TEST_P(HttpProxyClientSocketPoolSpdy3Test, TunnelSetupRedirect) { const ProxyClientSocket* tunnel_socket = static_cast<ProxyClientSocket*>(handle_.socket()); const HttpResponseInfo* response = tunnel_socket->GetConnectResponseInfo(); - const HttpResponseHeaders* headers = response->headers; + const HttpResponseHeaders* headers = response->headers.get(); // Make sure Set-Cookie header was stripped. EXPECT_FALSE(headers->HasHeader("set-cookie")); diff --git a/net/http/http_response_body_drainer.cc b/net/http/http_response_body_drainer.cc index a6c9686..d8f0085 100644 --- a/net/http/http_response_body_drainer.cc +++ b/net/http/http_response_body_drainer.cc @@ -87,7 +87,8 @@ int HttpResponseBodyDrainer::DoDrainResponseBody() { next_state_ = STATE_DRAIN_RESPONSE_BODY_COMPLETE; return stream_->ReadResponseBody( - read_buf_, read_size_ - total_read_, + read_buf_.get(), + read_size_ - total_read_, base::Bind(&HttpResponseBodyDrainer::OnIOComplete, base::Unretained(this))); } diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 188cffa..6fcb3f4 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc @@ -197,7 +197,7 @@ int MockHttpStream::ReadResponseBodyImpl(IOBuffer* buf, int buf_len) { } void MockHttpStream::CompleteRead() { - int result = ReadResponseBodyImpl(user_buf_, buf_len_); + int result = ReadResponseBodyImpl(user_buf_.get(), buf_len_); user_buf_ = NULL; CompletionCallback callback = callback_; callback_.Reset(); @@ -219,7 +219,7 @@ class HttpResponseBodyDrainerTest : public testing::Test { HttpNetworkSession* CreateNetworkSession() const { HttpNetworkSession::Params params; params.proxy_service = proxy_service_.get(); - params.ssl_config_service = ssl_config_service_; + params.ssl_config_service = ssl_config_service_.get(); params.http_server_properties = http_server_properties_.get(); return new HttpNetworkSession(params); } @@ -236,20 +236,20 @@ class HttpResponseBodyDrainerTest : public testing::Test { TEST_F(HttpResponseBodyDrainerTest, DrainBodySyncSingleOK) { mock_stream_->set_num_chunks(1); mock_stream_->set_sync(); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_FALSE(result_waiter_.WaitForResult()); } TEST_F(HttpResponseBodyDrainerTest, DrainBodySyncOK) { mock_stream_->set_num_chunks(3); mock_stream_->set_sync(); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_FALSE(result_waiter_.WaitForResult()); } TEST_F(HttpResponseBodyDrainerTest, DrainBodyAsyncOK) { mock_stream_->set_num_chunks(3); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_FALSE(result_waiter_.WaitForResult()); } @@ -259,7 +259,7 @@ TEST_F(HttpResponseBodyDrainerTest, DrainBodyAsyncOK) { TEST_F(HttpResponseBodyDrainerTest, DrainBodyAsyncEmptyChunk) { mock_stream_->set_num_chunks(4); mock_stream_->set_is_last_chunk_zero_size(); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_FALSE(result_waiter_.WaitForResult()); } @@ -267,28 +267,28 @@ TEST_F(HttpResponseBodyDrainerTest, DrainBodySyncEmptyChunk) { mock_stream_->set_num_chunks(4); mock_stream_->set_sync(); mock_stream_->set_is_last_chunk_zero_size(); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_FALSE(result_waiter_.WaitForResult()); } TEST_F(HttpResponseBodyDrainerTest, DrainBodySizeEqualsDrainBuffer) { mock_stream_->set_num_chunks( HttpResponseBodyDrainer::kDrainBodyBufferSize / kMagicChunkSize); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_FALSE(result_waiter_.WaitForResult()); } TEST_F(HttpResponseBodyDrainerTest, DrainBodyTimeOut) { mock_stream_->set_num_chunks(2); mock_stream_->set_stall_reads_forever(); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_TRUE(result_waiter_.WaitForResult()); } TEST_F(HttpResponseBodyDrainerTest, CancelledBySession) { mock_stream_->set_num_chunks(2); mock_stream_->set_stall_reads_forever(); - drainer_->Start(session_); + drainer_->Start(session_.get()); // HttpNetworkSession should delete |drainer_|. } @@ -298,7 +298,7 @@ TEST_F(HttpResponseBodyDrainerTest, DrainBodyTooLarge) { too_many_chunks += 1; // Now it's too large. mock_stream_->set_num_chunks(too_many_chunks); - drainer_->Start(session_); + drainer_->Start(session_.get()); EXPECT_TRUE(result_waiter_.WaitForResult()); } @@ -308,13 +308,13 @@ TEST_F(HttpResponseBodyDrainerTest, StartBodyTooLarge) { too_many_chunks += 1; // Now it's too large. mock_stream_->set_num_chunks(0); - drainer_->StartWithSize(session_, too_many_chunks * kMagicChunkSize); + drainer_->StartWithSize(session_.get(), too_many_chunks * kMagicChunkSize); EXPECT_TRUE(result_waiter_.WaitForResult()); } TEST_F(HttpResponseBodyDrainerTest, StartWithNothingToDo) { mock_stream_->set_num_chunks(0); - drainer_->StartWithSize(session_, 0); + drainer_->StartWithSize(session_.get(), 0); EXPECT_FALSE(result_waiter_.WaitForResult()); } diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc index fde98b5..ee489c4 100644 --- a/net/http/http_response_headers_unittest.cc +++ b/net/http/http_response_headers_unittest.cc @@ -969,7 +969,7 @@ TEST(HttpResponseHeadersTest, Update) { scoped_refptr<net::HttpResponseHeaders> new_parsed( new net::HttpResponseHeaders(new_headers)); - parsed->Update(*new_parsed); + parsed->Update(*new_parsed.get()); std::string resulting_headers; parsed->GetNormalizedHeaders(&resulting_headers); diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc index 57825e6..dc6fd1e 100644 --- a/net/http/http_response_info.cc +++ b/net/http/http_response_info.cc @@ -183,7 +183,7 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, if (flags & RESPONSE_INFO_HAS_CERT) { X509Certificate::PickleType type = GetPickleTypeForVersion(version); ssl_info.cert = X509Certificate::CreateFromPickle(pickle, &iter, type); - if (!ssl_info.cert) + if (!ssl_info.cert.get()) return false; } if (flags & RESPONSE_INFO_HAS_CERT_STATUS) { diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc index d86c690..47110df 100644 --- a/net/http/http_stream_factory_impl.cc +++ b/net/http/http_stream_factory_impl.cc @@ -240,8 +240,11 @@ void HttpStreamFactoryImpl::OnSpdySessionReady( using_spdy, net_log); bool use_relative_url = direct || request->url().SchemeIs("https"); - request->OnStreamReady(NULL, used_ssl_config, used_proxy_info, - new SpdyHttpStream(spdy_session, use_relative_url)); + request->OnStreamReady( + NULL, + used_ssl_config, + used_proxy_info, + new SpdyHttpStream(spdy_session.get(), use_relative_url)); } // TODO(mbelshe): Alert other valid requests. } diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 34eb217..a80cc0d 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc @@ -298,7 +298,7 @@ void HttpStreamFactoryImpl::Job::OnSpdySessionReadyCallback() { DCHECK(!stream_.get()); DCHECK(!IsPreconnecting()); DCHECK(using_spdy()); - DCHECK(new_spdy_session_); + DCHECK(new_spdy_session_.get()); scoped_refptr<SpdySession> spdy_session = new_spdy_session_; new_spdy_session_ = NULL; if (IsOrphaned()) { @@ -367,11 +367,15 @@ void HttpStreamFactoryImpl::Job::OnHttpsProxyTunnelResponseCallback( void HttpStreamFactoryImpl::Job::OnPreconnectsComplete() { DCHECK(!request_); - if (new_spdy_session_) { - stream_factory_->OnSpdySessionReady( - new_spdy_session_, spdy_session_direct_, server_ssl_config_, - proxy_info_, was_npn_negotiated(), protocol_negotiated(), using_spdy(), - net_log_); + if (new_spdy_session_.get()) { + stream_factory_->OnSpdySessionReady(new_spdy_session_, + spdy_session_direct_, + server_ssl_config_, + proxy_info_, + was_npn_negotiated(), + protocol_negotiated(), + using_spdy(), + net_log_); } stream_factory_->OnPreconnectsComplete(this); // |this| may be deleted after this call. @@ -480,12 +484,11 @@ int HttpStreamFactoryImpl::Job::RunLoop(int result) { case OK: next_state_ = STATE_DONE; - if (new_spdy_session_) { + if (new_spdy_session_.get()) { base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind( - &HttpStreamFactoryImpl::Job::OnSpdySessionReadyCallback, - ptr_factory_.GetWeakPtr())); + base::Bind(&HttpStreamFactoryImpl::Job::OnSpdySessionReadyCallback, + ptr_factory_.GetWeakPtr())); } else { base::MessageLoop::current()->PostTask( FROM_HERE, @@ -710,7 +713,7 @@ int HttpStreamFactoryImpl::Job::DoInitConnection() { SpdySessionKey spdy_session_key = GetSpdySessionKey(); scoped_refptr<SpdySession> spdy_session = session_->spdy_session_pool()->GetIfExists(spdy_session_key, net_log_); - if (spdy_session && CanUseExistingSpdySession()) { + if (spdy_session.get() && CanUseExistingSpdySession()) { // If we're preconnecting, but we already have a SpdySession, we don't // actually need to preconnect any sockets, so we're done. if (IsPreconnecting()) @@ -815,7 +818,7 @@ int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) { SpdySessionKey spdy_session_key = GetSpdySessionKey(); existing_spdy_session_ = session_->spdy_session_pool()->GetIfExists(spdy_session_key, net_log_); - if (existing_spdy_session_) { + if (existing_spdy_session_.get()) { using_spdy_ = true; next_state_ = STATE_CREATE_STREAM; } else { @@ -961,7 +964,7 @@ int HttpStreamFactoryImpl::Job::DoWaitingUserAction(int result) { } int HttpStreamFactoryImpl::Job::DoCreateStream() { - DCHECK(connection_->socket() || existing_spdy_session_ || + DCHECK(connection_->socket() || existing_spdy_session_.get() || existing_available_pipeline_ || using_quic_); next_state_ = STATE_CREATE_STREAM_COMPLETE; @@ -1019,7 +1022,7 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() { } scoped_refptr<SpdySession> spdy_session; - if (existing_spdy_session_) { + if (existing_spdy_session_.get()) { // We picked up an existing session, so we don't need our socket. if (connection_->socket()) connection_->socket()->Disconnect(); @@ -1028,10 +1031,13 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() { } else { SpdySessionPool* spdy_pool = session_->spdy_session_pool(); spdy_session = spdy_pool->GetIfExists(spdy_session_key, net_log_); - if (!spdy_session) { - int error = spdy_pool->GetSpdySessionFromSocket( - spdy_session_key, connection_.release(), net_log_, - spdy_certificate_error_, &new_spdy_session_, using_ssl_); + if (!spdy_session.get()) { + int error = spdy_pool->GetSpdySessionFromSocket(spdy_session_key, + connection_.release(), + net_log_, + spdy_certificate_error_, + &new_spdy_session_, + using_ssl_); if (error != OK) return error; const HostPortPair& host_port_pair = spdy_session_key.host_port_pair(); @@ -1052,7 +1058,7 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() { // will know when SpdySessions become available. bool use_relative_url = direct || request_info_.url.SchemeIs("https"); - stream_.reset(new SpdyHttpStream(spdy_session, use_relative_url)); + stream_.reset(new SpdyHttpStream(spdy_session.get(), use_relative_url)); return OK; } @@ -1285,7 +1291,7 @@ int HttpStreamFactoryImpl::Job::HandleCertificateError(int error) { // |ssl_info_.cert| may be NULL if we failed to create // X509Certificate for whatever reason, but normally it shouldn't // happen, unless this code is used inside sandbox. - if (ssl_info_.cert == NULL || + if (ssl_info_.cert.get() == NULL || !X509Certificate::GetDEREncoded(ssl_info_.cert->os_cert_handle(), &bad_cert.der_cert)) { return error; diff --git a/net/http/http_stream_factory_impl_request.cc b/net/http/http_stream_factory_impl_request.cc index 23aa5ff..3fcc7ae 100644 --- a/net/http/http_stream_factory_impl_request.cc +++ b/net/http/http_stream_factory_impl_request.cc @@ -313,7 +313,7 @@ void HttpStreamFactoryImpl::Request::OnSpdySessionReady( delegate_->OnStreamReady( job->server_ssl_config(), job->proxy_info(), - new SpdyHttpStream(spdy_session, use_relative_url)); + new SpdyHttpStream(spdy_session.get(), use_relative_url)); // |this| may be deleted after this point. factory->OnSpdySessionReady( spdy_session, direct, used_ssl_config, used_proxy_info, diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc index cac7f02..6f4e6ea 100644 --- a/net/http/http_stream_factory_impl_unittest.cc +++ b/net/http/http_stream_factory_impl_unittest.cc @@ -152,7 +152,7 @@ HttpNetworkSession* CreateSession(SessionDependencies* session_deps) { params.host_resolver = session_deps->host_resolver.get(); params.cert_verifier = session_deps->cert_verifier.get(); params.proxy_service = session_deps->proxy_service.get(); - params.ssl_config_service = session_deps->ssl_config_service; + params.ssl_config_service = session_deps->ssl_config_service.get(); params.client_socket_factory = &session_deps->socket_factory; params.http_auth_handler_factory = session_deps->http_auth_handler_factory.get(); @@ -321,7 +321,7 @@ TEST(HttpStreamFactoryTest, PreconnectDirect) { mock_pool_manager->SetTransportSocketPool(transport_conn_pool); mock_pool_manager->SetSSLSocketPool(ssl_conn_pool); peer.SetClientSocketPoolManager(mock_pool_manager); - PreconnectHelper(kTests[i], session); + PreconnectHelper(kTests[i], session.get()); if (kTests[i].ssl) EXPECT_EQ(kTests[i].num_streams, ssl_conn_pool->last_num_streams()); else @@ -348,7 +348,7 @@ TEST(HttpStreamFactoryTest, PreconnectHttpProxy) { mock_pool_manager->SetSocketPoolForHTTPProxy(proxy_host, http_proxy_pool); mock_pool_manager->SetSocketPoolForSSLWithProxy(proxy_host, ssl_conn_pool); peer.SetClientSocketPoolManager(mock_pool_manager); - PreconnectHelper(kTests[i], session); + PreconnectHelper(kTests[i], session.get()); if (kTests[i].ssl) EXPECT_EQ(kTests[i].num_streams, ssl_conn_pool->last_num_streams()); else @@ -376,7 +376,7 @@ TEST(HttpStreamFactoryTest, PreconnectSocksProxy) { mock_pool_manager->SetSocketPoolForSOCKSProxy(proxy_host, socks_proxy_pool); mock_pool_manager->SetSocketPoolForSSLWithProxy(proxy_host, ssl_conn_pool); peer.SetClientSocketPoolManager(mock_pool_manager); - PreconnectHelper(kTests[i], session); + PreconnectHelper(kTests[i], session.get()); if (kTests[i].ssl) EXPECT_EQ(kTests[i].num_streams, ssl_conn_pool->last_num_streams()); else @@ -410,7 +410,7 @@ TEST(HttpStreamFactoryTest, PreconnectDirectWithExistingSpdySession) { mock_pool_manager->SetTransportSocketPool(transport_conn_pool); mock_pool_manager->SetSSLSocketPool(ssl_conn_pool); peer.SetClientSocketPoolManager(mock_pool_manager); - PreconnectHelper(kTests[i], session); + PreconnectHelper(kTests[i], session.get()); // We shouldn't be preconnecting if we have an existing session, which is // the case for https://www.google.com. if (kTests[i].ssl) @@ -438,7 +438,7 @@ TEST(HttpStreamFactoryTest, PreconnectUnsafePort) { mock_pool_manager->SetTransportSocketPool(transport_conn_pool); peer.SetClientSocketPoolManager(mock_pool_manager); - PreconnectHelperForURL(1, GURL("http://www.google.com:7"), session); + PreconnectHelperForURL(1, GURL("http://www.google.com:7"), session.get()); EXPECT_EQ(-1, transport_conn_pool->last_num_streams()); } diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index 7b195e7..17b5c6e 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc @@ -248,15 +248,15 @@ int HttpStreamParser::SendRequest(const std::string& request_line, // We'll repurpose |request_headers_| to store the merged headers and // body. request_headers_ = new DrainableIOBuffer( - merged_request_headers_and_body, merged_size); + merged_request_headers_and_body.get(), merged_size); memcpy(request_headers_->data(), request.data(), request.size()); request_headers_->DidConsume(request.size()); size_t todo = request_->upload_data_stream->size(); while (todo) { - int consumed = request_->upload_data_stream->Read(request_headers_, todo, - CompletionCallback()); + int consumed = request_->upload_data_stream + ->Read(request_headers_.get(), todo, CompletionCallback()); DCHECK_GT(consumed, 0); // Read() won't fail if not chunked. request_headers_->DidConsume(consumed); todo -= consumed; @@ -278,8 +278,8 @@ int HttpStreamParser::SendRequest(const std::string& request_line, // If we didn't merge the body with the headers, then |request_headers_| // contains just the HTTP headers. scoped_refptr<StringIOBuffer> headers_io_buf(new StringIOBuffer(request)); - request_headers_ = new DrainableIOBuffer(headers_io_buf, - headers_io_buf->size()); + request_headers_ = + new DrainableIOBuffer(headers_io_buf.get(), headers_io_buf->size()); } result = DoLoop(OK); @@ -422,9 +422,8 @@ int HttpStreamParser::DoSendHeaders(int result) { if (bytes_remaining == request_headers_->size()) { response_->request_time = base::Time::Now(); } - result = connection_->socket()->Write(request_headers_, - bytes_remaining, - io_callback_); + result = connection_->socket() + ->Write(request_headers_.get(), bytes_remaining, io_callback_); } else if (request_->upload_data_stream != NULL && (request_->upload_data_stream->is_chunked() || // !IsEOF() indicates that the body wasn't merged. @@ -451,10 +450,10 @@ int HttpStreamParser::DoSendBody(int result) { // Send the remaining data in the request body buffer. request_body_send_buf_->DidConsume(result); if (request_body_send_buf_->BytesRemaining() > 0) { - return connection_->socket()->Write( - request_body_send_buf_, - request_body_send_buf_->BytesRemaining(), - io_callback_); + return connection_->socket() + ->Write(request_body_send_buf_.get(), + request_body_send_buf_->BytesRemaining(), + io_callback_); } if (request_->upload_data_stream->is_chunked() && sent_last_chunk_) { @@ -464,7 +463,7 @@ int HttpStreamParser::DoSendBody(int result) { request_body_read_buf_->Clear(); io_state_ = STATE_SEND_REQUEST_READING_BODY; - return request_->upload_data_stream->Read(request_body_read_buf_, + return request_->upload_data_stream->Read(request_body_read_buf_.get(), request_body_read_buf_->capacity(), io_callback_); } @@ -513,9 +512,8 @@ int HttpStreamParser::DoReadHeaders() { // See if the user is passing in an IOBuffer with a NULL |data_|. CHECK(read_buf_->data()); - return connection_->socket()->Read(read_buf_, - read_buf_->RemainingCapacity(), - io_callback_); + return connection_->socket() + ->Read(read_buf_.get(), read_buf_->RemainingCapacity(), io_callback_); } int HttpStreamParser::DoReadHeadersComplete(int result) { @@ -650,8 +648,8 @@ int HttpStreamParser::DoReadBody() { return 0; DCHECK_EQ(0, read_buf_->offset()); - return connection_->socket()->Read(user_read_buf_, user_read_buf_len_, - io_callback_); + return connection_->socket() + ->Read(user_read_buf_.get(), user_read_buf_len_, io_callback_); } int HttpStreamParser::DoReadBodyComplete(int result) { @@ -795,25 +793,26 @@ int HttpStreamParser::DoParseResponseHeaders(int end_offset) { // If they exist, and have distinct values, it's a potential response // smuggling attack. if (!headers->HasHeader("Transfer-Encoding")) { - if (HeadersContainMultipleCopiesOfField(*headers, "Content-Length")) + if (HeadersContainMultipleCopiesOfField(*headers.get(), "Content-Length")) return ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH; } // Check for multiple Content-Disposition or Location headers. If they exist, // it's also a potential response smuggling attack. - if (HeadersContainMultipleCopiesOfField(*headers, "Content-Disposition")) + if (HeadersContainMultipleCopiesOfField(*headers.get(), + "Content-Disposition")) return ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION; - if (HeadersContainMultipleCopiesOfField(*headers, "Location")) + if (HeadersContainMultipleCopiesOfField(*headers.get(), "Location")) return ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION; response_->headers = headers; response_->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP1; - response_->vary_data.Init(*request_, *response_->headers); + response_->vary_data.Init(*request_, *response_->headers.get()); DVLOG(1) << __FUNCTION__ << "()" - << " content_length = \"" - << response_->headers->GetContentLength() << "\n\"" - << " headers = \"" << GetResponseHeaderLines(*response_->headers) - << "\""; + << " content_length = \"" << response_->headers->GetContentLength() + << "\n\"" + << " headers = \"" + << GetResponseHeaderLines(*response_->headers.get()) << "\""; return OK; } diff --git a/net/http/http_stream_parser_unittest.cc b/net/http/http_stream_parser_unittest.cc index 9637bad..5d9bcfd 100644 --- a/net/http/http_stream_parser_unittest.cc +++ b/net/http/http_stream_parser_unittest.cc @@ -225,8 +225,8 @@ TEST(HttpStreamParser, AsyncChunkAndAsyncSocket) { request_info.upload_data_stream = &upload_stream; scoped_refptr<GrowableIOBuffer> read_buffer(new GrowableIOBuffer); - HttpStreamParser parser(socket_handle.get(), &request_info, read_buffer, - BoundNetLog()); + HttpStreamParser parser( + socket_handle.get(), &request_info, read_buffer.get(), BoundNetLog()); HttpRequestHeaders request_headers; request_headers.SetHeader("Host", "localhost"); @@ -292,7 +292,8 @@ TEST(HttpStreamParser, AsyncChunkAndAsyncSocket) { // Finally, attempt to read the response body. scoped_refptr<IOBuffer> body_buffer(new IOBuffer(kBodySize)); - rv = parser.ReadResponseBody(body_buffer, kBodySize, callback.callback()); + rv = parser.ReadResponseBody( + body_buffer.get(), kBodySize, callback.callback()); ASSERT_EQ(ERR_IO_PENDING, rv); data.RunFor(1); @@ -382,8 +383,8 @@ TEST(HttpStreamParser, TruncatedHeaders) { request_info.load_flags = LOAD_NORMAL; scoped_refptr<GrowableIOBuffer> read_buffer(new GrowableIOBuffer); - HttpStreamParser parser(socket_handle.get(), &request_info, read_buffer, - BoundNetLog()); + HttpStreamParser parser( + socket_handle.get(), &request_info, read_buffer.get(), BoundNetLog()); HttpRequestHeaders request_headers; HttpResponseInfo response_info; diff --git a/net/http/http_transaction_unittest.cc b/net/http/http_transaction_unittest.cc index 7b9ef46..bff06e0 100644 --- a/net/http/http_transaction_unittest.cc +++ b/net/http/http_transaction_unittest.cc @@ -203,7 +203,8 @@ void TestTransactionConsumer::DidFinish(int result) { void TestTransactionConsumer::Read() { state_ = READING; read_buf_ = new net::IOBuffer(1024); - int result = trans_->Read(read_buf_, 1024, + int result = trans_->Read(read_buf_.get(), + 1024, base::Bind(&TestTransactionConsumer::OnIOComplete, base::Unretained(this))); if (result != net::ERR_IO_PENDING) @@ -274,7 +275,7 @@ int MockNetworkTransaction::Start(const net::HttpRequestInfo* request, response_.response_time = t->response_time; response_.headers = new net::HttpResponseHeaders(header_data); - response_.vary_data.Init(*request, *response_.headers); + response_.vary_data.Init(*request, *response_.headers.get()); response_.ssl_info.cert_status = t->cert_status; data_ = resp_data; @@ -426,7 +427,7 @@ int ReadTransaction(net::HttpTransaction* trans, std::string* result) { std::string content; do { scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256)); - rv = trans->Read(buf, 256, callback.callback()); + rv = trans->Read(buf.get(), 256, callback.callback()); if (rv == net::ERR_IO_PENDING) rv = callback.WaitForResult(); diff --git a/net/http/http_vary_data_unittest.cc b/net/http/http_vary_data_unittest.cc index 93ee4f45..cffa2d2 100644 --- a/net/http/http_vary_data_unittest.cc +++ b/net/http/http_vary_data_unittest.cc @@ -45,7 +45,7 @@ TEST(HttpVaryDataTest, IsInvalid) { net::HttpVaryData v; EXPECT_FALSE(v.is_valid()); - EXPECT_FALSE(v.Init(t.request, *t.response)); + EXPECT_FALSE(v.Init(t.request, *t.response.get())); EXPECT_FALSE(v.is_valid()); } } @@ -56,13 +56,13 @@ TEST(HttpVaryDataTest, MultipleInit) { // Init to something valid. TestTransaction t1; t1.Init("Foo: 1\r\nbar: 23", "HTTP/1.1 200 OK\nVary: foo, bar\n\n"); - EXPECT_TRUE(v.Init(t1.request, *t1.response)); + EXPECT_TRUE(v.Init(t1.request, *t1.response.get())); EXPECT_TRUE(v.is_valid()); // Now overwrite by initializing to something invalid. TestTransaction t2; t2.Init("Foo: 1\r\nbar: 23", "HTTP/1.1 200 OK\nVary: *\n\n"); - EXPECT_FALSE(v.Init(t2.request, *t2.response)); + EXPECT_FALSE(v.Init(t2.request, *t2.response.get())); EXPECT_FALSE(v.is_valid()); } @@ -74,9 +74,9 @@ TEST(HttpVaryDataTest, DoesVary) { b.Init("Foo: 2", "HTTP/1.1 200 OK\nVary: foo\n\n"); net::HttpVaryData v; - EXPECT_TRUE(v.Init(a.request, *a.response)); + EXPECT_TRUE(v.Init(a.request, *a.response.get())); - EXPECT_FALSE(v.MatchesRequest(b.request, *b.response)); + EXPECT_FALSE(v.MatchesRequest(b.request, *b.response.get())); } TEST(HttpVaryDataTest, DoesVary2) { @@ -87,9 +87,9 @@ TEST(HttpVaryDataTest, DoesVary2) { b.Init("Foo: 12\r\nbar: 3", "HTTP/1.1 200 OK\nVary: foo, bar\n\n"); net::HttpVaryData v; - EXPECT_TRUE(v.Init(a.request, *a.response)); + EXPECT_TRUE(v.Init(a.request, *a.response.get())); - EXPECT_FALSE(v.MatchesRequest(b.request, *b.response)); + EXPECT_FALSE(v.MatchesRequest(b.request, *b.response.get())); } TEST(HttpVaryDataTest, DoesntVary) { @@ -100,9 +100,9 @@ TEST(HttpVaryDataTest, DoesntVary) { b.Init("Foo: 1", "HTTP/1.1 200 OK\nVary: foo\n\n"); net::HttpVaryData v; - EXPECT_TRUE(v.Init(a.request, *a.response)); + EXPECT_TRUE(v.Init(a.request, *a.response.get())); - EXPECT_TRUE(v.MatchesRequest(b.request, *b.response)); + EXPECT_TRUE(v.MatchesRequest(b.request, *b.response.get())); } TEST(HttpVaryDataTest, DoesntVary2) { @@ -113,9 +113,9 @@ TEST(HttpVaryDataTest, DoesntVary2) { b.Init("Foo: 1\r\nbaR: 2", "HTTP/1.1 200 OK\nVary: foo\nVary: bar\n\n"); net::HttpVaryData v; - EXPECT_TRUE(v.Init(a.request, *a.response)); + EXPECT_TRUE(v.Init(a.request, *a.response.get())); - EXPECT_TRUE(v.MatchesRequest(b.request, *b.response)); + EXPECT_TRUE(v.MatchesRequest(b.request, *b.response.get())); } TEST(HttpVaryDataTest, ImplicitCookieForRedirect) { @@ -126,9 +126,9 @@ TEST(HttpVaryDataTest, ImplicitCookieForRedirect) { b.Init("Cookie: 2", "HTTP/1.1 301 Moved\nLocation: x\n\n"); net::HttpVaryData v; - EXPECT_TRUE(v.Init(a.request, *a.response)); + EXPECT_TRUE(v.Init(a.request, *a.response.get())); - EXPECT_FALSE(v.MatchesRequest(b.request, *b.response)); + EXPECT_FALSE(v.MatchesRequest(b.request, *b.response.get())); } TEST(HttpVaryDataTest, ImplicitCookieForRedirect2) { @@ -141,7 +141,7 @@ TEST(HttpVaryDataTest, ImplicitCookieForRedirect2) { b.Init("Cookie: 2", "HTTP/1.1 301 Moved\nLocation: x\nVary: cooKie\n\n"); net::HttpVaryData v; - EXPECT_TRUE(v.Init(a.request, *a.response)); + EXPECT_TRUE(v.Init(a.request, *a.response.get())); - EXPECT_FALSE(v.MatchesRequest(b.request, *b.response)); + EXPECT_FALSE(v.MatchesRequest(b.request, *b.response.get())); } diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc index a17af59..8f2eb7c 100644 --- a/net/http/mock_http_cache.cc +++ b/net/http/mock_http_cache.cc @@ -511,7 +511,7 @@ bool MockHttpCache::ReadResponseInfo(disk_cache::Entry* disk_entry, net::TestCompletionCallback cb; scoped_refptr<net::IOBuffer> buffer(new net::IOBuffer(size)); - int rv = disk_entry->ReadData(0, 0, buffer, size, cb.callback()); + int rv = disk_entry->ReadData(0, 0, buffer.get(), size, cb.callback()); rv = cb.GetResult(rv); EXPECT_EQ(size, rv); @@ -532,7 +532,7 @@ bool MockHttpCache::WriteResponseInfo( reinterpret_cast<const char*>(pickle.data()))); int len = static_cast<int>(pickle.size()); - int rv = disk_entry->WriteData(0, 0, data, len, cb.callback(), true); + int rv = disk_entry->WriteData(0, 0, data.get(), len, cb.callback(), true); rv = cb.GetResult(rv); return (rv == len); } diff --git a/net/http/proxy_client_socket.cc b/net/http/proxy_client_socket.cc index b892479..4caab08 100644 --- a/net/http/proxy_client_socket.cc +++ b/net/http/proxy_client_socket.cc @@ -46,7 +46,7 @@ void ProxyClientSocket::BuildTunnelRequest( int ProxyClientSocket::HandleProxyAuthChallenge(HttpAuthController* auth, HttpResponseInfo* response, const BoundNetLog& net_log) { - DCHECK(response->headers); + DCHECK(response->headers.get()); int rv = auth->HandleAuthChallenge(response->headers, false, true, net_log); response->auth_challenge = auth->auth_info(); if (rv == OK) @@ -74,7 +74,7 @@ void ProxyClientSocket::LogBlockedTunnelResponse(int http_status_code, // static bool ProxyClientSocket::SanitizeProxyRedirect(HttpResponseInfo* response, const GURL& url) { - DCHECK(response && response->headers); + DCHECK(response && response->headers.get()); std::string location; if (!response->headers->IsRedirect(&location)) |