OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/socket/client_socket_pool_base.h" | 5 #include "net/socket/client_socket_pool_base.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 virtual bool WasEverUsed() const { | 109 virtual bool WasEverUsed() const { |
110 return was_used_to_convey_data_ || num_bytes_read_ > 0; | 110 return was_used_to_convey_data_ || num_bytes_read_ > 0; |
111 } | 111 } |
112 virtual bool UsingTCPFastOpen() const { return false; } | 112 virtual bool UsingTCPFastOpen() const { return false; } |
113 virtual int64 NumBytesRead() const { return num_bytes_read_; } | 113 virtual int64 NumBytesRead() const { return num_bytes_read_; } |
114 virtual base::TimeDelta GetConnectTimeMicros() const { | 114 virtual base::TimeDelta GetConnectTimeMicros() const { |
115 static const base::TimeDelta kDummyConnectTimeMicros = | 115 static const base::TimeDelta kDummyConnectTimeMicros = |
116 base::TimeDelta::FromMicroseconds(10); | 116 base::TimeDelta::FromMicroseconds(10); |
117 return kDummyConnectTimeMicros; // Dummy value. | 117 return kDummyConnectTimeMicros; // Dummy value. |
118 } | 118 } |
| 119 virtual bool WasNpnNegotiated() const { |
| 120 return false; |
| 121 } |
119 virtual NextProto GetNegotiatedProtocol() const { | 122 virtual NextProto GetNegotiatedProtocol() const { |
120 return kProtoUnknown; | 123 return kProtoUnknown; |
121 } | 124 } |
| 125 virtual bool GetSSLInfo(SSLInfo* ssl_info) { |
| 126 return false; |
| 127 } |
122 | 128 |
123 private: | 129 private: |
124 bool connected_; | 130 bool connected_; |
125 BoundNetLog net_log_; | 131 BoundNetLog net_log_; |
126 bool was_used_to_convey_data_; | 132 bool was_used_to_convey_data_; |
127 int num_bytes_read_; | 133 int num_bytes_read_; |
128 | 134 |
129 DISALLOW_COPY_AND_ASSIGN(MockClientSocket); | 135 DISALLOW_COPY_AND_ASSIGN(MockClientSocket); |
130 }; | 136 }; |
131 | 137 |
(...skipping 3386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3518 // complete. | 3524 // complete. |
3519 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); | 3525 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); |
3520 EXPECT_EQ(0, pool_->NumUnassignedConnectJobsInGroup("a")); | 3526 EXPECT_EQ(0, pool_->NumUnassignedConnectJobsInGroup("a")); |
3521 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); | 3527 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); |
3522 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); | 3528 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); |
3523 } | 3529 } |
3524 | 3530 |
3525 } // namespace | 3531 } // namespace |
3526 | 3532 |
3527 } // namespace net | 3533 } // namespace net |
OLD | NEW |