Index: remoting/protocol/ssl_hmac_channel_authenticator.cc |
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc |
index d85ad5f17ed99db39f6e5c9755e35fdf114bacd2..996d31485fd6932d0794a41d0ef13484822f8324 100644 |
--- a/remoting/protocol/ssl_hmac_channel_authenticator.cc |
+++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc |
@@ -279,13 +279,21 @@ void SslHmacChannelAuthenticator::CheckDone(bool* callback_called) { |
DCHECK(socket_.get() != NULL); |
if (callback_called) |
*callback_called = true; |
- done_callback_.Run(net::OK, socket_.PassAs<net::StreamSocket>()); |
+ |
+ NotifyResult(net::OK, socket_.PassAs<net::StreamSocket>()); |
} |
} |
void SslHmacChannelAuthenticator::NotifyError(int error) { |
- done_callback_.Run(static_cast<net::Error>(error), |
- scoped_ptr<net::StreamSocket>()); |
+ NotifyResult(static_cast<net::Error>(error), scoped_ptr<net::StreamSocket>()); |
Wez
2014/09/10 02:29:27
This has undefined and potentially scary behaviour
Sergey Ulanov
2014/09/10 21:50:59
We will still need to convert int to net::Error be
|
+} |
+ |
+void SslHmacChannelAuthenticator::NotifyResult( |
+ net::Error error, |
+ scoped_ptr<net::StreamSocket> socket) { |
+ DoneCallback callback = done_callback_; |
+ done_callback_.Reset(); |
+ callback.Run(error, socket.Pass()); |
} |
} // namespace protocol |