OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_stream_socket.h" | 5 #include "remoting/protocol/fake_stream_socket.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } else { | 259 } else { |
260 NotifyChannelCreated(channel.Pass(), name, callback); | 260 NotifyChannelCreated(channel.Pass(), name, callback); |
261 } | 261 } |
262 } | 262 } |
263 | 263 |
264 void FakeStreamChannelFactory::NotifyChannelCreated( | 264 void FakeStreamChannelFactory::NotifyChannelCreated( |
265 scoped_ptr<FakeStreamSocket> owned_channel, | 265 scoped_ptr<FakeStreamSocket> owned_channel, |
266 const std::string& name, | 266 const std::string& name, |
267 const ChannelCreatedCallback& callback) { | 267 const ChannelCreatedCallback& callback) { |
268 if (channels_.find(name) != channels_.end()) | 268 if (channels_.find(name) != channels_.end()) |
269 callback.Run(owned_channel.PassAs<net::StreamSocket>()); | 269 callback.Run(owned_channel.Pass()); |
270 } | 270 } |
271 | 271 |
272 void FakeStreamChannelFactory::CancelChannelCreation(const std::string& name) { | 272 void FakeStreamChannelFactory::CancelChannelCreation(const std::string& name) { |
273 channels_.erase(name); | 273 channels_.erase(name); |
274 } | 274 } |
275 | 275 |
276 } // namespace protocol | 276 } // namespace protocol |
277 } // namespace remoting | 277 } // namespace remoting |
OLD | NEW |