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_message_handler.h" | 5 #include "remoting/host/security_key/security_key_message_handler.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 void SecurityKeyMessageHandler::HandleConnectRequest( | 115 void SecurityKeyMessageHandler::HandleConnectRequest( |
116 const std::string& message_payload) { | 116 const std::string& message_payload) { |
117 DCHECK(thread_checker_.CalledOnValidThread()); | 117 DCHECK(thread_checker_.CalledOnValidThread()); |
118 if (!message_payload.empty()) { | 118 if (!message_payload.empty()) { |
119 SendMessageWithPayload(SecurityKeyMessageType::CONNECT_ERROR, | 119 SendMessageWithPayload(SecurityKeyMessageType::CONNECT_ERROR, |
120 "Unexpected payload data received."); | 120 "Unexpected payload data received."); |
121 return; | 121 return; |
122 } | 122 } |
123 | 123 |
124 if (ipc_client_->WaitForSecurityKeyIpcServerChannel()) { | 124 if (ipc_client_->CheckForSecurityKeyIpcServerChannel()) { |
125 // If we find an IPC server, then attempt to establish a connection. | 125 // If we find an IPC server, then attempt to establish a connection. |
126 ipc_client_->EstablishIpcConnection( | 126 ipc_client_->EstablishIpcConnection( |
127 base::Bind(&SecurityKeyMessageHandler::HandleIpcConnectionChange, | 127 base::Bind(&SecurityKeyMessageHandler::HandleIpcConnectionChange, |
128 base::Unretained(this), true), | 128 base::Unretained(this), true), |
129 base::Bind(&SecurityKeyMessageHandler::HandleIpcConnectionChange, | 129 base::Bind(&SecurityKeyMessageHandler::HandleIpcConnectionChange, |
130 base::Unretained(this), false)); | 130 base::Unretained(this), false)); |
131 } else { | 131 } else { |
132 SendMessageWithPayload(SecurityKeyMessageType::CONNECT_RESPONSE, | 132 SendMessageWithPayload(SecurityKeyMessageType::CONNECT_RESPONSE, |
133 std::string(1, kConnectResponseNoSession)); | 133 std::string(1, kConnectResponseNoSession)); |
134 } | 134 } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 ipc_client_.reset(); | 172 ipc_client_.reset(); |
173 writer_.reset(); | 173 writer_.reset(); |
174 reader_.reset(); | 174 reader_.reset(); |
175 | 175 |
176 if (!error_callback_.is_null()) { | 176 if (!error_callback_.is_null()) { |
177 base::ResetAndReturn(&error_callback_).Run(); | 177 base::ResetAndReturn(&error_callback_).Run(); |
178 } | 178 } |
179 } | 179 } |
180 | 180 |
181 } // namespace remoting | 181 } // namespace remoting |
OLD | NEW |