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_datagram_socket.h" | 5 #include "remoting/protocol/fake_datagram_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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 } else { | 151 } else { |
152 NotifyChannelCreated(channel.Pass(), name, callback); | 152 NotifyChannelCreated(channel.Pass(), name, callback); |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 void FakeDatagramChannelFactory::NotifyChannelCreated( | 156 void FakeDatagramChannelFactory::NotifyChannelCreated( |
157 scoped_ptr<FakeDatagramSocket> owned_socket, | 157 scoped_ptr<FakeDatagramSocket> owned_socket, |
158 const std::string& name, | 158 const std::string& name, |
159 const ChannelCreatedCallback& callback) { | 159 const ChannelCreatedCallback& callback) { |
160 if (channels_.find(name) != channels_.end()) | 160 if (channels_.find(name) != channels_.end()) |
161 callback.Run(owned_socket.PassAs<net::Socket>()); | 161 callback.Run(owned_socket.Pass()); |
162 } | 162 } |
163 | 163 |
164 void FakeDatagramChannelFactory::CancelChannelCreation( | 164 void FakeDatagramChannelFactory::CancelChannelCreation( |
165 const std::string& name) { | 165 const std::string& name) { |
166 channels_.erase(name); | 166 channels_.erase(name); |
167 } | 167 } |
168 | 168 |
169 } // namespace protocol | 169 } // namespace protocol |
170 } // namespace remoting | 170 } // namespace remoting |
OLD | NEW |