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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |