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

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

Issue 2468523003: Pass the desktop session ID to the remoting network process. (Closed)
Patch Set: rebase 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_auth_handler.h" 5 #include "remoting/host/security_key/security_key_auth_handler.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 if (close_connection) { 275 if (close_connection) {
276 base::ThreadTaskRunnerHandle::Get()->PostTask( 276 base::ThreadTaskRunnerHandle::Get()->PostTask(
277 FROM_HERE, base::Bind(&SecurityKeyAuthHandlerWin::OnChannelError, 277 FROM_HERE, base::Bind(&SecurityKeyAuthHandlerWin::OnChannelError,
278 weak_factory_.GetWeakPtr())); 278 weak_factory_.GetWeakPtr()));
279 return; 279 return;
280 } 280 }
281 281
282 int new_connection_id = ++last_connection_id_; 282 int new_connection_id = ++last_connection_id_;
283 std::unique_ptr<SecurityKeyIpcServer> ipc_server(SecurityKeyIpcServer::Create( 283 std::unique_ptr<SecurityKeyIpcServer> ipc_server(SecurityKeyIpcServer::Create(
284 new_connection_id, peer_session_id, disconnect_timeout_, 284 new_connection_id, client_session_details_, disconnect_timeout_,
285 send_message_callback_, 285 send_message_callback_,
286 base::Bind(&SecurityKeyAuthHandlerWin::CloseSecurityKeyRequestIpcChannel, 286 base::Bind(&SecurityKeyAuthHandlerWin::CloseSecurityKeyRequestIpcChannel,
287 base::Unretained(this), new_connection_id))); 287 base::Unretained(this), new_connection_id)));
288 288
289 std::string unique_channel_name = GenerateUniqueChannelName(); 289 std::string unique_channel_name = GenerateUniqueChannelName();
290 if (ipc_server->CreateChannel( 290 if (ipc_server->CreateChannel(
291 unique_channel_name, 291 unique_channel_name,
292 base::TimeDelta::FromSeconds(kSecurityKeyRequestTimeoutSeconds))) { 292 base::TimeDelta::FromSeconds(kSecurityKeyRequestTimeoutSeconds))) {
293 active_channels_[new_connection_id] = std::move(ipc_server); 293 active_channels_[new_connection_id] = std::move(ipc_server);
294 ipc_server_channel_->Send( 294 ipc_server_channel_->Send(
295 new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionDetails( 295 new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionDetails(
296 unique_channel_name)); 296 unique_channel_name));
297 } 297 }
298 } 298 }
299 299
300 void SecurityKeyAuthHandlerWin::OnChannelError() { 300 void SecurityKeyAuthHandlerWin::OnChannelError() {
301 DCHECK(thread_checker_.CalledOnValidThread()); 301 DCHECK(thread_checker_.CalledOnValidThread());
302 302
303 // Could be an error, most likely the client disconnected though. Either way 303 // Could be an error, most likely the client disconnected though. Either way
304 // we should restart the server to prepare for the next connection. 304 // we should restart the server to prepare for the next connection.
305 RecreateIpcServerChannel(); 305 RecreateIpcServerChannel();
306 } 306 }
307 307
308 } // namespace remoting 308 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698