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

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: 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.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..21c14b25dc383fa27fb83669049df509a4cd00ab 100644
--- a/remoting/host/security_key/security_key_ipc_client.h
+++ b/remoting/host/security_key/security_key_ipc_client.h
@@ -34,6 +34,9 @@ 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_ready)> ConnectionReadyCallback;
Sergey Ulanov 2016/12/15 19:47:33 It seems wrong to call it ConnectionReadyCallback
joedow 2016/12/15 21:18:32 Done.
+
// Returns true if there is an active remoting session which supports
// security key request forwarding.
virtual bool CheckForSecurityKeyIpcServerChannel();
@@ -41,11 +44,11 @@ class SecurityKeyIpcClient : public IPC::Listener {
// 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.
+ // and indicates whether security key requests can be sent.
// |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 ConnectionReadyCallback& connection_ready_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);
@@ -91,7 +97,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_;
+ ConnectionReadyCallback connection_ready_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