| OLD | NEW |
| 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/core/quic_crypto_client_stream.h" | 5 #include "net/quic/core/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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 QuicCryptoClientStream::ChannelIDSourceCallbackImpl:: | 32 QuicCryptoClientStream::ChannelIDSourceCallbackImpl:: |
| 33 ~ChannelIDSourceCallbackImpl() {} | 33 ~ChannelIDSourceCallbackImpl() {} |
| 34 | 34 |
| 35 void QuicCryptoClientStream::ChannelIDSourceCallbackImpl::Run( | 35 void QuicCryptoClientStream::ChannelIDSourceCallbackImpl::Run( |
| 36 std::unique_ptr<ChannelIDKey>* channel_id_key) { | 36 std::unique_ptr<ChannelIDKey>* channel_id_key) { |
| 37 if (stream_ == nullptr) { | 37 if (stream_ == nullptr) { |
| 38 return; | 38 return; |
| 39 } | 39 } |
| 40 | 40 |
| 41 stream_->channel_id_key_.reset(channel_id_key->release()); | 41 stream_->channel_id_key_ = std::move(*channel_id_key); |
| 42 stream_->channel_id_source_callback_run_ = true; | 42 stream_->channel_id_source_callback_run_ = true; |
| 43 stream_->channel_id_source_callback_ = nullptr; | 43 stream_->channel_id_source_callback_ = nullptr; |
| 44 stream_->DoHandshakeLoop(nullptr); | 44 stream_->DoHandshakeLoop(nullptr); |
| 45 | 45 |
| 46 // The ChannelIDSource owns this object and will delete it when this method | 46 // The ChannelIDSource owns this object and will delete it when this method |
| 47 // returns. | 47 // returns. |
| 48 } | 48 } |
| 49 | 49 |
| 50 void QuicCryptoClientStream::ChannelIDSourceCallbackImpl::Cancel() { | 50 void QuicCryptoClientStream::ChannelIDSourceCallbackImpl::Cancel() { |
| 51 stream_ = nullptr; | 51 stream_ = nullptr; |
| 52 } | 52 } |
| 53 | 53 |
| 54 QuicCryptoClientStream::ProofVerifierCallbackImpl::ProofVerifierCallbackImpl( | 54 QuicCryptoClientStream::ProofVerifierCallbackImpl::ProofVerifierCallbackImpl( |
| 55 QuicCryptoClientStream* stream) | 55 QuicCryptoClientStream* stream) |
| 56 : stream_(stream) {} | 56 : stream_(stream) {} |
| 57 | 57 |
| 58 QuicCryptoClientStream::ProofVerifierCallbackImpl:: | 58 QuicCryptoClientStream::ProofVerifierCallbackImpl:: |
| 59 ~ProofVerifierCallbackImpl() {} | 59 ~ProofVerifierCallbackImpl() {} |
| 60 | 60 |
| 61 void QuicCryptoClientStream::ProofVerifierCallbackImpl::Run( | 61 void QuicCryptoClientStream::ProofVerifierCallbackImpl::Run( |
| 62 bool ok, | 62 bool ok, |
| 63 const string& error_details, | 63 const string& error_details, |
| 64 std::unique_ptr<ProofVerifyDetails>* details) { | 64 std::unique_ptr<ProofVerifyDetails>* details) { |
| 65 if (stream_ == nullptr) { | 65 if (stream_ == nullptr) { |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 | 68 |
| 69 stream_->verify_ok_ = ok; | 69 stream_->verify_ok_ = ok; |
| 70 stream_->verify_error_details_ = error_details; | 70 stream_->verify_error_details_ = error_details; |
| 71 stream_->verify_details_.reset(details->release()); | 71 stream_->verify_details_ = std::move(*details); |
| 72 stream_->proof_verify_callback_ = nullptr; | 72 stream_->proof_verify_callback_ = nullptr; |
| 73 stream_->DoHandshakeLoop(nullptr); | 73 stream_->DoHandshakeLoop(nullptr); |
| 74 | 74 |
| 75 // The ProofVerifier owns this object and will delete it when this method | 75 // The ProofVerifier owns this object and will delete it when this method |
| 76 // returns. | 76 // returns. |
| 77 } | 77 } |
| 78 | 78 |
| 79 void QuicCryptoClientStream::ProofVerifierCallbackImpl::Cancel() { | 79 void QuicCryptoClientStream::ProofVerifierCallbackImpl::Cancel() { |
| 80 stream_ = nullptr; | 80 stream_ = nullptr; |
| 81 } | 81 } |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 } | 667 } |
| 668 for (size_t i = 0; i < num_their_proof_demands; i++) { | 668 for (size_t i = 0; i < num_their_proof_demands; i++) { |
| 669 if (their_proof_demands[i] == kCHID) { | 669 if (their_proof_demands[i] == kCHID) { |
| 670 return true; | 670 return true; |
| 671 } | 671 } |
| 672 } | 672 } |
| 673 return false; | 673 return false; |
| 674 } | 674 } |
| 675 | 675 |
| 676 } // namespace net | 676 } // namespace net |
| OLD | NEW |