| 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/security_key_ipc_client.h" | 5 #include "remoting/host/security_key/security_key_ipc_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 bool SecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) { | 92 bool SecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) { |
| 93 DCHECK(thread_checker_.CalledOnValidThread()); | 93 DCHECK(thread_checker_.CalledOnValidThread()); |
| 94 | 94 |
| 95 bool handled = true; | 95 bool handled = true; |
| 96 IPC_BEGIN_MESSAGE_MAP(SecurityKeyIpcClient, message) | 96 IPC_BEGIN_MESSAGE_MAP(SecurityKeyIpcClient, message) |
| 97 IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_Response, | 97 IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_Response, |
| 98 OnSecurityKeyResponse) | 98 OnSecurityKeyResponse) |
| 99 IPC_MESSAGE_UNHANDLED(handled = false) | 99 IPC_MESSAGE_UNHANDLED(handled = false) |
| 100 IPC_END_MESSAGE_MAP() | 100 IPC_END_MESSAGE_MAP() |
| 101 | 101 |
| 102 CHECK(handled) << "Received unexpected IPC type: " << message.type(); | 102 // Received unexpected IPC type. |
| 103 CHECK(handled); |
| 103 return handled; | 104 return handled; |
| 104 } | 105 } |
| 105 | 106 |
| 106 void SecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) { | 107 void SecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) { |
| 107 DCHECK(thread_checker_.CalledOnValidThread()); | 108 DCHECK(thread_checker_.CalledOnValidThread()); |
| 108 | 109 |
| 109 #if defined(OS_WIN) | 110 #if defined(OS_WIN) |
| 110 DWORD peer_session_id; | 111 DWORD peer_session_id; |
| 111 if (!ProcessIdToSessionId(peer_pid, &peer_session_id)) { | 112 if (!ProcessIdToSessionId(peer_pid, &peer_session_id)) { |
| 112 PLOG(ERROR) << "ProcessIdToSessionId failed"; | 113 PLOG(ERROR) << "ProcessIdToSessionId failed"; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 return; | 168 return; |
| 168 } | 169 } |
| 169 ipc_channel_.reset(); | 170 ipc_channel_.reset(); |
| 170 | 171 |
| 171 if (!connection_error_callback_.is_null()) { | 172 if (!connection_error_callback_.is_null()) { |
| 172 base::ResetAndReturn(&connection_error_callback_).Run(); | 173 base::ResetAndReturn(&connection_error_callback_).Run(); |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace remoting | 177 } // namespace remoting |
| OLD | NEW |