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

Side by Side Diff: jingle/glue/pseudotcp_adapter_unittest.cc

Issue 8889036: Revert 113699 - base::Bind: Convert Socket::Write. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 | « jingle/glue/pseudotcp_adapter.cc ('k') | jingle/notifier/base/fake_ssl_client_socket.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 #include "jingle/glue/pseudotcp_adapter.h" 5 #include "jingle/glue/pseudotcp_adapter.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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 MessageLoop::current()->PostDelayedTask( 167 MessageLoop::current()->PostDelayedTask(
168 FROM_HERE, 168 FROM_HERE,
169 base::Bind(&FakeSocket::AppendInputPacket, 169 base::Bind(&FakeSocket::AppendInputPacket,
170 base::Unretained(peer_socket_), 170 base::Unretained(peer_socket_),
171 std::vector<char>(buf->data(), buf->data() + buf_len)), 171 std::vector<char>(buf->data(), buf->data() + buf_len)),
172 latency_ms_); 172 latency_ms_);
173 } 173 }
174 174
175 return buf_len; 175 return buf_len;
176 } 176 }
177 virtual int Write(net::IOBuffer* buf, int buf_len,
178 const net::CompletionCallback& callback) OVERRIDE {
179 DCHECK(buf);
180 if (peer_socket_) {
181 MessageLoop::current()->PostDelayedTask(
182 FROM_HERE,
183 base::Bind(&FakeSocket::AppendInputPacket,
184 base::Unretained(peer_socket_),
185 std::vector<char>(buf->data(), buf->data() + buf_len)),
186 latency_ms_);
187 }
188
189 return buf_len;
190 }
191 177
192 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE { 178 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE {
193 NOTIMPLEMENTED(); 179 NOTIMPLEMENTED();
194 return false; 180 return false;
195 } 181 }
196 virtual bool SetSendBufferSize(int32 size) OVERRIDE { 182 virtual bool SetSendBufferSize(int32 size) OVERRIDE {
197 NOTIMPLEMENTED(); 183 NOTIMPLEMENTED();
198 return false; 184 return false;
199 } 185 }
200 186
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 host_pseudotcp_->Connect(&host_connect_cb); 436 host_pseudotcp_->Connect(&host_connect_cb);
451 client_pseudotcp_->Connect(&client_connect_cb); 437 client_pseudotcp_->Connect(&client_connect_cb);
452 message_loop_.Run(); 438 message_loop_.Run();
453 439
454 ASSERT_EQ(NULL, host_pseudotcp_.get()); 440 ASSERT_EQ(NULL, host_pseudotcp_.get());
455 } 441 }
456 442
457 } // namespace 443 } // namespace
458 444
459 } // namespace jingle_glue 445 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « jingle/glue/pseudotcp_adapter.cc ('k') | jingle/notifier/base/fake_ssl_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698