Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_test_utils.h

Issue 8801004: base::Bind: Convert StreamSocket::Connect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/web_socket_proxy.cc ('k') | jingle/glue/pseudotcp_adapter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void SetLocalAddress(const net::IPEndPoint& local_address); 56 void SetLocalAddress(const net::IPEndPoint& local_address);
57 57
58 // net::Socket interface. 58 // net::Socket interface.
59 virtual int Read(net::IOBuffer* buf, int buf_len, 59 virtual int Read(net::IOBuffer* buf, int buf_len,
60 net::OldCompletionCallback* callback) OVERRIDE; 60 net::OldCompletionCallback* callback) OVERRIDE;
61 virtual int Write(net::IOBuffer* buf, int buf_len, 61 virtual int Write(net::IOBuffer* buf, int buf_len,
62 net::OldCompletionCallback* callback) OVERRIDE; 62 net::OldCompletionCallback* callback) OVERRIDE;
63 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; 63 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE;
64 virtual bool SetSendBufferSize(int32 size) OVERRIDE; 64 virtual bool SetSendBufferSize(int32 size) OVERRIDE;
65 virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE; 65 virtual int Connect(net::OldCompletionCallback* callback) OVERRIDE;
66 virtual int Connect(const net::CompletionCallback& callback) OVERRIDE;
66 virtual void Disconnect() OVERRIDE; 67 virtual void Disconnect() OVERRIDE;
67 virtual bool IsConnected() const OVERRIDE; 68 virtual bool IsConnected() const OVERRIDE;
68 virtual bool IsConnectedAndIdle() const OVERRIDE; 69 virtual bool IsConnectedAndIdle() const OVERRIDE;
69 virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE; 70 virtual int GetPeerAddress(net::AddressList* address) const OVERRIDE;
70 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE; 71 virtual int GetLocalAddress(net::IPEndPoint* address) const OVERRIDE;
71 virtual const net::BoundNetLog& NetLog() const OVERRIDE; 72 virtual const net::BoundNetLog& NetLog() const OVERRIDE;
72 virtual void SetSubresourceSpeculation() OVERRIDE; 73 virtual void SetSubresourceSpeculation() OVERRIDE;
73 virtual void SetOmniboxSpeculation() OVERRIDE; 74 virtual void SetOmniboxSpeculation() OVERRIDE;
74 virtual bool WasEverUsed() const OVERRIDE; 75 virtual bool WasEverUsed() const OVERRIDE;
75 virtual bool UsingTCPFastOpen() const OVERRIDE; 76 virtual bool UsingTCPFastOpen() const OVERRIDE;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 } 161 }
161 bool FakeSocket::SetSendBufferSize(int32 size) { 162 bool FakeSocket::SetSendBufferSize(int32 size) {
162 NOTIMPLEMENTED(); 163 NOTIMPLEMENTED();
163 return false; 164 return false;
164 } 165 }
165 166
166 int FakeSocket::Connect(net::OldCompletionCallback* callback) { 167 int FakeSocket::Connect(net::OldCompletionCallback* callback) {
167 return 0; 168 return 0;
168 } 169 }
169 170
171 int FakeSocket::Connect(const net::CompletionCallback& callback) {
172 return 0;
173 }
174
170 void FakeSocket::Disconnect() { 175 void FakeSocket::Disconnect() {
171 NOTREACHED(); 176 NOTREACHED();
172 } 177 }
173 178
174 bool FakeSocket::IsConnected() const { 179 bool FakeSocket::IsConnected() const {
175 return true; 180 return true;
176 } 181 }
177 182
178 bool FakeSocket::IsConnectedAndIdle() const { 183 bool FakeSocket::IsConnectedAndIdle() const {
179 return false; 184 return false;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return false; 278 return false;
274 P2PMsg_OnIncomingTcpConnection::Param params; 279 P2PMsg_OnIncomingTcpConnection::Param params;
275 P2PMsg_OnIncomingTcpConnection::Read( 280 P2PMsg_OnIncomingTcpConnection::Read(
276 arg, &params); 281 arg, &params);
277 return params.b == address; 282 return params.b == address;
278 } 283 }
279 284
280 } // namespace 285 } // namespace
281 286
282 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_ 287 #endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/web_socket_proxy.cc ('k') | jingle/glue/pseudotcp_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698