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

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

Issue 2575963002: Handle Security Key requests from outside the remoted session correctly (Closed)
Patch Set: Addressing CR Feedback 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/fake_security_key_ipc_client.cc
diff --git a/remoting/host/security_key/fake_security_key_ipc_client.cc b/remoting/host/security_key/fake_security_key_ipc_client.cc
index e2b4f445ed13f47b2054de942fcedc57b9849656..70eb8bc053a0c9797730a00333fed5ce0572f8c3 100644
--- a/remoting/host/security_key/fake_security_key_ipc_client.cc
+++ b/remoting/host/security_key/fake_security_key_ipc_client.cc
@@ -37,10 +37,10 @@ bool FakeSecurityKeyIpcClient::CheckForSecurityKeyIpcServerChannel() {
}
void FakeSecurityKeyIpcClient::EstablishIpcConnection(
- const base::Closure& connection_ready_callback,
+ const ConnectedCallback& connected_callback,
const base::Closure& connection_error_callback) {
if (establish_ipc_connection_should_succeed_) {
- connection_ready_callback.Run();
+ connected_callback.Run(/*connection_usable=*/true);
} else {
connection_error_callback.Run();
}
@@ -86,6 +86,10 @@ bool FakeSecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(FakeSecurityKeyIpcClient, 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()
@@ -93,6 +97,16 @@ bool FakeSecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) {
return handled;
}
+void FakeSecurityKeyIpcClient::OnConnectionReady() {
+ connection_ready_ = true;
+ channel_event_callback_.Run();
+}
+
+void FakeSecurityKeyIpcClient::OnInvalidSession() {
+ invalid_session_error_ = true;
+ channel_event_callback_.Run();
+}
+
void FakeSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) {
ipc_channel_connected_ = true;
channel_event_callback_.Run();

Powered by Google App Engine
This is Rietveld 408576698