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

Side by Side Diff: remoting/protocol/ssl_hmac_channel_authenticator.cc

Issue 609923004: Cleanup usage of scoped_ptr<> in remoting for C++11 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" 5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "crypto/secure_util.h" 9 #include "crypto/secure_util.h"
10 #include "net/base/host_port_pair.h" 10 #include "net/base/host_port_pair.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return crypto::SecureMemEqual(received_auth_bytes.data(), 273 return crypto::SecureMemEqual(received_auth_bytes.data(),
274 &(auth_bytes[0]), kAuthDigestLength); 274 &(auth_bytes[0]), kAuthDigestLength);
275 } 275 }
276 276
277 void SslHmacChannelAuthenticator::CheckDone(bool* callback_called) { 277 void SslHmacChannelAuthenticator::CheckDone(bool* callback_called) {
278 if (auth_write_buf_.get() == NULL && auth_read_buf_.get() == NULL) { 278 if (auth_write_buf_.get() == NULL && auth_read_buf_.get() == NULL) {
279 DCHECK(socket_.get() != NULL); 279 DCHECK(socket_.get() != NULL);
280 if (callback_called) 280 if (callback_called)
281 *callback_called = true; 281 *callback_called = true;
282 282
283 CallDoneCallback(net::OK, socket_.PassAs<net::StreamSocket>()); 283 CallDoneCallback(net::OK, socket_.Pass());
284 } 284 }
285 } 285 }
286 286
287 void SslHmacChannelAuthenticator::NotifyError(int error) { 287 void SslHmacChannelAuthenticator::NotifyError(int error) {
288 CallDoneCallback(error, scoped_ptr<net::StreamSocket>()); 288 CallDoneCallback(error, nullptr);
289 } 289 }
290 290
291 void SslHmacChannelAuthenticator::CallDoneCallback( 291 void SslHmacChannelAuthenticator::CallDoneCallback(
292 int error, 292 int error,
293 scoped_ptr<net::StreamSocket> socket) { 293 scoped_ptr<net::StreamSocket> socket) {
294 DoneCallback callback = done_callback_; 294 DoneCallback callback = done_callback_;
295 done_callback_.Reset(); 295 done_callback_.Reset();
296 callback.Run(error, socket.Pass()); 296 callback.Run(error, socket.Pass());
297 } 297 }
298 298
299 } // namespace protocol 299 } // namespace protocol
300 } // namespace remoting 300 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698