| 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_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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 constexpr base::TimeDelta kSecurityKeyRequestTimeout = | 43 constexpr base::TimeDelta kSecurityKeyRequestTimeout = |
| 44 base::TimeDelta::FromSeconds(60); | 44 base::TimeDelta::FromSeconds(60); |
| 45 | 45 |
| 46 } // namespace | 46 } // namespace |
| 47 | 47 |
| 48 namespace remoting { | 48 namespace remoting { |
| 49 | 49 |
| 50 // Creates an IPC server channel which services IPC clients that want to start | 50 // Creates an IPC server channel which services IPC clients that want to start |
| 51 // a security key forwarding session. Once an IPC Client connects to the | 51 // a security key forwarding session. Once an IPC Client connects to the |
| 52 // server, the SecurityKeyAuthHandlerWin class will create a new | 52 // server, the SecurityKeyAuthHandlerWin class will create a new |
| 53 // SecurityKeyIpcServer instance that will service that request. The new | 53 // SecurityKeyIpcServer instance to service the next request. This system |
| 54 // instance will exist for the lifetime of the security key request and will be | 54 // allows multiple security key forwarding sessions to occur concurrently. |
| 55 // assigned a unique IPC channel name and connection id. The channel name is | |
| 56 // sent to the client which should disconnect the IPC server channel and | |
| 57 // connect to the security key forwarding session IPC channel to send/receive | |
| 58 // security key messages. The IPC server channel will then be reset so it can | |
| 59 // can service the next client/request. This system allows multiple security | |
| 60 // key forwarding sessions to occur concurrently. | |
| 61 // TODO(joedow): Update SecurityKeyAuthHandler impls to run on a separate IO | 55 // TODO(joedow): Update SecurityKeyAuthHandler impls to run on a separate IO |
| 62 // thread instead of the thread it was created on: crbug.com/591739 | 56 // thread instead of the thread it was created on: crbug.com/591739 |
| 63 class SecurityKeyAuthHandlerWin : public SecurityKeyAuthHandler { | 57 class SecurityKeyAuthHandlerWin : public SecurityKeyAuthHandler { |
| 64 public: | 58 public: |
| 65 explicit SecurityKeyAuthHandlerWin( | 59 explicit SecurityKeyAuthHandlerWin( |
| 66 ClientSessionDetails* client_session_details); | 60 ClientSessionDetails* client_session_details); |
| 67 ~SecurityKeyAuthHandlerWin() override; | 61 ~SecurityKeyAuthHandlerWin() override; |
| 68 | 62 |
| 69 private: | 63 private: |
| 70 typedef std::map<int, std::unique_ptr<SecurityKeyIpcServer>> ActiveChannels; | 64 typedef std::map<int, std::unique_ptr<SecurityKeyIpcServer>> ActiveChannels; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 SecurityKeyAuthHandlerWin::GetChannelForConnectionId(int connection_id) const { | 210 SecurityKeyAuthHandlerWin::GetChannelForConnectionId(int connection_id) const { |
| 217 return active_channels_.find(connection_id); | 211 return active_channels_.find(connection_id); |
| 218 } | 212 } |
| 219 | 213 |
| 220 void SecurityKeyAuthHandlerWin::OnChannelConnected() { | 214 void SecurityKeyAuthHandlerWin::OnChannelConnected() { |
| 221 // Create another server to accept the next connection. | 215 // Create another server to accept the next connection. |
| 222 StartIpcServerChannel(); | 216 StartIpcServerChannel(); |
| 223 } | 217 } |
| 224 | 218 |
| 225 } // namespace remoting | 219 } // namespace remoting |
| OLD | NEW |