diff options
author | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-24 18:21:37 +0000 |
---|---|---|
committer | dimich@chromium.org <dimich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-24 18:21:37 +0000 |
commit | ea678b000451e01b4dec557132f34deaa15eac1f (patch) | |
tree | 8f3d2505710dc34ebc26143b6c15f3292b03a8c7 /net | |
parent | c6ce4f6569569fb21745b698adc9ce4abb132980 (diff) | |
download | chromium_src-ea678b000451e01b4dec557132f34deaa15eac1f.zip chromium_src-ea678b000451e01b4dec557132f34deaa15eac1f.tar.gz chromium_src-ea678b000451e01b4dec557132f34deaa15eac1f.tar.bz2 |
Revert 90373 - Warmth of a connection (cwnd) is estimated by the amount of data written to the socket.
Choosing the warmest connection would mean faster resource load times.
Caused layout tests http/tests/loading/redirect-methods.html and http/tests/security/xss-DENIED-iframe-src-alias.html fail on deps WebKit bots, and caused http://code.google.com/p/chromium/issues/detail?id=87423
Deps bots failures: http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20-%20chromium.org&tests=http%2Ftests%2Floading%2Fredirect-methods.html%2Chttp%2Ftests%2Fsecurity%2Fxss-DENIED-iframe-src-alias.html
idle time is the time a socket has remained idle (no http requests being served on it).
Probability of server resetting a connection increases with idle time duration.
Using a cost function that takes into account bytes transferred and idle time to pick best connection to schedule http requests on.
CODEREVIEW done in http://codereview.chromium.org/6990036/
Contributed by gagansingh@google.com
Review URL: http://codereview.chromium.org/7189055
TBR=gagansingh@google.com
Review URL: http://codereview.chromium.org/7255002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
38 files changed, 10 insertions, 481 deletions
diff --git a/net/curvecp/curvecp_client_socket.cc b/net/curvecp/curvecp_client_socket.cc index 95b36f6..f28e839 100644 --- a/net/curvecp/curvecp_client_socket.cc +++ b/net/curvecp/curvecp_client_socket.cc @@ -88,14 +88,6 @@ bool CurveCPClientSocket::UsingTCPFastOpen() const { return false; } -int64 CurveCPClientSocket::NumBytesRead() const { - return -1; -} - -base::TimeDelta CurveCPClientSocket::GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); -} - int CurveCPClientSocket::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { diff --git a/net/curvecp/curvecp_client_socket.h b/net/curvecp/curvecp_client_socket.h index c9faa63..213b13d 100644 --- a/net/curvecp/curvecp_client_socket.h +++ b/net/curvecp/curvecp_client_socket.h @@ -36,8 +36,6 @@ class CurveCPClientSocket : public StreamSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc index c4bb021..6501a59 100644 --- a/net/http/http_basic_stream.cc +++ b/net/http/http_basic_stream.cc @@ -4,8 +4,6 @@ #include "net/http/http_basic_stream.h" -#include "base/format_macros.h" -#include "base/metrics/histogram.h" #include "base/stringprintf.h" #include "net/base/io_buffer.h" #include "net/base/net_errors.h" @@ -14,7 +12,6 @@ #include "net/http/http_stream_parser.h" #include "net/http/http_util.h" #include "net/socket/client_socket_handle.h" -#include "net/socket/client_socket_pool_base.h" namespace net { @@ -37,7 +34,6 @@ int HttpBasicStream::InitializeStream(const HttpRequestInfo* request_info, request_info_ = request_info; parser_.reset(new HttpStreamParser(connection_.get(), request_info, read_buf_, net_log)); - bytes_read_offset_ = connection_->socket()->NumBytesRead(); return OK; } @@ -54,7 +50,6 @@ int HttpBasicStream::SendRequest(const HttpRequestHeaders& headers, request_line_ = base::StringPrintf("%s %s HTTP/1.1\r\n", request_info_->method.c_str(), path.c_str()); - response_ = response; return parser_->SendRequest(request_line_, headers, request_body, response, callback); } @@ -124,45 +119,4 @@ bool HttpBasicStream::IsSpdyHttpStream() const { return false; } -void HttpBasicStream::LogNumRttVsBytesMetrics() const { - int socket_reuse_policy = GetSocketReusePolicy(); - if (socket_reuse_policy > 2 || socket_reuse_policy < 0) { - LOG(ERROR) << "Invalid socket reuse policy"; - return; - } - - int64 total_bytes_read = connection_->socket()->NumBytesRead(); - int64 bytes_received = total_bytes_read - bytes_read_offset_; - int64 num_kb = bytes_received / 1024; - double rtt = connection_->socket()->GetConnectTimeMicros().ToInternalValue(); - rtt /= 1000.0; - - if (num_kb < 1024 && rtt > 0) { // Ignore responses > 1MB - base::TimeDelta duration = base::Time::Now() - - response_->request_time; - double num_rtt = static_cast<double>(duration.InMilliseconds()) / rtt; - int64 num_rtt_scaled = (4 * num_rtt); - - static const char* const kGroups[] = { - "warmest_socket", "warm_socket", "last_accessed_socket" - }; - int bucket = (num_kb / 5) * 5; - const std::string histogram(StringPrintf("Net.Num_RTT_vs_KB_%s_%dKB", - kGroups[socket_reuse_policy], - bucket)); - base::Histogram* counter = base::Histogram::FactoryGet( - histogram, 0, 1000, 2, base::Histogram::kUmaTargetedHistogramFlag); - DCHECK_EQ(histogram, counter->histogram_name()); - counter->Add(num_rtt_scaled); - - VLOG(2) << StringPrintf("%s\nrtt = %f\tnum_rtt = %f\t" - "num_kb = %" PRId64 "\t" - "total bytes = %" PRId64 "\t" - "histogram = %s", - request_line_.data(), - rtt, num_rtt, num_kb, total_bytes_read, - histogram.data()); - } -} - } // namespace net diff --git a/net/http/http_basic_stream.h b/net/http/http_basic_stream.h index 303d68f..267c7c1 100644 --- a/net/http/http_basic_stream.h +++ b/net/http/http_basic_stream.h @@ -81,8 +81,6 @@ class HttpBasicStream : public HttpStream { virtual bool IsSpdyHttpStream() const OVERRIDE; - virtual void LogNumRttVsBytesMetrics() const OVERRIDE; - private: scoped_refptr<GrowableIOBuffer> read_buf_; @@ -96,10 +94,6 @@ class HttpBasicStream : public HttpStream { const HttpRequestInfo* request_info_; - const HttpResponseInfo* response_; - - int64 bytes_read_offset_; - DISALLOW_COPY_AND_ASSIGN(HttpBasicStream); }; diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 2cc9352..8b06a3b 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc @@ -940,7 +940,6 @@ int HttpNetworkTransaction::DoReadBodyComplete(int result) { // Clean up connection if we are done. if (done) { LogTransactionMetrics(); - stream_->LogNumRttVsBytesMetrics(); stream_->Close(!keep_alive); // Note: we don't reset the stream here. We've closed it, but we still // need it around so that callers can call methods such as diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index 3c4643e..45b3d79 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -12,7 +12,6 @@ #include "base/file_path.h" #include "base/file_util.h" #include "base/memory/scoped_ptr.h" -#include "base/metrics/histogram.h" #include "base/utf_string_conversions.h" #include "net/base/auth.h" #include "net/base/capturing_net_log.h" @@ -334,34 +333,6 @@ static const char kExpectedNPNString[] = "\x08http/1.1\x06spdy/2"; static const char kAlternateProtocolHttpHeader[] = "Alternate-Protocol: 443:npn-spdy/2\r\n\r\n"; -TEST_F(HttpNetworkTransactionTest, LogNumRttVsBytesMetrics_WarmestSocket) { - MockRead data_reads[1000]; - data_reads[0] = MockRead("HTTP/1.0 200 OK\r\n\r\n"); - for (int i = 1; i < 999; i++) { - data_reads[i] = MockRead("Gagan is a good boy!"); - } - data_reads[999] = MockRead(false, OK); - - net::SetSocketReusePolicy(0); - SimpleGetHelperResult out = SimpleGetHelper(data_reads, - arraysize(data_reads)); - - base::Histogram* histogram = NULL; - base::StatisticsRecorder::FindHistogram( - "Net.Num_RTT_vs_KB_warmest_socket_15KB", &histogram); - CHECK(histogram); - - base::Histogram::SampleSet sample_set; - histogram->SnapshotSample(&sample_set); - EXPECT_EQ(1, sample_set.TotalCount()); - - EXPECT_EQ(OK, out.rv); - EXPECT_EQ("HTTP/1.0 200 OK", out.status_line); -} - -// TODO(gagansingh): Add test for LogNumRttVsBytesMetrics_LastAccessSocket once -// it is possible to clear histograms from previous tests. - TEST_F(HttpNetworkTransactionTest, Basic) { SessionDependencies session_deps; scoped_ptr<HttpTransaction> trans( diff --git a/net/http/http_proxy_client_socket.cc b/net/http/http_proxy_client_socket.cc index 584cecd..0a41c1f 100644 --- a/net/http/http_proxy_client_socket.cc +++ b/net/http/http_proxy_client_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -165,22 +165,6 @@ bool HttpProxyClientSocket::UsingTCPFastOpen() const { return false; } -int64 HttpProxyClientSocket::NumBytesRead() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->NumBytesRead(); - } - NOTREACHED(); - return -1; -} - -base::TimeDelta HttpProxyClientSocket::GetConnectTimeMicros() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->GetConnectTimeMicros(); - } - NOTREACHED(); - return base::TimeDelta::FromMicroseconds(-1); -} - int HttpProxyClientSocket::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { DCHECK(!user_callback_); diff --git a/net/http/http_proxy_client_socket.h b/net/http/http_proxy_client_socket.h index b1f32a6..bd25bab 100644 --- a/net/http/http_proxy_client_socket.h +++ b/net/http/http_proxy_client_socket.h @@ -78,8 +78,6 @@ class HttpProxyClientSocket : public ProxyClientSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc index 47602e9..45c826e 100644 --- a/net/http/http_response_body_drainer_unittest.cc +++ b/net/http/http_response_body_drainer_unittest.cc @@ -117,8 +117,6 @@ class MockHttpStream : public HttpStream { virtual bool IsSpdyHttpStream() const OVERRIDE { return false; } - virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} - // 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 66fd97c..7ca2203 100644 --- a/net/http/http_stream.h +++ b/net/http/http_stream.h @@ -135,10 +135,6 @@ class NET_TEST HttpStream { // the HttpStream implementation. This is just a quick hack. virtual bool IsSpdyHttpStream() const = 0; - // Record histogram of number of round trips taken to download the full - // response body vs bytes transferred. - virtual void LogNumRttVsBytesMetrics() const = 0; - private: DISALLOW_COPY_AND_ASSIGN(HttpStream); }; diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc index d39890b..ddcbba6 100644 --- a/net/socket/client_socket_pool_base.cc +++ b/net/socket/client_socket_pool_base.cc @@ -4,14 +4,11 @@ #include "net/socket/client_socket_pool_base.h" -#include <math.h> #include "base/compiler_specific.h" #include "base/format_macros.h" -#include "base/logging.h" #include "base/message_loop.h" #include "base/metrics/stats_counters.h" #include "base/stl_util-inl.h" -#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/time.h" #include "base/values.h" @@ -35,33 +32,10 @@ const int kCleanupInterval = 10; // DO NOT INCREASE THIS TIMEOUT. // after a certain timeout has passed without receiving an ACK. bool g_connect_backup_jobs_enabled = true; -double g_socket_reuse_policy_penalty_exponent = -1; -int g_socket_reuse_policy = -1; - } // namespace namespace net { -int GetSocketReusePolicy() { - return g_socket_reuse_policy; -} - -void SetSocketReusePolicy(int policy) { - DCHECK_GE(policy, 0); - DCHECK_LE(policy, 2); - if (policy > 2 || policy < 0) { - LOG(ERROR) << "Invalid socket reuse policy"; - return; - } - - double exponents[] = { 0, 0.25, -1 }; - g_socket_reuse_policy_penalty_exponent = exponents[policy]; - g_socket_reuse_policy = policy; - - VLOG(1) << "Setting g_socket_reuse_policy_penalty_exponent = " - << g_socket_reuse_policy_penalty_exponent; -} - ConnectJob::ConnectJob(const std::string& group_name, base::TimeDelta timeout_duration, Delegate* delegate, @@ -389,7 +363,6 @@ bool ClientSocketPoolBaseHelper::AssignIdleSocketToGroup( const Request* request, Group* group) { std::list<IdleSocket>* idle_sockets = group->mutable_idle_sockets(); std::list<IdleSocket>::iterator idle_socket_it = idle_sockets->end(); - double max_score = -1; // Iterate through the idle sockets forwards (oldest to newest) // * Delete any disconnected ones. @@ -406,22 +379,7 @@ bool ClientSocketPoolBaseHelper::AssignIdleSocketToGroup( if (it->socket->WasEverUsed()) { // We found one we can reuse! - double score = 0; - int64 bytes_read = it->socket->NumBytesRead(); - double num_kb = static_cast<double>(bytes_read) / 1024.0; - int idle_time_sec = (base::TimeTicks::Now() - it->start_time).InSeconds(); - idle_time_sec = std::max(1, idle_time_sec); - - if (g_socket_reuse_policy_penalty_exponent >= 0 && num_kb >= 0) { - score = num_kb / pow(idle_time_sec, - g_socket_reuse_policy_penalty_exponent); - } - - // Equality to prefer recently used connection. - if (score >= max_score) { - idle_socket_it = it; - max_score = score; - } + idle_socket_it = it; } ++it; diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h index 2490c02..a5defdf 100644 --- a/net/socket/client_socket_pool_base.h +++ b/net/socket/client_socket_pool_base.h @@ -50,13 +50,6 @@ namespace net { class ClientSocketHandle; -// Returns the client socket reuse policy. -int GetSocketReusePolicy(); - -// Sets the client socket reuse policy. -// NOTE: 'policy' should be a valid ClientSocketReusePolicy enum value. -NET_API void SetSocketReusePolicy(int policy); - // ConnectJob provides an abstract interface for "connecting" a socket. // The connection may involve host resolution, tcp connection, ssl connection, // etc. @@ -174,17 +167,6 @@ class NET_TEST ClientSocketPoolBaseHelper NO_IDLE_SOCKETS = 0x1, // Do not return an idle socket. Create a new one. }; - enum ClientSocketReusePolicy { - // Socket with largest amount of bytes transferred. - USE_WARMEST_SOCKET = 0, - - // Socket which scores highest on large bytes transferred and low idle time. - USE_WARM_SOCKET = 1, - - // Socket which was most recently used. - USE_LAST_ACCESSED_SOCKET = 2, - }; - class NET_TEST Request { public: Request(ClientSocketHandle* handle, diff --git a/net/socket/client_socket_pool_base_unittest.cc b/net/socket/client_socket_pool_base_unittest.cc index 6cdbdd3..4864001 100644 --- a/net/socket/client_socket_pool_base_unittest.cc +++ b/net/socket/client_socket_pool_base_unittest.cc @@ -45,14 +45,12 @@ typedef ClientSocketPoolBase<TestSocketParams> TestClientSocketPoolBase; class MockClientSocket : public StreamSocket { public: - MockClientSocket() : connected_(false), was_used_to_convey_data_(false), - num_bytes_read_(0) {} + MockClientSocket() : connected_(false), was_used_to_convey_data_(false) {} // Socket methods: virtual int Read( - IOBuffer* /* buf */, int len, CompletionCallback* /* callback */) { - num_bytes_read_ += len; - return len; + IOBuffer* /* buf */, int /* len */, CompletionCallback* /* callback */) { + return ERR_UNEXPECTED; } virtual int Write( @@ -88,22 +86,13 @@ class MockClientSocket : public StreamSocket { virtual void SetSubresourceSpeculation() {} virtual void SetOmniboxSpeculation() {} - virtual bool WasEverUsed() const { - return was_used_to_convey_data_ || num_bytes_read_ > 0; - } + virtual bool WasEverUsed() const { return was_used_to_convey_data_; } virtual bool UsingTCPFastOpen() const { return false; } - virtual int64 NumBytesRead() const { return num_bytes_read_; } - virtual base::TimeDelta GetConnectTimeMicros() const { - static const base::TimeDelta kDummyConnectTimeMicros = - base::TimeDelta::FromMicroseconds(10); - return kDummyConnectTimeMicros; // Dummy value. - } private: bool connected_; BoundNetLog net_log_; bool was_used_to_convey_data_; - int num_bytes_read_; DISALLOW_COPY_AND_ASSIGN(MockClientSocket); }; @@ -615,71 +604,6 @@ class ClientSocketPoolBaseTest : public testing::Test { ClientSocketPoolTest test_base_; }; -TEST_F(ClientSocketPoolBaseTest, AssignIdleSocketToGroup_WarmestSocket) { - CreatePool(4, 4); - net::SetSocketReusePolicy(0); - - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - - std::map<int, StreamSocket*> sockets_; - for (size_t i = 0; i < test_base_.requests_size(); i++) { - TestSocketRequest* req = test_base_.request(i); - StreamSocket* s = req->handle()->socket(); - MockClientSocket* sock = static_cast<MockClientSocket*>(s); - CHECK(sock); - sockets_[i] = sock; - sock->Read(NULL, 1024 - i, NULL); - } - - ReleaseAllConnections(ClientSocketPoolTest::KEEP_ALIVE); - - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - TestSocketRequest* req = test_base_.request(test_base_.requests_size() - 1); - - // First socket is warmest. - EXPECT_EQ(sockets_[0], req->handle()->socket()); - - // Test that NumBytes are as expected. - EXPECT_EQ(1024, sockets_[0]->NumBytesRead()); - EXPECT_EQ(1023, sockets_[1]->NumBytesRead()); - EXPECT_EQ(1022, sockets_[2]->NumBytesRead()); - EXPECT_EQ(1021, sockets_[3]->NumBytesRead()); - - ReleaseAllConnections(ClientSocketPoolTest::NO_KEEP_ALIVE); -} - -TEST_F(ClientSocketPoolBaseTest, AssignIdleSocketToGroup_LastAccessedSocket) { - CreatePool(4, 4); - net::SetSocketReusePolicy(2); - - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - - std::map<int, StreamSocket*> sockets_; - for (size_t i = 0; i < test_base_.requests_size(); i++) { - TestSocketRequest* req = test_base_.request(i); - StreamSocket* s = req->handle()->socket(); - MockClientSocket* sock = static_cast<MockClientSocket*>(s); - CHECK(sock); - sockets_[i] = sock; - sock->Read(NULL, 1024 - i, NULL); - } - - ReleaseAllConnections(ClientSocketPoolTest::KEEP_ALIVE); - - EXPECT_EQ(OK, StartRequest("a", kDefaultPriority)); - TestSocketRequest* req = test_base_.request(test_base_.requests_size() - 1); - - // Last socket is most recently accessed. - EXPECT_EQ(sockets_[3], req->handle()->socket()); - ReleaseAllConnections(ClientSocketPoolTest::NO_KEEP_ALIVE); -} - // Even though a timeout is specified, it doesn't time out on a synchronous // completion. TEST_F(ClientSocketPoolBaseTest, ConnectJob_NoTimeoutOnSynchronousCompletion) { diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index 0573f73..4e4e8fe 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -707,7 +707,6 @@ MockTCPClientSocket::MockTCPClientSocket(const net::AddressList& addresses, addresses_(addresses), data_(data), read_offset_(0), - num_bytes_read_(0), read_data_(false, net::ERR_UNEXPECTED), need_read_data_(true), peer_closed_connection_(false), @@ -812,17 +811,6 @@ bool MockTCPClientSocket::UsingTCPFastOpen() const { return false; } -int64 MockTCPClientSocket::NumBytesRead() const { - return num_bytes_read_; -} - -base::TimeDelta MockTCPClientSocket::GetConnectTimeMicros() const { - // Dummy value. - static const base::TimeDelta kTestingConnectTimeMicros = - base::TimeDelta::FromMicroseconds(20); - return kTestingConnectTimeMicros; -} - void MockTCPClientSocket::OnReadComplete(const MockRead& data) { // There must be a read pending. DCHECK(pending_buf_); @@ -865,7 +853,6 @@ int MockTCPClientSocket::CompleteRead() { result = std::min(buf_len, read_data_.data_len - read_offset_); memcpy(buf->data(), read_data_.data + read_offset_, result); read_offset_ += result; - num_bytes_read_ += result; if (read_offset_ == read_data_.data_len) { need_read_data_ = true; read_offset_ = 0; @@ -1014,14 +1001,6 @@ bool DeterministicMockTCPClientSocket::UsingTCPFastOpen() const { return false; } -int64 DeterministicMockTCPClientSocket::NumBytesRead() const { - return -1; -} - -base::TimeDelta DeterministicMockTCPClientSocket::GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); -} - void DeterministicMockTCPClientSocket::OnReadComplete(const MockRead& data) {} class MockSSLClientSocket::ConnectCallback @@ -1115,14 +1094,6 @@ bool MockSSLClientSocket::UsingTCPFastOpen() const { return transport_->socket()->UsingTCPFastOpen(); } -int64 MockSSLClientSocket::NumBytesRead() const { - return -1; -} - -base::TimeDelta MockSSLClientSocket::GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); -} - void MockSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { ssl_info->Reset(); ssl_info->cert = data_->cert_; diff --git a/net/socket/socket_test_util.h b/net/socket/socket_test_util.h index d1f4816..9a31288 100644 --- a/net/socket/socket_test_util.h +++ b/net/socket/socket_test_util.h @@ -631,8 +631,6 @@ class MockTCPClientSocket : public MockClientSocket { virtual int GetPeerAddress(AddressList* address) const; virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // MockClientSocket: virtual void OnReadComplete(const MockRead& data); @@ -644,7 +642,6 @@ class MockTCPClientSocket : public MockClientSocket { net::SocketDataProvider* data_; int read_offset_; - int num_bytes_read_; net::MockRead read_data_; bool need_read_data_; @@ -686,8 +683,6 @@ class DeterministicMockTCPClientSocket : public MockClientSocket, virtual bool IsConnectedAndIdle() const; virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // MockClientSocket: virtual void OnReadComplete(const MockRead& data); @@ -729,8 +724,6 @@ class MockSSLClientSocket : public MockClientSocket { virtual bool IsConnected() const; virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // SSLClientSocket methods: virtual void GetSSLInfo(net::SSLInfo* ssl_info); diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc index 2f5cee4..7a1c10d 100644 --- a/net/socket/socks5_client_socket.cc +++ b/net/socket/socks5_client_socket.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -142,22 +142,6 @@ bool SOCKS5ClientSocket::UsingTCPFastOpen() const { return false; } -int64 SOCKS5ClientSocket::NumBytesRead() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->NumBytesRead(); - } - NOTREACHED(); - return -1; -} - -base::TimeDelta SOCKS5ClientSocket::GetConnectTimeMicros() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->GetConnectTimeMicros(); - } - NOTREACHED(); - return base::TimeDelta::FromMicroseconds(-1); -} - // Read is called by the transport layer above to read. This can only be done // if the SOCKS handshake is complete. int SOCKS5ClientSocket::Read(IOBuffer* buf, int buf_len, diff --git a/net/socket/socks5_client_socket.h b/net/socket/socks5_client_socket.h index a9d30df..955ad90 100644 --- a/net/socket/socks5_client_socket.h +++ b/net/socket/socks5_client_socket.h @@ -60,8 +60,6 @@ class NET_TEST SOCKS5ClientSocket : public StreamSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/socket/socks_client_socket.cc b/net/socket/socks_client_socket.cc index 4a45b01..d885f15 100644 --- a/net/socket/socks_client_socket.cc +++ b/net/socket/socks_client_socket.cc @@ -169,22 +169,6 @@ bool SOCKSClientSocket::UsingTCPFastOpen() const { return false; } -int64 SOCKSClientSocket::NumBytesRead() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->NumBytesRead(); - } - NOTREACHED(); - return -1; -} - -base::TimeDelta SOCKSClientSocket::GetConnectTimeMicros() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->GetConnectTimeMicros(); - } - NOTREACHED(); - return base::TimeDelta::FromMicroseconds(-1); -} - // Read is called by the transport layer above to read. This can only be done // if the SOCKS handshake is complete. diff --git a/net/socket/socks_client_socket.h b/net/socket/socks_client_socket.h index 286538f..7c4ba35 100644 --- a/net/socket/socks_client_socket.h +++ b/net/socket/socks_client_socket.h @@ -58,8 +58,6 @@ class NET_TEST SOCKSClientSocket : public StreamSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/socket/ssl_client_socket_mac.cc b/net/socket/ssl_client_socket_mac.cc index c38b78a..2fc11ec 100644 --- a/net/socket/ssl_client_socket_mac.cc +++ b/net/socket/ssl_client_socket_mac.cc @@ -658,22 +658,6 @@ bool SSLClientSocketMac::UsingTCPFastOpen() const { return false; } -int64 SSLClientSocketMac::NumBytesRead() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->NumBytesRead(); - } - NOTREACHED(); - return -1; -} - -base::TimeDelta SSLClientSocketMac::GetConnectTimeMicros() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->GetConnectTimeMicros(); - } - NOTREACHED(); - return base::TimeDelta::FromMicroseconds(-1); -} - int SSLClientSocketMac::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { DCHECK(completed_handshake()); diff --git a/net/socket/ssl_client_socket_mac.h b/net/socket/ssl_client_socket_mac.h index 8ef33e9..4dbffe6 100644 --- a/net/socket/ssl_client_socket_mac.h +++ b/net/socket/ssl_client_socket_mac.h @@ -57,8 +57,6 @@ class SSLClientSocketMac : public SSLClientSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc index 9657026..18b4e58 100644 --- a/net/socket/ssl_client_socket_nss.cc +++ b/net/socket/ssl_client_socket_nss.cc @@ -714,22 +714,6 @@ bool SSLClientSocketNSS::UsingTCPFastOpen() const { return false; } -int64 SSLClientSocketNSS::NumBytesRead() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->NumBytesRead(); - } - NOTREACHED(); - return -1; -} - -base::TimeDelta SSLClientSocketNSS::GetConnectTimeMicros() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->GetConnectTimeMicros(); - } - NOTREACHED(); - return base::TimeDelta::FromMicroseconds(-1); -} - int SSLClientSocketNSS::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { EnterFunction(buf_len); diff --git a/net/socket/ssl_client_socket_nss.h b/net/socket/ssl_client_socket_nss.h index 7d2f7cf..1c5d80e 100644 --- a/net/socket/ssl_client_socket_nss.h +++ b/net/socket/ssl_client_socket_nss.h @@ -75,8 +75,6 @@ class SSLClientSocketNSS : public SSLClientSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/socket/ssl_client_socket_win.cc b/net/socket/ssl_client_socket_win.cc index 4cc3103..1392e1d 100644 --- a/net/socket/ssl_client_socket_win.cc +++ b/net/socket/ssl_client_socket_win.cc @@ -731,22 +731,6 @@ bool SSLClientSocketWin::UsingTCPFastOpen() const { return false; } -int64 SSLClientSocketWin::NumBytesRead() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->NumBytesRead(); - } - NOTREACHED(); - return -1; -} - -base::TimeDelta SSLClientSocketWin::GetConnectTimeMicros() const { - if (transport_.get() && transport_->socket()) { - return transport_->socket()->GetConnectTimeMicros(); - } - NOTREACHED(); - return base::TimeDelta::FromMicroseconds(-1); -} - int SSLClientSocketWin::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { DCHECK(completed_handshake()); diff --git a/net/socket/ssl_client_socket_win.h b/net/socket/ssl_client_socket_win.h index 59f403a..fb54c43 100644 --- a/net/socket/ssl_client_socket_win.h +++ b/net/socket/ssl_client_socket_win.h @@ -62,8 +62,6 @@ class SSLClientSocketWin : public SSLClientSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); diff --git a/net/socket/ssl_server_socket_nss.cc b/net/socket/ssl_server_socket_nss.cc index b272f8e..0f35ce9c 100644 --- a/net/socket/ssl_server_socket_nss.cc +++ b/net/socket/ssl_server_socket_nss.cc @@ -226,14 +226,6 @@ bool SSLServerSocketNSS::UsingTCPFastOpen() const { return transport_socket_->UsingTCPFastOpen(); } -int64 SSLServerSocketNSS::NumBytesRead() const { - return transport_socket_->NumBytesRead(); -} - -base::TimeDelta SSLServerSocketNSS::GetConnectTimeMicros() const { - return transport_socket_->GetConnectTimeMicros(); -} - int SSLServerSocketNSS::InitializeSSLOptions() { // Transport connected, now hook it up to nss // TODO(port): specify rx and tx buffer sizes separately diff --git a/net/socket/ssl_server_socket_nss.h b/net/socket/ssl_server_socket_nss.h index 5903c17..366a915 100644 --- a/net/socket/ssl_server_socket_nss.h +++ b/net/socket/ssl_server_socket_nss.h @@ -54,8 +54,6 @@ class SSLServerSocketNSS : public SSLServerSocket { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; private: enum State { diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc index de89c20..02f333b 100644 --- a/net/socket/ssl_server_socket_unittest.cc +++ b/net/socket/ssl_server_socket_unittest.cc @@ -171,14 +171,6 @@ class FakeSocket : public StreamSocket { return false; } - virtual int64 NumBytesRead() const { - return -1; - } - - virtual base::TimeDelta GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); - } - private: net::BoundNetLog net_log_; FakeDataChannel* incoming_; diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h index ef2f698..544fbcd 100644 --- a/net/socket/stream_socket.h +++ b/net/socket/stream_socket.h @@ -6,7 +6,6 @@ #define NET_SOCKET_STREAM_SOCKET_H_ #pragma once -#include "base/time.h" #include "net/base/net_log.h" #include "net/socket/socket.h" @@ -80,12 +79,6 @@ class NET_TEST StreamSocket : public Socket { // TCP FastOpen is an experiment with sending data in the TCP SYN packet. virtual bool UsingTCPFastOpen() const = 0; - // Returns the number of bytes successfully read from this socket. - virtual int64 NumBytesRead() const = 0; - - // Returns the connection setup time of this socket. - virtual base::TimeDelta GetConnectTimeMicros() const = 0; - protected: // The following class is only used to gather statistics about the history of // a socket. It is only instantiated and used in basic sockets, such as diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc index 27c106c..38c3446 100644 --- a/net/socket/tcp_client_socket_libevent.cc +++ b/net/socket/tcp_client_socket_libevent.cc @@ -137,8 +137,7 @@ TCPClientSocketLibevent::TCPClientSocketLibevent( net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)), previously_disconnected_(false), use_tcp_fastopen_(false), - tcp_fastopen_connected_(false), - num_bytes_read_(0) { + tcp_fastopen_connected_(false) { scoped_refptr<NetLog::EventParameters> params; if (source.is_valid()) params = new NetLogSourceParameter("source_dependency", source); @@ -299,7 +298,6 @@ int TCPClientSocketLibevent::DoConnect() { // Connect the socket. if (!use_tcp_fastopen_) { - connect_start_time_ = base::TimeTicks::Now(); if (!HANDLE_EINTR(connect(socket_, current_ai_->ai_addr, static_cast<int>(current_ai_->ai_addrlen)))) { // Connected without waiting! @@ -341,7 +339,6 @@ int TCPClientSocketLibevent::DoConnectComplete(int result) { write_socket_watcher_.StopWatchingFileDescriptor(); if (result == OK) { - connect_time_micros_ = base::TimeTicks::Now() - connect_start_time_; use_history_.set_was_ever_connected(); return OK; // Done! } @@ -443,7 +440,6 @@ int TCPClientSocketLibevent::Read(IOBuffer* buf, if (nread >= 0) { base::StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(nread); - num_bytes_read_ += static_cast<int64>(nread); if (nread > 0) use_history_.set_was_used_to_convey_data(); net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, nread, @@ -638,7 +634,6 @@ void TCPClientSocketLibevent::DidCompleteRead() { result = bytes_transferred; base::StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(bytes_transferred); - num_bytes_read_ += static_cast<int64>(bytes_transferred); if (bytes_transferred > 0) use_history_.set_was_used_to_convey_data(); net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, result, @@ -728,12 +723,4 @@ bool TCPClientSocketLibevent::UsingTCPFastOpen() const { return use_tcp_fastopen_; } -int64 TCPClientSocketLibevent::NumBytesRead() const { - return num_bytes_read_; -} - -base::TimeDelta TCPClientSocketLibevent::GetConnectTimeMicros() const { - return connect_time_micros_; -} - } // namespace net diff --git a/net/socket/tcp_client_socket_libevent.h b/net/socket/tcp_client_socket_libevent.h index f5e4a28..607b9ee 100644 --- a/net/socket/tcp_client_socket_libevent.h +++ b/net/socket/tcp_client_socket_libevent.h @@ -53,8 +53,6 @@ class TCPClientSocketLibevent : public StreamSocket, base::NonThreadSafe { virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: // Multiple outstanding requests are not supported. @@ -197,10 +195,6 @@ class TCPClientSocketLibevent : public StreamSocket, base::NonThreadSafe { // True when TCP FastOpen is in use and we have done the connect. bool tcp_fastopen_connected_; - base::TimeTicks connect_start_time_; - base::TimeDelta connect_time_micros_; - int64 num_bytes_read_; - DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); }; diff --git a/net/socket/tcp_client_socket_win.cc b/net/socket/tcp_client_socket_win.cc index f4026b7..71187a1 100644 --- a/net/socket/tcp_client_socket_win.cc +++ b/net/socket/tcp_client_socket_win.cc @@ -323,8 +323,7 @@ TCPClientSocketWin::TCPClientSocketWin(const AddressList& addresses, next_connect_state_(CONNECT_STATE_NONE), connect_os_error_(0), net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)), - previously_disconnected_(false), - num_bytes_read_(0) { + previously_disconnected_(false) { scoped_refptr<NetLog::EventParameters> params; if (source.is_valid()) params = new NetLogSourceParameter("source_dependency", source); @@ -485,7 +484,6 @@ int TCPClientSocketWin::DoConnect() { core_->write_overlapped_.hEvent = WSACreateEvent(); - connect_start_time_ = base::TimeTicks::Now(); if (!connect(socket_, ai->ai_addr, static_cast<int>(ai->ai_addrlen))) { // Connected without waiting! // @@ -524,7 +522,6 @@ int TCPClientSocketWin::DoConnectComplete(int result) { net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT, params); if (result == OK) { - connect_time_micros_ = base::TimeTicks::Now() - connect_start_time_; use_history_.set_was_ever_connected(); return OK; // Done! } @@ -661,14 +658,6 @@ bool TCPClientSocketWin::UsingTCPFastOpen() const { return false; } -int64 TCPClientSocketWin::NumBytesRead() const { - return num_bytes_read_; -} - -base::TimeDelta TCPClientSocketWin::GetConnectTimeMicros() const { - return connect_time_micros_; -} - int TCPClientSocketWin::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { @@ -699,7 +688,6 @@ int TCPClientSocketWin::Read(IOBuffer* buf, base::MemoryDebug::MarkAsInitialized(core_->read_buffer_.buf, num); base::StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(num); - num_bytes_read_ += num; if (num > 0) use_history_.set_was_used_to_convey_data(); net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, num, @@ -870,7 +858,6 @@ void TCPClientSocketWin::DidCompleteRead() { if (ok) { base::StatsCounter read_bytes("tcp.read_bytes"); read_bytes.Add(num_bytes); - num_bytes_read_ += num_bytes; if (num_bytes > 0) use_history_.set_was_used_to_convey_data(); net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, diff --git a/net/socket/tcp_client_socket_win.h b/net/socket/tcp_client_socket_win.h index b1f9f3b..3282772 100644 --- a/net/socket/tcp_client_socket_win.h +++ b/net/socket/tcp_client_socket_win.h @@ -53,8 +53,6 @@ class NET_API TCPClientSocketWin : public StreamSocket, virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: // Multiple outstanding requests are not supported. @@ -143,10 +141,6 @@ class NET_API TCPClientSocketWin : public StreamSocket, // histograms. UseHistory use_history_; - base::TimeTicks connect_start_time_; - base::TimeDelta connect_time_micros_; - int64 num_bytes_read_; - DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); }; diff --git a/net/socket/transport_client_socket_pool_unittest.cc b/net/socket/transport_client_socket_pool_unittest.cc index d12cd9d..5716a4d 100644 --- a/net/socket/transport_client_socket_pool_unittest.cc +++ b/net/socket/transport_client_socket_pool_unittest.cc @@ -85,10 +85,6 @@ class MockClientSocket : public StreamSocket { virtual void SetOmniboxSpeculation() {} virtual bool WasEverUsed() const { return false; } virtual bool UsingTCPFastOpen() const { return false; } - virtual int64 NumBytesRead() const { return -1; } - virtual base::TimeDelta GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); - } // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, @@ -139,10 +135,6 @@ class MockFailingClientSocket : public StreamSocket { virtual void SetOmniboxSpeculation() {} virtual bool WasEverUsed() const { return false; } virtual bool UsingTCPFastOpen() const { return false; } - virtual int64 NumBytesRead() const { return -1; } - virtual base::TimeDelta GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); - } // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, @@ -217,10 +209,6 @@ class MockPendingClientSocket : public StreamSocket { virtual void SetOmniboxSpeculation() {} virtual bool WasEverUsed() const { return false; } virtual bool UsingTCPFastOpen() const { return false; } - virtual int64 NumBytesRead() const { return -1; } - virtual base::TimeDelta GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); - } // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, diff --git a/net/socket/transport_client_socket_unittest.cc b/net/socket/transport_client_socket_unittest.cc index 8f377e5..bb0be35 100644 --- a/net/socket/transport_client_socket_unittest.cc +++ b/net/socket/transport_client_socket_unittest.cc @@ -277,8 +277,6 @@ TEST_P(TransportClientSocketTest, Read) { rv = sock_->Read(buf, 4096, &callback); ASSERT_EQ(ERR_IO_PENDING, rv); - EXPECT_EQ(static_cast<int64>(std::string(kServerReply).size()), - sock_->NumBytesRead()); CloseServerSocket(); EXPECT_EQ(0, callback.WaitForResult()); } @@ -311,8 +309,6 @@ TEST_P(TransportClientSocketTest, Read_SmallChunks) { // then close the server socket, and note the close. rv = sock_->Read(buf, 1, &callback); - EXPECT_EQ(static_cast<int64>(std::string(kServerReply).size()), - sock_->NumBytesRead()); ASSERT_EQ(ERR_IO_PENDING, rv); CloseServerSocket(); EXPECT_EQ(0, callback.WaitForResult()); @@ -333,12 +329,9 @@ TEST_P(TransportClientSocketTest, Read_Interrupted) { scoped_refptr<IOBuffer> buf(new IOBuffer(16)); rv = sock_->Read(buf, 16, &callback); EXPECT_TRUE(rv >= 0 || rv == ERR_IO_PENDING); - EXPECT_EQ(0, sock_->NumBytesRead()); - if (rv == ERR_IO_PENDING) { + if (rv == ERR_IO_PENDING) rv = callback.WaitForResult(); - EXPECT_EQ(16, sock_->NumBytesRead()); - } EXPECT_NE(0, rv); } diff --git a/net/spdy/spdy_http_stream.h b/net/spdy/spdy_http_stream.h index b6727e5..88c627d 100644 --- a/net/spdy/spdy_http_stream.h +++ b/net/spdy/spdy_http_stream.h @@ -68,7 +68,6 @@ class NET_TEST SpdyHttpStream : public SpdyStream::Delegate, public HttpStream { virtual void GetSSLCertRequestInfo( SSLCertRequestInfo* cert_request_info) OVERRIDE; virtual bool IsSpdyHttpStream() const OVERRIDE; - virtual void LogNumRttVsBytesMetrics() const OVERRIDE {} // SpdyStream::Delegate methods: virtual bool OnSendHeadersComplete(int status) OVERRIDE; diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc index c5733cf..1e6e23a 100644 --- a/net/spdy/spdy_proxy_client_socket.cc +++ b/net/spdy/spdy_proxy_client_socket.cc @@ -138,14 +138,6 @@ bool SpdyProxyClientSocket::UsingTCPFastOpen() const { return false; } -int64 SpdyProxyClientSocket::NumBytesRead() const { - return -1; -} - -base::TimeDelta SpdyProxyClientSocket::GetConnectTimeMicros() const { - return base::TimeDelta::FromMicroseconds(-1); -} - int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, CompletionCallback* callback) { DCHECK(!read_callback_); diff --git a/net/spdy/spdy_proxy_client_socket.h b/net/spdy/spdy_proxy_client_socket.h index e6598ea..d7510d1 100644 --- a/net/spdy/spdy_proxy_client_socket.h +++ b/net/spdy/spdy_proxy_client_socket.h @@ -77,8 +77,6 @@ class NET_TEST SpdyProxyClientSocket : public ProxyClientSocket, virtual void SetOmniboxSpeculation(); virtual bool WasEverUsed() const; virtual bool UsingTCPFastOpen() const; - virtual int64 NumBytesRead() const; - virtual base::TimeDelta GetConnectTimeMicros() const; // Socket methods: virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |