Chromium Code Reviews| 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() { |