| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/host/security_key/fake_security_key_ipc_server.h" | 5 #include "remoting/host/security_key/fake_security_key_ipc_server.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // we use it, otherwise we will use the IPC connection to send a message. | 92 // we use it, otherwise we will use the IPC connection to send a message. |
| 93 if (!send_response_callback_.is_null()) { | 93 if (!send_response_callback_.is_null()) { |
| 94 send_response_callback_.Run(); | 94 send_response_callback_.Run(); |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 return ipc_channel_->Send( | 98 return ipc_channel_->Send( |
| 99 new ChromotingNetworkToRemoteSecurityKeyMsg_Response(message_data)); | 99 new ChromotingNetworkToRemoteSecurityKeyMsg_Response(message_data)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void FakeSecurityKeyIpcServer::SendConnectionReadyMessage() { |
| 103 ipc_channel_->Send( |
| 104 new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionReady()); |
| 105 } |
| 106 |
| 107 void FakeSecurityKeyIpcServer::SendInvalidSessionMessage() { |
| 108 ipc_channel_->Send( |
| 109 new ChromotingNetworkToRemoteSecurityKeyMsg_InvalidSession()); |
| 110 } |
| 111 |
| 102 FakeSecurityKeyIpcServerFactory::FakeSecurityKeyIpcServerFactory() { | 112 FakeSecurityKeyIpcServerFactory::FakeSecurityKeyIpcServerFactory() { |
| 103 SecurityKeyIpcServer::SetFactoryForTest(this); | 113 SecurityKeyIpcServer::SetFactoryForTest(this); |
| 104 } | 114 } |
| 105 | 115 |
| 106 FakeSecurityKeyIpcServerFactory::~FakeSecurityKeyIpcServerFactory() { | 116 FakeSecurityKeyIpcServerFactory::~FakeSecurityKeyIpcServerFactory() { |
| 107 SecurityKeyIpcServer::SetFactoryForTest(nullptr); | 117 SecurityKeyIpcServer::SetFactoryForTest(nullptr); |
| 108 } | 118 } |
| 109 | 119 |
| 110 std::unique_ptr<SecurityKeyIpcServer> FakeSecurityKeyIpcServerFactory::Create( | 120 std::unique_ptr<SecurityKeyIpcServer> FakeSecurityKeyIpcServerFactory::Create( |
| 111 int connection_id, | 121 int connection_id, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 122 | 132 |
| 123 return fake_ipc_server; | 133 return fake_ipc_server; |
| 124 } | 134 } |
| 125 | 135 |
| 126 base::WeakPtr<FakeSecurityKeyIpcServer> | 136 base::WeakPtr<FakeSecurityKeyIpcServer> |
| 127 FakeSecurityKeyIpcServerFactory::GetIpcServerObject(int connection_id) { | 137 FakeSecurityKeyIpcServerFactory::GetIpcServerObject(int connection_id) { |
| 128 return ipc_server_map_[connection_id]; | 138 return ipc_server_map_[connection_id]; |
| 129 } | 139 } |
| 130 | 140 |
| 131 } // namespace remoting | 141 } // namespace remoting |
| OLD | NEW |