OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/transport_client_socket_pool.h" | 5 #include "net/socket/transport_client_socket_pool.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return OK; | 78 return OK; |
79 } | 79 } |
80 virtual const BoundNetLog& NetLog() const { | 80 virtual const BoundNetLog& NetLog() const { |
81 return net_log_; | 81 return net_log_; |
82 } | 82 } |
83 | 83 |
84 virtual void SetSubresourceSpeculation() {} | 84 virtual void SetSubresourceSpeculation() {} |
85 virtual void SetOmniboxSpeculation() {} | 85 virtual void SetOmniboxSpeculation() {} |
86 virtual bool WasEverUsed() const { return false; } | 86 virtual bool WasEverUsed() const { return false; } |
87 virtual bool UsingTCPFastOpen() const { return false; } | 87 virtual bool UsingTCPFastOpen() const { return false; } |
| 88 virtual int64 NumBytesRead() const { return -1; } |
| 89 virtual base::TimeDelta GetConnectTimeMicros() const { |
| 90 return base::TimeDelta::FromMicroseconds(-1); |
| 91 } |
88 | 92 |
89 // Socket methods: | 93 // Socket methods: |
90 virtual int Read(IOBuffer* buf, int buf_len, | 94 virtual int Read(IOBuffer* buf, int buf_len, |
91 CompletionCallback* callback) { | 95 CompletionCallback* callback) { |
92 return ERR_FAILED; | 96 return ERR_FAILED; |
93 } | 97 } |
94 virtual int Write(IOBuffer* buf, int buf_len, | 98 virtual int Write(IOBuffer* buf, int buf_len, |
95 CompletionCallback* callback) { | 99 CompletionCallback* callback) { |
96 return ERR_FAILED; | 100 return ERR_FAILED; |
97 } | 101 } |
(...skipping 30 matching lines...) Expand all Loading... |
128 return ERR_UNEXPECTED; | 132 return ERR_UNEXPECTED; |
129 } | 133 } |
130 virtual const BoundNetLog& NetLog() const { | 134 virtual const BoundNetLog& NetLog() const { |
131 return net_log_; | 135 return net_log_; |
132 } | 136 } |
133 | 137 |
134 virtual void SetSubresourceSpeculation() {} | 138 virtual void SetSubresourceSpeculation() {} |
135 virtual void SetOmniboxSpeculation() {} | 139 virtual void SetOmniboxSpeculation() {} |
136 virtual bool WasEverUsed() const { return false; } | 140 virtual bool WasEverUsed() const { return false; } |
137 virtual bool UsingTCPFastOpen() const { return false; } | 141 virtual bool UsingTCPFastOpen() const { return false; } |
| 142 virtual int64 NumBytesRead() const { return -1; } |
| 143 virtual base::TimeDelta GetConnectTimeMicros() const { |
| 144 return base::TimeDelta::FromMicroseconds(-1); |
| 145 } |
138 | 146 |
139 // Socket methods: | 147 // Socket methods: |
140 virtual int Read(IOBuffer* buf, int buf_len, | 148 virtual int Read(IOBuffer* buf, int buf_len, |
141 CompletionCallback* callback) { | 149 CompletionCallback* callback) { |
142 return ERR_FAILED; | 150 return ERR_FAILED; |
143 } | 151 } |
144 | 152 |
145 virtual int Write(IOBuffer* buf, int buf_len, | 153 virtual int Write(IOBuffer* buf, int buf_len, |
146 CompletionCallback* callback) { | 154 CompletionCallback* callback) { |
147 return ERR_FAILED; | 155 return ERR_FAILED; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return OK; | 210 return OK; |
203 } | 211 } |
204 virtual const BoundNetLog& NetLog() const { | 212 virtual const BoundNetLog& NetLog() const { |
205 return net_log_; | 213 return net_log_; |
206 } | 214 } |
207 | 215 |
208 virtual void SetSubresourceSpeculation() {} | 216 virtual void SetSubresourceSpeculation() {} |
209 virtual void SetOmniboxSpeculation() {} | 217 virtual void SetOmniboxSpeculation() {} |
210 virtual bool WasEverUsed() const { return false; } | 218 virtual bool WasEverUsed() const { return false; } |
211 virtual bool UsingTCPFastOpen() const { return false; } | 219 virtual bool UsingTCPFastOpen() const { return false; } |
| 220 virtual int64 NumBytesRead() const { return -1; } |
| 221 virtual base::TimeDelta GetConnectTimeMicros() const { |
| 222 return base::TimeDelta::FromMicroseconds(-1); |
| 223 } |
212 | 224 |
213 // Socket methods: | 225 // Socket methods: |
214 virtual int Read(IOBuffer* buf, int buf_len, | 226 virtual int Read(IOBuffer* buf, int buf_len, |
215 CompletionCallback* callback) { | 227 CompletionCallback* callback) { |
216 return ERR_FAILED; | 228 return ERR_FAILED; |
217 } | 229 } |
218 | 230 |
219 virtual int Write(IOBuffer* buf, int buf_len, | 231 virtual int Write(IOBuffer* buf, int buf_len, |
220 CompletionCallback* callback) { | 232 CompletionCallback* callback) { |
221 return ERR_FAILED; | 233 return ERR_FAILED; |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 EXPECT_TRUE(handle.socket()); | 1232 EXPECT_TRUE(handle.socket()); |
1221 IPEndPoint endpoint; | 1233 IPEndPoint endpoint; |
1222 handle.socket()->GetLocalAddress(&endpoint); | 1234 handle.socket()->GetLocalAddress(&endpoint); |
1223 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); | 1235 EXPECT_EQ(kIPv4AddressSize, endpoint.address().size()); |
1224 EXPECT_EQ(1, client_socket_factory_.allocation_count()); | 1236 EXPECT_EQ(1, client_socket_factory_.allocation_count()); |
1225 } | 1237 } |
1226 | 1238 |
1227 } // namespace | 1239 } // namespace |
1228 | 1240 |
1229 } // namespace net | 1241 } // namespace net |
OLD | NEW |