diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-29 16:21:57 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-29 16:21:57 +0000 |
commit | 8e7177727ef18e2fdb0f2ad05e6c39da10265797 (patch) | |
tree | ef8960c18ef613cbec74f8346ecca168c1df8d10 | |
parent | d685a68049c3bacf00e108afe1da6a0807b2ab3c (diff) | |
download | chromium_src-8e7177727ef18e2fdb0f2ad05e6c39da10265797.zip chromium_src-8e7177727ef18e2fdb0f2ad05e6c39da10265797.tar.gz chromium_src-8e7177727ef18e2fdb0f2ad05e6c39da10265797.tar.bz2 |
Re-connect if Keep-Alive connection has been closed by the time we get around to reusing it.
BUG=none
TEST=net_unittests --gtest_filter=HttpNetworkTransactionTest.BasicAuthKeepAliveImpatientServer:*.BasicAuthKeepAliveNoBody:*.BasicAuthKeepAliveLargeBody && unit_tests --gtest_filter=*TransportClientSocketTest.IsConnected*
Review URL: http://codereview.chromium.org/6878055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83524 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/http/http_basic_stream.cc | 6 | ||||
-rw-r--r-- | net/http/http_basic_stream.h | 35 | ||||
-rw-r--r-- | net/http/http_network_transaction.cc | 7 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 31 | ||||
-rw-r--r-- | net/http/http_response_body_drainer_unittest.cc | 36 | ||||
-rw-r--r-- | net/http/http_stream.h | 6 | ||||
-rw-r--r-- | net/http/http_stream_parser.cc | 6 | ||||
-rw-r--r-- | net/http/http_stream_parser.h | 4 | ||||
-rw-r--r-- | net/socket/socket_test_util.cc | 8 | ||||
-rw-r--r-- | net/socket/socket_test_util.h | 1 | ||||
-rw-r--r-- | net/socket/transport_client_socket_unittest.cc | 104 | ||||
-rw-r--r-- | net/spdy/spdy_http_stream.cc | 7 | ||||
-rw-r--r-- | net/spdy/spdy_http_stream.h | 48 |
13 files changed, 216 insertions, 83 deletions
diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc index ef4d777..6501a59 100644 --- a/net/http/http_basic_stream.cc +++ b/net/http/http_basic_stream.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -102,6 +102,10 @@ void HttpBasicStream::SetConnectionReused() { parser_->SetConnectionReused(); } +bool HttpBasicStream::IsConnectionReusable() const { + return parser_->IsConnectionReusable(); +} + void HttpBasicStream::GetSSLInfo(SSLInfo* ssl_info) { parser_->GetSSLInfo(ssl_info); } diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h index 2c26315..267c7c1 100644 --- a/net/http/http_basic_stream.h +++ b/net/http/http_basic_stream.h @@ -42,41 +42,44 @@ class HttpBasicStream : public HttpStream { // HttpStream methods: virtual int InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback); + CompletionCallback* callback) OVERRIDE; virtual int SendRequest(const HttpRequestHeaders& headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback); + CompletionCallback* callback) OVERRIDE; - virtual uint64 GetUploadProgress() const; + virtual uint64 GetUploadProgress() const OVERRIDE; - virtual int ReadResponseHeaders(CompletionCallback* callback); + virtual int ReadResponseHeaders(CompletionCallback* callback) OVERRIDE; - virtual const HttpResponseInfo* GetResponseInfo() const; + virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE; virtual int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback); + CompletionCallback* callback) OVERRIDE; - virtual void Close(bool not_reusable); + virtual void Close(bool not_reusable) OVERRIDE; - virtual HttpStream* RenewStreamForAuth(); + virtual HttpStream* RenewStreamForAuth() OVERRIDE; - virtual bool IsResponseBodyComplete() const; + virtual bool IsResponseBodyComplete() const OVERRIDE; - virtual bool CanFindEndOfResponse() const; + virtual bool CanFindEndOfResponse() const OVERRIDE; - virtual bool IsMoreDataBuffered() const; + virtual bool IsMoreDataBuffered() const OVERRIDE; - virtual bool IsConnectionReused() const; + virtual bool IsConnectionReused() const OVERRIDE; - virtual void SetConnectionReused(); + virtual void SetConnectionReused() OVERRIDE; - virtual void GetSSLInfo(SSLInfo* ssl_info); + virtual bool IsConnectionReusable() const OVERRIDE; - virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); + virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; - virtual bool IsSpdyHttpStream() const; + virtual void GetSSLCertRequestInfo( + SSLCertRequestInfo* cert_request_info) OVERRIDE; + + virtual bool IsSpdyHttpStream() const OVERRIDE; private: scoped_refptr<GrowableIOBuffer> read_buf_; diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 46858e6..5cd2f92 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -273,7 +273,7 @@ void HttpNetworkTransaction::DidDrainBodyForAuthRestart(bool keep_alive) { if (stream_.get()) { HttpStream* new_stream = NULL; - if (keep_alive) { + if (keep_alive && stream_->IsConnectionReusable()) { // We should call connection_->set_idle_time(), but this doesn't occur // often enough to be worth the trouble. stream_->SetConnectionReused(); @@ -281,7 +281,10 @@ void HttpNetworkTransaction::DidDrainBodyForAuthRestart(bool keep_alive) { } if (!new_stream) { - stream_->Close(!keep_alive); + // Close the stream and mark it as not_reusable. Even in the + // keep_alive case, we've determined that the stream_ is not + // reusable if new_stream is NULL. + stream_->Close(true); next_state_ = STATE_CREATE_STREAM; } else { next_state_ = STATE_INIT_STREAM; diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 64d53ba..e11860c 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -1192,9 +1192,18 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) { MockRead("Hello"), }; + // If there is a regression where we disconnect a Keep-Alive + // connection during an auth roundtrip, we'll end up reading this. + MockRead data_reads2[] = { + MockRead(false, ERR_FAILED), + }; + StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1), data_writes1, arraysize(data_writes1)); + StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2), + NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data1); + session_deps.socket_factory.AddSocketDataProvider(&data2); TestCompletionCallback callback1; @@ -1224,7 +1233,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAlive) { EXPECT_EQ(OK, rv); response = trans->GetResponseInfo(); - EXPECT_FALSE(response == NULL); + ASSERT_FALSE(response == NULL); EXPECT_TRUE(response->auth_challenge.get() == NULL); EXPECT_EQ(5, response->headers->GetContentLength()); } @@ -1265,9 +1274,17 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { MockRead("hello"), }; + // An incorrect reconnect would cause this to be read. + MockRead data_reads2[] = { + MockRead(false, ERR_FAILED), + }; + StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1), data_writes1, arraysize(data_writes1)); + StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2), + NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data1); + session_deps.socket_factory.AddSocketDataProvider(&data2); TestCompletionCallback callback1; @@ -1297,7 +1314,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveNoBody) { EXPECT_EQ(OK, rv); response = trans->GetResponseInfo(); - EXPECT_FALSE(response == NULL); + ASSERT_FALSE(response == NULL); EXPECT_TRUE(response->auth_challenge.get() == NULL); EXPECT_EQ(5, response->headers->GetContentLength()); } @@ -1346,9 +1363,17 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { MockRead("hello"), }; + // An incorrect reconnect would cause this to be read. + MockRead data_reads2[] = { + MockRead(false, ERR_FAILED), + }; + StaticSocketDataProvider data1(data_reads1, arraysize(data_reads1), data_writes1, arraysize(data_writes1)); + StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2), + NULL, 0); session_deps.socket_factory.AddSocketDataProvider(&data1); + session_deps.socket_factory.AddSocketDataProvider(&data2); TestCompletionCallback callback1; @@ -1378,7 +1403,7 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthKeepAliveLargeBody) { EXPECT_EQ(OK, rv); response = trans->GetResponseInfo(); - EXPECT_FALSE(response == NULL); + ASSERT_FALSE(response == NULL); EXPECT_TRUE(response->auth_challenge.get() == NULL); EXPECT_EQ(5, response->headers->GetContentLength()); } diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 9feed17..45c826e 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc @@ -74,44 +74,48 @@ class MockHttpStream : public HttpStream { // HttpStream implementation: virtual int InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback) { + CompletionCallback* callback) OVERRIDE { return ERR_UNEXPECTED; } virtual int SendRequest(const HttpRequestHeaders& request_headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback) { + CompletionCallback* callback) OVERRIDE { return ERR_UNEXPECTED; } - virtual uint64 GetUploadProgress() const { return 0; } - virtual int ReadResponseHeaders(CompletionCallback* callback) { + virtual uint64 GetUploadProgress() const OVERRIDE { return 0; } + virtual int ReadResponseHeaders(CompletionCallback* callback) OVERRIDE { return ERR_UNEXPECTED; } - virtual const HttpResponseInfo* GetResponseInfo() const { return NULL; } + virtual const HttpResponseInfo* GetResponseInfo() const OVERRIDE { + return NULL; + } - virtual bool CanFindEndOfResponse() const { return true; } - virtual bool IsMoreDataBuffered() const { return false; } - virtual bool IsConnectionReused() const { return false; } - virtual void SetConnectionReused() {} - virtual void GetSSLInfo(SSLInfo* ssl_info) {} - virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) {} + virtual bool CanFindEndOfResponse() const OVERRIDE { return true; } + virtual bool IsMoreDataBuffered() const OVERRIDE { return false; } + virtual bool IsConnectionReused() const OVERRIDE { return false; } + virtual void SetConnectionReused() OVERRIDE {} + virtual bool IsConnectionReusable() const OVERRIDE { return false; } + virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE {} + virtual void GetSSLCertRequestInfo( + SSLCertRequestInfo* cert_request_info) OVERRIDE {} // Mocked API virtual int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback); - virtual void Close(bool not_reusable) { + CompletionCallback* callback) OVERRIDE; + virtual void Close(bool not_reusable) OVERRIDE { DCHECK(!closed_); closed_ = true; result_waiter_->set_result(not_reusable); } - virtual HttpStream* RenewStreamForAuth() { + virtual HttpStream* RenewStreamForAuth() OVERRIDE { return NULL; } - virtual bool IsResponseBodyComplete() const { return is_complete_; } + virtual bool IsResponseBodyComplete() const OVERRIDE { return is_complete_; } - virtual bool IsSpdyHttpStream() const { return false; } + virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } // Methods to tweak/observer mock behavior: void StallReadsForever() { stall_reads_forever_ = true; } diff --git a/net/http/http_stream.h b/net/http/http_stream.h index e262038..fed64655 100644 --- a/net/http/http_stream.h +++ b/net/http/http_stream.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -116,6 +116,10 @@ class HttpStream { virtual bool IsConnectionReused() const = 0; virtual void SetConnectionReused() = 0; + // Checks whether the current state of the underlying connection + // allows it to be reused. + virtual bool IsConnectionReusable() const = 0; + // Get the SSLInfo associated with this stream's connection. This should // only be called for streams over SSL sockets, otherwise the behavior is // undefined. diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index eb1ed35..0649bce 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -700,6 +700,10 @@ void HttpStreamParser::SetConnectionReused() { connection_->set_is_reused(true); } +bool HttpStreamParser::IsConnectionReusable() const { + return connection_->socket() && connection_->socket()->IsConnectedAndIdle(); +} + void HttpStreamParser::GetSSLInfo(SSLInfo* ssl_info) { if (request_->url.SchemeIs("https") && connection_->socket()) { SSLClientSocket* ssl_socket = diff --git a/net/http/http_stream_parser.h b/net/http/http_stream_parser.h index d9241a6..2192eff 100644 --- a/net/http/http_stream_parser.h +++ b/net/http/http_stream_parser.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -67,6 +67,8 @@ class HttpStreamParser : public ChunkCallback { void SetConnectionReused(); + bool IsConnectionReusable() const; + void GetSSLInfo(SSLInfo* ssl_info); void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 577c7d2..ab10549 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -786,6 +786,12 @@ bool MockTCPClientSocket::IsConnectedAndIdle() const { return IsConnected(); } +int MockTCPClientSocket::GetPeerAddress(AddressList* address) const { + if (!IsConnected()) + return ERR_SOCKET_NOT_CONNECTED; + return MockClientSocket::GetPeerAddress(address); +} + bool MockTCPClientSocket::WasEverUsed() const { return was_used_to_convey_data_; } diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index 823c3b8..42d4a46 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -622,6 +622,7 @@ class MockTCPClientSocket : public MockClientSocket { virtual void Disconnect(); virtual bool IsConnected() const; virtual bool IsConnectedAndIdle() const; + virtual int GetPeerAddress(AddressList* address) const; virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc index 837749e..28b70d4 100644 --- a/net/socket/transport_client_socket_unittest.cc +++ b/net/socket/transport_client_socket_unittest.cc @@ -48,9 +48,7 @@ class TransportClientSocketTest } virtual void DidRead(ListenSocket*, const char* str, int len) { // TODO(dkegel): this might not be long enough to tickle some bugs. - connected_sock_->Send(kServerReply, - arraysize(kServerReply) - 1, - false /* don't append line feed */); + SendServerReply(); } virtual void DidClose(ListenSocket* sock) {} @@ -70,6 +68,16 @@ class TransportClientSocketTest connected_sock_->ResumeReads(); } + void SendServerReply() { + connected_sock_->Send(kServerReply, arraysize(kServerReply) - 1, + false /* Don't append line feed */); + } + + uint32 DrainClientSocket(IOBuffer* buf, + uint32 buf_len, + uint32 bytes_to_read, + TestCompletionCallback* callback); + protected: int listen_port_; CapturingNetLog net_log_; @@ -115,6 +123,26 @@ void TransportClientSocketTest::SetUp() { NetLog::Source())); } +uint32 TransportClientSocketTest::DrainClientSocket( + IOBuffer* buf, uint32 buf_len, + uint32 bytes_to_read, TestCompletionCallback* callback) { + int rv = OK; + uint32 bytes_read = 0; + + while (bytes_read < bytes_to_read) { + rv = sock_->Read(buf, buf_len, callback); + EXPECT_TRUE(rv >= 0 || rv == ERR_IO_PENDING); + + if (rv == ERR_IO_PENDING) + rv = callback->WaitForResult(); + + EXPECT_GE(rv, 0); + bytes_read += rv; + } + + return bytes_read; +} + // TODO(leighton): Add SCTP to this list when it is ready. INSTANTIATE_TEST_CASE_P(ClientSocket, TransportClientSocketTest, @@ -147,9 +175,59 @@ TEST_P(TransportClientSocketTest, Connect) { EXPECT_FALSE(sock_->IsConnected()); } -// TODO(wtc): Add unit tests for IsConnectedAndIdle: -// - Server closes a connection. -// - Server sends data unexpectedly. +TEST_P(TransportClientSocketTest, IsConnected) { + scoped_refptr<IOBuffer> buf(new IOBuffer(4096)); + TestCompletionCallback callback; + uint32 bytes_read; + + EXPECT_FALSE(sock_->IsConnected()); + int rv = sock_->Connect(&callback); + if (rv != OK) { + ASSERT_EQ(rv, ERR_IO_PENDING); + + rv = callback.WaitForResult(); + EXPECT_EQ(rv, OK); + } + + EXPECT_TRUE(sock_->IsConnected()); + EXPECT_TRUE(sock_->IsConnectedAndIdle()); + + // Server sends some data + SendServerReply(); + // Drain a single byte so we know we've received some data. + bytes_read = DrainClientSocket(buf, 1, 1, &callback); + ASSERT_EQ(bytes_read, 1u); + + // Socket should be considered connected, but not idle, + EXPECT_TRUE(sock_->IsConnected()); + EXPECT_FALSE(sock_->IsConnectedAndIdle()); + + bytes_read = DrainClientSocket(buf, 4096, arraysize(kServerReply) - 2, + &callback); + ASSERT_EQ(bytes_read, arraysize(kServerReply) - 2); + + // After draining the data, the socket should be back to connected + // and idle. + EXPECT_TRUE(sock_->IsConnected()); + EXPECT_TRUE(sock_->IsConnectedAndIdle()); + + // This time close the server socket immediately after sending. + SendServerReply(); + CloseServerSocket(); + + // As above because of data. + EXPECT_TRUE(sock_->IsConnected()); + EXPECT_FALSE(sock_->IsConnectedAndIdle()); + + bytes_read = DrainClientSocket(buf, 4096, arraysize(kServerReply) - 1, + &callback); + ASSERT_EQ(bytes_read, arraysize(kServerReply) - 1); + + // Once the data is drained, the socket should now be seen as + // closed. + EXPECT_FALSE(sock_->IsConnected()); + EXPECT_FALSE(sock_->IsConnectedAndIdle()); +} TEST_P(TransportClientSocketTest, Read) { TestCompletionCallback callback; @@ -175,17 +253,9 @@ TEST_P(TransportClientSocketTest, Read) { } scoped_refptr<IOBuffer> buf(new IOBuffer(4096)); - uint32 bytes_read = 0; - while (bytes_read < arraysize(kServerReply) - 1) { - rv = sock_->Read(buf, 4096, &callback); - EXPECT_TRUE(rv >= 0 || rv == ERR_IO_PENDING); - - if (rv == ERR_IO_PENDING) - rv = callback.WaitForResult(); - - ASSERT_GE(rv, 0); - bytes_read += rv; - } + uint32 bytes_read = DrainClientSocket(buf, 4096, arraysize(kServerReply) - 1, + &callback); + ASSERT_EQ(bytes_read, arraysize(kServerReply) - 1); // All data has been read now. Read once more to force an ERR_IO_PENDING, and // then close the server socket, and note the close. diff --git a/net/spdy/spdy_http_stream.cc b/net/spdy/spdy_http_stream.cc index 130a818..ac0c4ce 100644 --- a/net/spdy/spdy_http_stream.cc +++ b/net/spdy/spdy_http_stream.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -177,6 +177,11 @@ void SpdyHttpStream::SetConnectionReused() { // SPDY doesn't need an indicator here. } +bool SpdyHttpStream::IsConnectionReusable() const { + // SPDY streams aren't considered reusable. + return false; +} + void SpdyHttpStream::set_chunk_callback(ChunkCallback* callback) { if (request_body_stream_ != NULL) request_body_stream_->set_chunk_callback(callback); diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h index 6bc5053..31f62f6 100644 --- a/net/spdy/spdy_http_stream.h +++ b/net/spdy/spdy_http_stream.h @@ -45,39 +45,41 @@ class SpdyHttpStream : public SpdyStream::Delegate, public HttpStream { // HttpStream methods: virtual int InitializeStream(const HttpRequestInfo* request_info, const BoundNetLog& net_log, - CompletionCallback* callback); + CompletionCallback* callback) OVERRIDE; virtual int SendRequest(const HttpRequestHeaders& headers, UploadDataStream* request_body, HttpResponseInfo* response, - CompletionCallback* callback); - virtual uint64 GetUploadProgress() const; - virtual int ReadResponseHeaders(CompletionCallback* callback); + CompletionCallback* callback) OVERRIDE; + virtual uint64 GetUploadProgress() const OVERRIDE; + virtual int ReadResponseHeaders(CompletionCallback* callback) OVERRIDE; virtual const HttpResponseInfo* GetResponseInfo() const; virtual int ReadResponseBody(IOBuffer* buf, int buf_len, - CompletionCallback* callback); - virtual void Close(bool not_reusable); - virtual HttpStream* RenewStreamForAuth(); - virtual bool IsResponseBodyComplete() const; - virtual bool CanFindEndOfResponse() const; - virtual bool IsMoreDataBuffered() const; - virtual bool IsConnectionReused() const; - virtual void SetConnectionReused(); - virtual void GetSSLInfo(SSLInfo* ssl_info); - virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); - virtual bool IsSpdyHttpStream() const; + CompletionCallback* callback) OVERRIDE; + virtual void Close(bool not_reusable) OVERRIDE; + virtual HttpStream* RenewStreamForAuth() OVERRIDE; + virtual bool IsResponseBodyComplete() const OVERRIDE; + virtual bool CanFindEndOfResponse() const OVERRIDE; + virtual bool IsMoreDataBuffered() const OVERRIDE; + virtual bool IsConnectionReused() const OVERRIDE; + virtual void SetConnectionReused() OVERRIDE; + virtual bool IsConnectionReusable() const OVERRIDE; + virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; + virtual void GetSSLCertRequestInfo( + SSLCertRequestInfo* cert_request_info) OVERRIDE; + virtual bool IsSpdyHttpStream() const OVERRIDE; // SpdyStream::Delegate methods: - virtual bool OnSendHeadersComplete(int status); - virtual int OnSendBody(); - virtual int OnSendBodyComplete(int status, bool* eof); + virtual bool OnSendHeadersComplete(int status) OVERRIDE; + virtual int OnSendBody() OVERRIDE; + virtual int OnSendBodyComplete(int status, bool* eof) OVERRIDE; virtual int OnResponseReceived(const spdy::SpdyHeaderBlock& response, base::Time response_time, - int status); - virtual void OnDataReceived(const char* buffer, int bytes); - virtual void OnDataSent(int length); - virtual void OnClose(int status); - virtual void set_chunk_callback(ChunkCallback* callback); + int status) OVERRIDE; + virtual void OnDataReceived(const char* buffer, int bytes) OVERRIDE; + virtual void OnDataSent(int length) OVERRIDE; + virtual void OnClose(int status) OVERRIDE; + virtual void set_chunk_callback(ChunkCallback* callback) OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(SpdyNetworkTransactionTest, FlowControlStallResume); |