| 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_client.h" | 5 #include "remoting/host/security_key/fake_security_key_ipc_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool FakeSecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) { | 84 bool FakeSecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) { |
| 85 bool handled = true; | 85 bool handled = true; |
| 86 IPC_BEGIN_MESSAGE_MAP(FakeSecurityKeyIpcClient, message) | 86 IPC_BEGIN_MESSAGE_MAP(FakeSecurityKeyIpcClient, message) |
| 87 IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_Response, | 87 IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_Response, |
| 88 OnSecurityKeyResponse) | 88 OnSecurityKeyResponse) |
| 89 IPC_MESSAGE_UNHANDLED(handled = false) | 89 IPC_MESSAGE_UNHANDLED(handled = false) |
| 90 IPC_END_MESSAGE_MAP() | 90 IPC_END_MESSAGE_MAP() |
| 91 | 91 |
| 92 CHECK(handled) << "Received unexpected IPC type: " << message.type(); | 92 // Received unexpected IPC type. |
| 93 CHECK(handled); |
| 93 return handled; | 94 return handled; |
| 94 } | 95 } |
| 95 | 96 |
| 96 void FakeSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) { | 97 void FakeSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) { |
| 97 ipc_channel_connected_ = true; | 98 ipc_channel_connected_ = true; |
| 98 channel_event_callback_.Run(); | 99 channel_event_callback_.Run(); |
| 99 } | 100 } |
| 100 | 101 |
| 101 void FakeSecurityKeyIpcClient::OnChannelError() { | 102 void FakeSecurityKeyIpcClient::OnChannelError() { |
| 102 ipc_channel_connected_ = false; | 103 ipc_channel_connected_ = false; |
| 103 channel_event_callback_.Run(); | 104 channel_event_callback_.Run(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 void FakeSecurityKeyIpcClient::OnSecurityKeyResponse( | 107 void FakeSecurityKeyIpcClient::OnSecurityKeyResponse( |
| 107 const std::string& request_data) { | 108 const std::string& request_data) { |
| 108 last_message_received_ = request_data; | 109 last_message_received_ = request_data; |
| 109 channel_event_callback_.Run(); | 110 channel_event_callback_.Run(); |
| 110 } | 111 } |
| 111 | 112 |
| 112 } // namespace remoting | 113 } // namespace remoting |
| OLD | NEW |