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

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

Issue 2596393002: Update IPC message handling for SecurityKeyIpcClient class (Closed)
Patch Set: Removing unnecessary patchset dependency 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
« no previous file with comments | « no previous file | remoting/host/security_key/security_key_ipc_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 994f92ef231005319d07bba22c8a3451d94f294a..c2cce4fc77ee6e0a2dca568aab61202b68047014 100644
--- a/remoting/host/security_key/security_key_ipc_client.cc
+++ b/remoting/host/security_key/security_key_ipc_client.cc
@@ -151,16 +151,28 @@ void SecurityKeyIpcClient::OnSecurityKeyResponse(
void SecurityKeyIpcClient::OnConnectionReady() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(!connected_callback_.is_null());
- base::ResetAndReturn(&connected_callback_).Run(/*connection_usable=*/true);
+ if (!connected_callback_.is_null()) {
+ base::ResetAndReturn(&connected_callback_).Run(/*connection_usable=*/true);
+ } else {
Sergey Ulanov 2016/12/22 23:01:36 nit: It would be a bit more readable if you handle
joedow 2016/12/22 23:39:00 Done.
+ LOG(ERROR) << "Unexpected ConnectionReady message received.";
+ if (!connection_error_callback_.is_null()) {
Sergey Ulanov 2016/12/22 23:01:36 if (connection_error_callback_)
joedow 2016/12/22 23:39:00 I've updated this line and the rest of the file to
+ base::ResetAndReturn(&connection_error_callback_).Run();
+ }
+ }
}
void SecurityKeyIpcClient::OnInvalidSession() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(!connected_callback_.is_null());
- base::ResetAndReturn(&connected_callback_).Run(/*connection_usable=*/false);
+ if (!connected_callback_.is_null()) {
+ base::ResetAndReturn(&connected_callback_).Run(/*connection_usable=*/false);
+ } else {
+ LOG(ERROR) << "Unexpected InvalidSession message received.";
+ if (!connection_error_callback_.is_null()) {
+ base::ResetAndReturn(&connection_error_callback_).Run();
+ }
+ }
}
void SecurityKeyIpcClient::ConnectToIpcChannel() {
« no previous file with comments | « no previous file | remoting/host/security_key/security_key_ipc_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698