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 "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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 virtual int Write(net::IOBuffer* buf, int buf_len, | 135 virtual int Write(net::IOBuffer* buf, int buf_len, |
136 const net::CompletionCallback& callback) OVERRIDE { | 136 const net::CompletionCallback& callback) OVERRIDE { |
137 DCHECK(buf); | 137 DCHECK(buf); |
138 if (peer_socket_) { | 138 if (peer_socket_) { |
139 MessageLoop::current()->PostDelayedTask( | 139 MessageLoop::current()->PostDelayedTask( |
140 FROM_HERE, | 140 FROM_HERE, |
141 base::Bind(&FakeSocket::AppendInputPacket, | 141 base::Bind(&FakeSocket::AppendInputPacket, |
142 base::Unretained(peer_socket_), | 142 base::Unretained(peer_socket_), |
143 std::vector<char>(buf->data(), buf->data() + buf_len)), | 143 std::vector<char>(buf->data(), buf->data() + buf_len)), |
144 latency_ms_); | 144 base::TimeDelta::FromMilliseconds(latency_ms_)); |
145 } | 145 } |
146 | 146 |
147 return buf_len; | 147 return buf_len; |
148 } | 148 } |
149 | 149 |
150 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE { | 150 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE { |
151 NOTIMPLEMENTED(); | 151 NOTIMPLEMENTED(); |
152 return false; | 152 return false; |
153 } | 153 } |
154 virtual bool SetSendBufferSize(int32 size) OVERRIDE { | 154 virtual bool SetSendBufferSize(int32 size) OVERRIDE { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 base::Unretained(&host_delete))); | 403 base::Unretained(&host_delete))); |
404 client_pseudotcp_->Connect(client_connect_cb.callback()); | 404 client_pseudotcp_->Connect(client_connect_cb.callback()); |
405 message_loop_.Run(); | 405 message_loop_.Run(); |
406 | 406 |
407 ASSERT_EQ(NULL, host_pseudotcp_.get()); | 407 ASSERT_EQ(NULL, host_pseudotcp_.get()); |
408 } | 408 } |
409 | 409 |
410 } // namespace | 410 } // namespace |
411 | 411 |
412 } // namespace jingle_glue | 412 } // namespace jingle_glue |
OLD | NEW |