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

Side by Side Diff: net/quic/quic_crypto_client_stream.cc

Issue 2126023002: use std::unique_ptr for the callback argument of QUIC's ProofVerifier::Verify proof to make ownersh… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126327823
Patch Set: Created 4 years, 5 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 "net/quic/quic_crypto_client_stream.h" 5 #include "net/quic/quic_crypto_client_stream.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 469
470 ProofVerifierCallbackImpl* proof_verify_callback = 470 ProofVerifierCallbackImpl* proof_verify_callback =
471 new ProofVerifierCallbackImpl(this); 471 new ProofVerifierCallbackImpl(this);
472 472
473 verify_ok_ = false; 473 verify_ok_ = false;
474 474
475 QuicAsyncStatus status = verifier->VerifyProof( 475 QuicAsyncStatus status = verifier->VerifyProof(
476 server_id_.host(), server_id_.port(), cached->server_config(), 476 server_id_.host(), server_id_.port(), cached->server_config(),
477 session()->connection()->version(), chlo_hash_, cached->certs(), 477 session()->connection()->version(), chlo_hash_, cached->certs(),
478 cached->cert_sct(), cached->signature(), verify_context_.get(), 478 cached->cert_sct(), cached->signature(), verify_context_.get(),
479 &verify_error_details_, &verify_details_, proof_verify_callback); 479 &verify_error_details_, &verify_details_,
480 std::unique_ptr<ProofVerifierCallback>(proof_verify_callback));
480 481
481 switch (status) { 482 switch (status) {
482 case QUIC_PENDING: 483 case QUIC_PENDING:
483 proof_verify_callback_ = proof_verify_callback; 484 proof_verify_callback_ = proof_verify_callback;
484 DVLOG(1) << "Doing VerifyProof"; 485 DVLOG(1) << "Doing VerifyProof";
485 break; 486 break;
486 case QUIC_FAILURE: 487 case QUIC_FAILURE:
487 delete proof_verify_callback;
488 break; 488 break;
489 case QUIC_SUCCESS: 489 case QUIC_SUCCESS:
490 delete proof_verify_callback;
491 verify_ok_ = true; 490 verify_ok_ = true;
492 break; 491 break;
493 } 492 }
494 return status; 493 return status;
495 } 494 }
496 495
497 void QuicCryptoClientStream::DoVerifyProofComplete( 496 void QuicCryptoClientStream::DoVerifyProofComplete(
498 QuicCryptoClientConfig::CachedState* cached) { 497 QuicCryptoClientConfig::CachedState* cached) {
499 if (!proof_verify_start_time_.is_null()) { 498 if (!proof_verify_start_time_.is_null()) {
500 UMA_HISTOGRAM_TIMES("Net.QuicSession.VerifyProofTime.CachedServerConfig", 499 UMA_HISTOGRAM_TIMES("Net.QuicSession.VerifyProofTime.CachedServerConfig",
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 } 685 }
687 for (size_t i = 0; i < num_their_proof_demands; i++) { 686 for (size_t i = 0; i < num_their_proof_demands; i++) {
688 if (their_proof_demands[i] == kCHID) { 687 if (their_proof_demands[i] == kCHID) {
689 return true; 688 return true;
690 } 689 }
691 } 690 }
692 return false; 691 return false;
693 } 692 }
694 693
695 } // namespace net 694 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698