Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: remoting/host/security_key/security_key_message_handler.cc

Issue 2478443002: Use ChannelMojo for remote security key channels. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698