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

Unified Diff: remoting/host/security_key/security_key_ipc_client.cc

Issue 2575963002: Handle Security Key requests from outside the remoted session correctly (Closed)
Patch Set: Fixing unit tests and formatting 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/security_key/security_key_ipc_client.cc
diff --git a/remoting/host/security_key/security_key_ipc_client.cc b/remoting/host/security_key/security_key_ipc_client.cc
index 43ad72f17b8e735bbd61efd24a502e1f3e6c7e6d..7dd95da86d0032f0053e3c922cbbee877f902c09 100644
--- a/remoting/host/security_key/security_key_ipc_client.cc
+++ b/remoting/host/security_key/security_key_ipc_client.cc
@@ -38,7 +38,7 @@ bool SecurityKeyIpcClient::CheckForSecurityKeyIpcServerChannel() {
}
void SecurityKeyIpcClient::EstablishIpcConnection(
- const base::Closure& connection_ready_callback,
+ const ConnectionReadyCallback& connection_ready_callback,
const base::Closure& connection_error_callback) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!connection_ready_callback.is_null());
@@ -96,6 +96,10 @@ bool SecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(SecurityKeyIpcClient, message)
IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_Response,
OnSecurityKeyResponse)
+ IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionReady,
+ OnConnectionReady)
+ IPC_MESSAGE_HANDLER(ChromotingNetworkToRemoteSecurityKeyMsg_InvalidSession,
+ OnInvalidSession)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -122,8 +126,6 @@ void SecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) {
return;
}
#endif // defined(OS_WIN)
-
- base::ResetAndReturn(&connection_ready_callback_).Run();
}
void SecurityKeyIpcClient::OnChannelError() {
@@ -147,6 +149,20 @@ void SecurityKeyIpcClient::OnSecurityKeyResponse(
}
}
+void SecurityKeyIpcClient::OnConnectionReady() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(!connection_ready_callback_.is_null());
+
+ base::ResetAndReturn(&connection_ready_callback_).Run(true);
+}
+
+void SecurityKeyIpcClient::OnInvalidSession() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(!connection_ready_callback_.is_null());
+
+ base::ResetAndReturn(&connection_ready_callback_).Run(false);
+}
+
void SecurityKeyIpcClient::ConnectToIpcChannel() {
DCHECK(thread_checker_.CalledOnValidThread());

Powered by Google App Engine
This is Rietveld 408576698