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

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

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/security_key_ipc_client.h
diff --git a/remoting/host/security_key/security_key_ipc_client.h b/remoting/host/security_key/security_key_ipc_client.h
index cfdbec54d7bc4d87a4d28cc439528138b0800454..c51b059e990e5861ac47c7471e14f4bdfec0187e 100644
--- a/remoting/host/security_key/security_key_ipc_client.h
+++ b/remoting/host/security_key/security_key_ipc_client.h
@@ -34,18 +34,21 @@ class SecurityKeyIpcClient : public IPC::Listener {
typedef base::Callback<void(const std::string& response_data)>
ResponseCallback;
+ // Used to indicate whether the channel can be used for request forwarding.
+ typedef base::Callback<void(bool connection_usable)> ConnectedCallback;
dcheng 2016/12/16 02:33:07 Nit: it's preferred to use 'using A = B' over 'typ
joedow 2016/12/16 03:36:22 Acknowledged. I'll switch to that style in future
+
// Returns true if there is an active remoting session which supports
// security key request forwarding.
virtual bool CheckForSecurityKeyIpcServerChannel();
// Begins the process of connecting to the IPC channel which will be used for
// exchanging security key messages.
- // |connection_ready_callback| is called when a channel has been established
- // and security key requests can be sent.
+ // |connected_callback| is called when a channel has been established and
+ // indicates whether security key requests can be sent using it.
// |connection_error_callback| is stored and will be called back for any
// unexpected errors that occur while establishing, or during, the session.
virtual void EstablishIpcConnection(
- const base::Closure& connection_ready_callback,
+ const ConnectedCallback& connected_callback,
const base::Closure& connection_error_callback);
// Sends a security key request message to the network process to be forwarded
@@ -70,8 +73,11 @@ class SecurityKeyIpcClient : public IPC::Listener {
void OnChannelConnected(int32_t peer_pid) override;
void OnChannelError() override;
- // Handles the ConnectionDetails IPC message.
- void OnConnectionDetails(const std::string& request_data);
+ // Handles the ConnectionReady IPC message.
+ void OnConnectionReady();
+
+ // Handles the InvalidSession IPC message.
+ void OnInvalidSession();
// Handles security key response IPC messages.
void OnSecurityKeyResponse(const std::string& request_data);
@@ -83,7 +89,6 @@ class SecurityKeyIpcClient : public IPC::Listener {
// '0' (default) corresponds to the session the network process runs in.
uint32_t expected_ipc_server_session_id_ = 0;
-
// Name of the initial IPC channel used to retrieve connection info.
mojo::edk::NamedPlatformHandle named_channel_handle_;
@@ -91,7 +96,7 @@ class SecurityKeyIpcClient : public IPC::Listener {
mojo::edk::ScopedPlatformHandle channel_handle_;
// Signaled when the IPC connection is ready for security key requests.
- base::Closure connection_ready_callback_;
+ ConnectedCallback connected_callback_;
// Signaled when an error occurs in either the IPC channel or communication.
base::Closure connection_error_callback_;

Powered by Google App Engine
This is Rietveld 408576698