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

Side by Side Diff: net/quic/core/crypto/quic_crypto_server_config.h

Issue 2338013004: Simplify lifetime management of ValidateClientHelloResultCallback::Result objects (Closed)
Patch Set: Created 4 years, 3 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ 5 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 ClientHelloInfo info; 98 ClientHelloInfo info;
99 QuicErrorCode error_code; 99 QuicErrorCode error_code;
100 std::string error_details; 100 std::string error_details;
101 101
102 // Populated if the CHLO STK contained a CachedNetworkParameters proto. 102 // Populated if the CHLO STK contained a CachedNetworkParameters proto.
103 CachedNetworkParameters cached_network_params; 103 CachedNetworkParameters cached_network_params;
104 }; 104 };
105 105
106 ValidateClientHelloResultCallback(); 106 ValidateClientHelloResultCallback();
107 virtual ~ValidateClientHelloResultCallback(); 107 virtual ~ValidateClientHelloResultCallback();
108 void Run(const Result* result, std::unique_ptr<ProofSource::Details> details); 108 void Run(std::unique_ptr<Result> result,
109 std::unique_ptr<ProofSource::Details> details);
109 110
110 protected: 111 protected:
111 virtual void RunImpl(const CryptoHandshakeMessage& client_hello, 112 virtual void RunImpl(std::unique_ptr<Result> result,
112 const Result& result,
113 std::unique_ptr<ProofSource::Details> details) = 0; 113 std::unique_ptr<ProofSource::Details> details) = 0;
114 114
115 private: 115 private:
116 DISALLOW_COPY_AND_ASSIGN(ValidateClientHelloResultCallback); 116 DISALLOW_COPY_AND_ASSIGN(ValidateClientHelloResultCallback);
117 }; 117 };
118 118
119 // Callback used to receive the results of a call to 119 // Callback used to receive the results of a call to
120 // BuildServerConfigUpdateMessage. 120 // BuildServerConfigUpdateMessage.
121 class BuildServerConfigUpdateMessageResultCallback { 121 class BuildServerConfigUpdateMessageResultCallback {
122 public: 122 public:
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // EvaluateClientHello checks |client_hello| for gross errors and determines 511 // EvaluateClientHello checks |client_hello| for gross errors and determines
512 // whether it can be shown to be fresh (i.e. not a replay). The results are 512 // whether it can be shown to be fresh (i.e. not a replay). The results are
513 // written to |info|. 513 // written to |info|.
514 void EvaluateClientHello( 514 void EvaluateClientHello(
515 const IPAddress& server_ip, 515 const IPAddress& server_ip,
516 QuicVersion version, 516 QuicVersion version,
517 const uint8_t* primary_orbit, 517 const uint8_t* primary_orbit,
518 scoped_refptr<Config> requested_config, 518 scoped_refptr<Config> requested_config,
519 scoped_refptr<Config> primary_config, 519 scoped_refptr<Config> primary_config,
520 QuicCryptoProof* crypto_proof, 520 QuicCryptoProof* crypto_proof,
521 ValidateClientHelloResultCallback::Result* client_hello_state, 521 std::unique_ptr<ValidateClientHelloResultCallback::Result>
522 client_hello_state,
522 ValidateClientHelloResultCallback* done_cb) const; 523 ValidateClientHelloResultCallback* done_cb) const;
523 524
524 // Callback class for bridging between EvaluateClientHello and 525 // Callback class for bridging between EvaluateClientHello and
525 // EvaluateClientHelloAfterGetProof 526 // EvaluateClientHelloAfterGetProof
526 friend class EvaluateClientHelloCallback; 527 friend class EvaluateClientHelloCallback;
527 528
528 // Continuation of EvaluateClientHello after the call to 529 // Continuation of EvaluateClientHello after the call to
529 // ProofSource::GetProof. |found_error| indicates whether an error was 530 // ProofSource::GetProof. |found_error| indicates whether an error was
530 // detected in EvaluateClientHello, and |get_proof_failed| indicates whether 531 // detected in EvaluateClientHello, and |get_proof_failed| indicates whether
531 // GetProof failed. If GetProof was not run, then |get_proof_failed| will be 532 // GetProof failed. If GetProof was not run, then |get_proof_failed| will be
532 // set to false. 533 // set to false.
533 void EvaluateClientHelloAfterGetProof( 534 void EvaluateClientHelloAfterGetProof(
534 bool found_error, 535 bool found_error,
535 const IPAddress& server_ip, 536 const IPAddress& server_ip,
536 QuicVersion version, 537 QuicVersion version,
537 const uint8_t* primary_orbit, 538 const uint8_t* primary_orbit,
538 scoped_refptr<Config> requested_config, 539 scoped_refptr<Config> requested_config,
539 scoped_refptr<Config> primary_config, 540 scoped_refptr<Config> primary_config,
540 QuicCryptoProof* crypto_proof, 541 QuicCryptoProof* crypto_proof,
541 std::unique_ptr<ProofSource::Details> proof_source_details, 542 std::unique_ptr<ProofSource::Details> proof_source_details,
542 bool get_proof_failed, 543 bool get_proof_failed,
543 ValidateClientHelloResultCallback::Result* client_hello_state, 544 std::unique_ptr<ValidateClientHelloResultCallback::Result>
545 client_hello_state,
544 ValidateClientHelloResultCallback* done_cb) const; 546 ValidateClientHelloResultCallback* done_cb) const;
545 547
546 // BuildRejection sets |out| to be a REJ message in reply to |client_hello|. 548 // BuildRejection sets |out| to be a REJ message in reply to |client_hello|.
547 void BuildRejection(QuicVersion version, 549 void BuildRejection(QuicVersion version,
548 QuicWallTime now, 550 QuicWallTime now,
549 const Config& config, 551 const Config& config,
550 const CryptoHandshakeMessage& client_hello, 552 const CryptoHandshakeMessage& client_hello,
551 const ClientHelloInfo& info, 553 const ClientHelloInfo& info,
552 const CachedNetworkParameters& cached_network_params, 554 const CachedNetworkParameters& cached_network_params,
553 bool use_stateless_rejects, 555 bool use_stateless_rejects,
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 std::string cert_sct; 791 std::string cert_sct;
790 // The server config that is used for this proof (and the rest of the 792 // The server config that is used for this proof (and the rest of the
791 // request). 793 // request).
792 scoped_refptr<QuicCryptoServerConfig::Config> config; 794 scoped_refptr<QuicCryptoServerConfig::Config> config;
793 std::string primary_scid; 795 std::string primary_scid;
794 }; 796 };
795 797
796 } // namespace net 798 } // namespace net
797 799
798 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_ 800 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_SERVER_CONFIG_H_
OLDNEW
« no previous file with comments | « net/quic/core/crypto/crypto_server_test.cc ('k') | net/quic/core/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698