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 #include "remoting/protocol/fake_session.h" | 5 #include "remoting/protocol/fake_session.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 } | 120 } |
121 | 121 |
122 DoWrite(buf.get(), buf_len); | 122 DoWrite(buf.get(), buf_len); |
123 callback.Run(buf_len); | 123 callback.Run(buf_len); |
124 } | 124 } |
125 | 125 |
126 void FakeSocket::DoWrite(net::IOBuffer* buf, int buf_len) { | 126 void FakeSocket::DoWrite(net::IOBuffer* buf, int buf_len) { |
127 written_data_.insert(written_data_.end(), | 127 written_data_.insert(written_data_.end(), |
128 buf->data(), buf->data() + buf_len); | 128 buf->data(), buf->data() + buf_len); |
129 | 129 |
130 if (peer_socket_) { | 130 if (peer_socket_.get()) { |
131 message_loop_->PostTask(FROM_HERE, base::Bind( | 131 message_loop_->PostTask( |
132 &FakeSocket::AppendInputData, peer_socket_, | 132 FROM_HERE, |
133 std::vector<char>(buf->data(), buf->data() + buf_len))); | 133 base::Bind(&FakeSocket::AppendInputData, |
| 134 peer_socket_, |
| 135 std::vector<char>(buf->data(), buf->data() + buf_len))); |
134 } | 136 } |
135 } | 137 } |
136 | 138 |
137 bool FakeSocket::SetReceiveBufferSize(int32 size) { | 139 bool FakeSocket::SetReceiveBufferSize(int32 size) { |
138 NOTIMPLEMENTED(); | 140 NOTIMPLEMENTED(); |
139 return false; | 141 return false; |
140 } | 142 } |
141 bool FakeSocket::SetSendBufferSize(int32 size) { | 143 bool FakeSocket::SetSendBufferSize(int32 size) { |
142 NOTIMPLEMENTED(); | 144 NOTIMPLEMENTED(); |
143 return false; | 145 return false; |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 callback.Run(scoped_ptr<net::Socket>(datagram_channels_[name])); | 382 callback.Run(scoped_ptr<net::Socket>(datagram_channels_[name])); |
381 } | 383 } |
382 | 384 |
383 void FakeSession::CancelChannelCreation(const std::string& name) { | 385 void FakeSession::CancelChannelCreation(const std::string& name) { |
384 stream_channels_.erase(name); | 386 stream_channels_.erase(name); |
385 datagram_channels_.erase(name); | 387 datagram_channels_.erase(name); |
386 } | 388 } |
387 | 389 |
388 } // namespace protocol | 390 } // namespace protocol |
389 } // namespace remoting | 391 } // namespace remoting |
OLD | NEW |