| 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 "content/common/p2p_messages.h" | 10 #include "content/common/p2p_messages.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 int input_pos() const { return input_pos_; } | 38 int input_pos() const { return input_pos_; } |
| 39 bool read_pending() const { return read_pending_; } | 39 bool read_pending() const { return read_pending_; } |
| 40 void SetPeerAddress(const net::IPEndPoint& peer_address); | 40 void SetPeerAddress(const net::IPEndPoint& peer_address); |
| 41 void SetLocalAddress(const net::IPEndPoint& local_address); | 41 void SetLocalAddress(const net::IPEndPoint& local_address); |
| 42 | 42 |
| 43 // net::Socket implementation. | 43 // net::Socket implementation. |
| 44 virtual int Read(net::IOBuffer* buf, int buf_len, | 44 virtual int Read(net::IOBuffer* buf, int buf_len, |
| 45 const net::CompletionCallback& callback) OVERRIDE; | 45 const net::CompletionCallback& callback) OVERRIDE; |
| 46 virtual int Write(net::IOBuffer* buf, int buf_len, | 46 virtual int Write(net::IOBuffer* buf, int buf_len, |
| 47 const net::CompletionCallback& callback) OVERRIDE; | 47 const net::CompletionCallback& callback) OVERRIDE; |
| 48 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 48 virtual int SetReceiveBufferSize(int32 size) OVERRIDE; |
| 49 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 49 virtual int SetSendBufferSize(int32 size) OVERRIDE; |
| 50 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; | 50 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE; |
| 51 virtual void Disconnect() OVERRIDE; | 51 virtual void Disconnect() OVERRIDE; |
| 52 virtual bool IsConnected() const OVERRIDE; | 52 virtual bool IsConnected() const OVERRIDE; |
| 53 virtual bool IsConnectedAndIdle() const OVERRIDE; | 53 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 54 virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; | 54 virtual int GetPeerAddress(net::IPEndPoint* address) const OVERRIDE; |
| 55 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; | 55 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; |
| 56 virtual const net::BoundNetLog& NetLog() const OVERRIDE; | 56 virtual const net::BoundNetLog& NetLog() const OVERRIDE; |
| 57 virtual void SetSubresourceSpeculation() OVERRIDE; | 57 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 58 virtual void SetOmniboxSpeculation() OVERRIDE; | 58 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 59 virtual bool WasEverUsed() const OVERRIDE; | 59 virtual bool WasEverUsed() const OVERRIDE; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 MATCHER_P(MatchIncomingSocketMessage, address, "") { | 106 MATCHER_P(MatchIncomingSocketMessage, address, "") { |
| 107 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) | 107 if (arg->type() != P2PMsg_OnIncomingTcpConnection::ID) |
| 108 return false; | 108 return false; |
| 109 P2PMsg_OnIncomingTcpConnection::Param params; | 109 P2PMsg_OnIncomingTcpConnection::Param params; |
| 110 P2PMsg_OnIncomingTcpConnection::Read( | 110 P2PMsg_OnIncomingTcpConnection::Read( |
| 111 arg, ¶ms); | 111 arg, ¶ms); |
| 112 return params.b == address; | 112 return params.b == address; |
| 113 } | 113 } |
| 114 | 114 |
| 115 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ | 115 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ |
| OLD | NEW |