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

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

Issue 2562473002: Fixing SecurityKeySocket unit test issues and cleanup (Closed)
Patch Set: Addressing CR Feedback #2 Created 4 years 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_extension_session.h" 5 #include "remoting/host/security_key/security_key_extension_session.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 int connection_id; 164 int connection_id;
165 if (!message_data->GetInteger(kConnectionId, &connection_id)) { 165 if (!message_data->GetInteger(kConnectionId, &connection_id)) {
166 LOG(WARNING) << "Could not extract connection id from message."; 166 LOG(WARNING) << "Could not extract connection id from message.";
167 return; 167 return;
168 } 168 }
169 169
170 if (security_key_auth_handler_->IsValidConnectionId(connection_id)) { 170 if (security_key_auth_handler_->IsValidConnectionId(connection_id)) {
171 HOST_LOG << "Sending security key error"; 171 HOST_LOG << "Sending security key error";
172 security_key_auth_handler_->SendErrorAndCloseConnection(connection_id); 172 security_key_auth_handler_->SendErrorAndCloseConnection(connection_id);
173 } else { 173 } else {
174 LOG(WARNING) << "Unknown gnubby-auth data connection: '" << connection_id 174 LOG(WARNING) << "Unknown gnubby-auth connection id: " << connection_id;
175 << "'";
176 } 175 }
177 } 176 }
178 177
179 void SecurityKeyExtensionSession::SendMessageToClient( 178 void SecurityKeyExtensionSession::SendMessageToClient(
180 int connection_id, 179 int connection_id,
181 const std::string& data) const { 180 const std::string& data) const {
182 DCHECK(thread_checker_.CalledOnValidThread()); 181 DCHECK(thread_checker_.CalledOnValidThread());
183 DCHECK(client_stub_); 182 DCHECK(client_stub_);
184 183
185 base::DictionaryValue request; 184 base::DictionaryValue request;
(...skipping 20 matching lines...) Expand all
206 std::unique_ptr<SecurityKeyAuthHandler> security_key_auth_handler) { 205 std::unique_ptr<SecurityKeyAuthHandler> security_key_auth_handler) {
207 DCHECK(security_key_auth_handler); 206 DCHECK(security_key_auth_handler);
208 207
209 security_key_auth_handler_ = std::move(security_key_auth_handler); 208 security_key_auth_handler_ = std::move(security_key_auth_handler);
210 security_key_auth_handler_->SetSendMessageCallback( 209 security_key_auth_handler_->SetSendMessageCallback(
211 base::Bind(&SecurityKeyExtensionSession::SendMessageToClient, 210 base::Bind(&SecurityKeyExtensionSession::SendMessageToClient,
212 base::Unretained(this))); 211 base::Unretained(this)));
213 } 212 }
214 213
215 } // namespace remoting 214 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698