| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/sys_byteorder.h" | 10 #include "base/sys_byteorder.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual void Disconnect() OVERRIDE; | 66 virtual void Disconnect() OVERRIDE; |
| 67 virtual bool IsConnected() const OVERRIDE; | 67 virtual bool IsConnected() const OVERRIDE; |
| 68 virtual bool IsConnectedAndIdle() const OVERRIDE; | 68 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 69 virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; | 69 virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; |
| 70 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; | 70 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; |
| 71 virtual const net::BoundNetLog& NetLog() const OVERRIDE; | 71 virtual const net::BoundNetLog& NetLog() const OVERRIDE; |
| 72 virtual void SetSubresourceSpeculation() OVERRIDE; | 72 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 73 virtual void SetOmniboxSpeculation() OVERRIDE; | 73 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 74 virtual bool WasEverUsed() const OVERRIDE; | 74 virtual bool WasEverUsed() const OVERRIDE; |
| 75 virtual bool UsingTCPFastOpen() const OVERRIDE; | 75 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 76 virtual int64 NumBytesRead() const OVERRIDE; | |
| 77 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | |
| 78 virtual bool WasNpnNegotiated() const OVERRIDE; | 76 virtual bool WasNpnNegotiated() const OVERRIDE; |
| 79 virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE; | 77 virtual net::NextProto GetNegotiatedProtocol() const OVERRIDE; |
| 80 virtual bool GetSSLInfo(net::SSLInfo* ssl_info) OVERRIDE; | 78 virtual bool GetSSLInfo(net::SSLInfo* ssl_info) OVERRIDE; |
| 81 | 79 |
| 82 private: | 80 private: |
| 83 bool read_pending_; | 81 bool read_pending_; |
| 84 scoped_refptr<net::IOBuffer> read_buffer_; | 82 scoped_refptr<net::IOBuffer> read_buffer_; |
| 85 int read_buffer_size_; | 83 int read_buffer_size_; |
| 86 net::CompletionCallback read_callback_; | 84 net::CompletionCallback read_callback_; |
| 87 | 85 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 } | 204 } |
| 207 | 205 |
| 208 bool FakeSocket::WasEverUsed() const { | 206 bool FakeSocket::WasEverUsed() const { |
| 209 return true; | 207 return true; |
| 210 } | 208 } |
| 211 | 209 |
| 212 bool FakeSocket::UsingTCPFastOpen() const { | 210 bool FakeSocket::UsingTCPFastOpen() const { |
| 213 return false; | 211 return false; |
| 214 } | 212 } |
| 215 | 213 |
| 216 int64 FakeSocket::NumBytesRead() const { | |
| 217 return -1; | |
| 218 } | |
| 219 | |
| 220 base::TimeDelta FakeSocket::GetConnectTimeMicros() const { | |
| 221 return base::TimeDelta::FromMicroseconds(-1); | |
| 222 } | |
| 223 | |
| 224 bool FakeSocket::WasNpnNegotiated() const { | 214 bool FakeSocket::WasNpnNegotiated() const { |
| 225 return false; | 215 return false; |
| 226 } | 216 } |
| 227 | 217 |
| 228 net::NextProto FakeSocket::GetNegotiatedProtocol() const { | 218 net::NextProto FakeSocket::GetNegotiatedProtocol() const { |
| 229 return net::kProtoUnknown; | 219 return net::kProtoUnknown; |
| 230 } | 220 } |
| 231 | 221 |
| 232 bool FakeSocket::GetSSLInfo(net::SSLInfo* ssl_info) { | 222 bool FakeSocket::GetSSLInfo(net::SSLInfo* ssl_info) { |
| 233 return false; | 223 return false; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 return false; | 278 return false; |
| 289 P2PMsg_OnIncomingTcpConnection::Param params; | 279 P2PMsg_OnIncomingTcpConnection::Param params; |
| 290 P2PMsg_OnIncomingTcpConnection::Read( | 280 P2PMsg_OnIncomingTcpConnection::Read( |
| 291 arg, ¶ms); | 281 arg, ¶ms); |
| 292 return params.b == address; | 282 return params.b == address; |
| 293 } | 283 } |
| 294 | 284 |
| 295 } // namespace | 285 } // namespace |
| 296 | 286 |
| 297 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 287 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
| OLD | NEW |