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/protocol_mock_objects.h" | 5 #include "remoting/protocol/protocol_mock_objects.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop.h" |
rmsousa
2013/06/13 04:26:19
Nit: is this needed?
Jamie
2013/06/13 17:22:15
Not any more, and neither are the other includes,
| |
8 #include "net/base/ip_endpoint.h" | 8 #include "net/base/ip_endpoint.h" |
9 #include "remoting/protocol/transport.h" | 9 #include "remoting/protocol/transport.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 namespace protocol { | 12 namespace protocol { |
13 | 13 |
14 MockConnectionToClient::MockConnectionToClient( | 14 MockConnectionToClient::MockConnectionToClient( |
15 Session* session, | 15 Session* session, |
16 HostStub* host_stub) | 16 HostStub* host_stub) |
17 : ConnectionToClient(session) { | 17 : ConnectionToClient(session) { |
(...skipping 27 matching lines...) Expand all Loading... | |
45 MockVideoStub::~MockVideoStub() {} | 45 MockVideoStub::~MockVideoStub() {} |
46 | 46 |
47 MockSession::MockSession() {} | 47 MockSession::MockSession() {} |
48 | 48 |
49 MockSession::~MockSession() {} | 49 MockSession::~MockSession() {} |
50 | 50 |
51 MockSessionManager::MockSessionManager() {} | 51 MockSessionManager::MockSessionManager() {} |
52 | 52 |
53 MockSessionManager::~MockSessionManager() {} | 53 MockSessionManager::~MockSessionManager() {} |
54 | 54 |
55 MockPairingRegistryDelegate::MockPairingRegistryDelegate() { | |
56 } | |
57 | |
58 MockPairingRegistryDelegate::~MockPairingRegistryDelegate() { | |
59 } | |
60 | |
61 void MockPairingRegistryDelegate::AddPairing( | |
62 const PairingRegistry::Pairing& new_paired_client) OVERRIDE { | |
63 paired_clients_[new_paired_client.client_id] = new_paired_client; | |
64 } | |
65 | |
66 void MockPairingRegistryDelegate::GetPairing( | |
67 const std::string& client_id, | |
68 const PairingRegistry::GetPairingCallback& callback) OVERRIDE { | |
69 PairingRegistry::Pairing result; | |
70 PairingRegistry::PairedClients::const_iterator i = | |
71 paired_clients_.find(client_id); | |
72 if (i != paired_clients_.end()) { | |
73 result = i->second; | |
74 } | |
75 saved_callback_ = base::Bind(base::Bind(callback), result); | |
76 } | |
77 | |
78 void MockPairingRegistryDelegate::RunCallback() { | |
79 DCHECK(!saved_callback_.is_null()); | |
80 saved_callback_.Run(); | |
81 saved_callback_.Reset(); | |
82 } | |
83 | |
55 } // namespace protocol | 84 } // namespace protocol |
56 } // namespace remoting | 85 } // namespace remoting |
OLD | NEW |