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 "remoting/protocol/fake_session.h" | 5 #include "remoting/protocol/fake_session.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 FakeSession::~FakeSession() { } | 213 FakeSession::~FakeSession() { } |
214 | 214 |
215 FakeSocket* FakeSession::GetStreamChannel(const std::string& name) { | 215 FakeSocket* FakeSession::GetStreamChannel(const std::string& name) { |
216 return stream_channels_[name]; | 216 return stream_channels_[name]; |
217 } | 217 } |
218 | 218 |
219 FakeUdpSocket* FakeSession::GetDatagramChannel(const std::string& name) { | 219 FakeUdpSocket* FakeSession::GetDatagramChannel(const std::string& name) { |
220 return datagram_channels_[name]; | 220 return datagram_channels_[name]; |
221 } | 221 } |
222 | 222 |
223 void FakeSession::SetStateChangeCallback(StateChangeCallback* callback) { | 223 void FakeSession::SetStateChangeCallback(const StateChangeCallback& callback) { |
224 callback_.reset(callback); | 224 callback_ = callback; |
225 } | 225 } |
226 | 226 |
227 Session::Error FakeSession::error() { | 227 Session::Error FakeSession::error() { |
228 return error_; | 228 return error_; |
229 } | 229 } |
230 | 230 |
231 void FakeSession::CreateStreamChannel( | 231 void FakeSession::CreateStreamChannel( |
232 const std::string& name, const StreamChannelCallback& callback) { | 232 const std::string& name, const StreamChannelCallback& callback) { |
233 FakeSocket* channel = new FakeSocket(); | 233 FakeSocket* channel = new FakeSocket(); |
234 stream_channels_[name] = channel; | 234 stream_channels_[name] = channel; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 const std::string& FakeSession::shared_secret() { | 289 const std::string& FakeSession::shared_secret() { |
290 return shared_secret_; | 290 return shared_secret_; |
291 } | 291 } |
292 | 292 |
293 void FakeSession::Close() { | 293 void FakeSession::Close() { |
294 closed_ = true; | 294 closed_ = true; |
295 } | 295 } |
296 | 296 |
297 } // namespace protocol | 297 } // namespace protocol |
298 } // namespace remoting | 298 } // namespace remoting |
OLD | NEW |