Chromium Code Reviews| Index: net/quic/crypto/quic_crypto_client_config.h |
| diff --git a/net/quic/crypto/quic_crypto_client_config.h b/net/quic/crypto/quic_crypto_client_config.h |
| index 896f5fb03f5393b4bd488bf9520be7e47f851b5c..1ea0145075b09bf0fdd6ca41f8c3ed1675a98f32 100644 |
| --- a/net/quic/crypto/quic_crypto_client_config.h |
| +++ b/net/quic/crypto/quic_crypto_client_config.h |
| @@ -22,8 +22,6 @@ class CryptoHandshakeMessage; |
| class ProofVerifier; |
| class ProofVerifyDetails; |
| class QuicRandom; |
| -class QuicServerInfo; |
| -class QuicServerInfoFactory; |
| // QuicCryptoClientConfig contains crypto-related configuration settings for a |
| // client. Note that this object isn't thread-safe. It's designed to be used on |
| @@ -36,7 +34,6 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| class NET_EXPORT_PRIVATE CachedState { |
| public: |
| CachedState(); |
| - explicit CachedState(scoped_ptr<QuicServerInfo> quic_server_info); |
| ~CachedState(); |
| // IsComplete returns true if this object contains enough information to |
| @@ -70,8 +67,7 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| void ClearProof(); |
| // SetProofValid records that the certificate chain and signature have been |
| - // validated and that it's safe to assume that the server is legitimate. It |
| - // persists the server config information to disk cache. |
| + // validated and that it's safe to assume that the server is legitimate. |
| // (Note: this does not check the chain or signature.) |
| void SetProofValid(); |
| @@ -80,6 +76,12 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| // generation_counter_ in sync. |
| void SetProofInvalid(); |
| + bool Initialize(base::StringPiece server_config, |
|
wtc
2014/03/12 23:13:20
Nit: if the Initialize method is similar to Initia
Ryan Hamilton
2014/03/13 16:38:07
Done.
|
| + base::StringPiece signature, |
| + base::StringPiece source_address_token, |
| + const std::vector<std::string>& certs, |
|
wtc
2014/03/12 23:13:20
I suggest listing the first four arguments in the
Ryan Hamilton
2014/03/13 16:38:07
Done. However, the certs class member is actually
|
| + QuicWallTime now); |
| + |
| const std::string& server_config() const; |
| const std::string& source_address_token() const; |
| const std::vector<std::string>& certs() const; |
| @@ -87,7 +89,6 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| bool proof_valid() const; |
| uint64 generation_counter() const; |
| const ProofVerifyDetails* proof_verify_details() const; |
| - QuicServerInfo* quic_server_info() const; |
| void set_source_address_token(base::StringPiece token); |
| @@ -100,17 +101,6 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| // unchanged. |
| void InitializeFrom(const CachedState& other); |
| - // Fill out the |server_config_|, |source_address_token_|, |certs_| and |
| - // |server_config_sig_| fields from |quic_server_info_|. |quic_server_info_| |
| - // reads this information from the disk cache. |now| is used to judge |
| - // whether server config from disk cache has expired. Returns true if it has |
| - // loaded the data from disk cache successfully. |
| - bool LoadQuicServerInfo(QuicWallTime now); |
| - |
| - // Save the server config information so that we can perform 0-RTT handshake |
| - // with a server. |
| - void SaveQuicServerInfo(); |
| - |
| private: |
| std::string server_config_; // A serialized handshake message. |
| std::string source_address_token_; // An opaque proof of IP ownership. |
| @@ -120,7 +110,6 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| bool server_config_valid_; // True if |server_config_| is correctly |
| // signed and |certs_| has been |
| // validated. |
| - bool need_to_persist_; // Persist to disk if True. |
| // Generation counter associated with the |server_config_|, |certs_| and |
| // |server_config_sig_| combination. It is incremented whenever we set |
| // server_config_valid_ to false. |
| @@ -131,9 +120,6 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| // scfg contains the cached, parsed value of |server_config|. |
| mutable scoped_ptr<CryptoHandshakeMessage> scfg_; |
| - // |quic_server_info_| is used to fetch crypto config information from disk. |
| - scoped_ptr<QuicServerInfo> quic_server_info_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(CachedState); |
| }; |
| @@ -143,17 +129,8 @@ class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| // Sets the members to reasonable, default values. |
| void SetDefaults(); |
| - // Create returns a CachedState for the given hostname. It creates a |
| - // CachedState and caches it. If |quic_server_info_factory| is not NULL, then |
| - // it is used to create QuicServerInfo which is used to fetch crypto config |
| - // information from disk for the given hostname. |
| - CachedState* Create(const std::string& server_hostname, |
| - QuicServerInfoFactory* quic_server_info_factory); |
| - |
| // LookupOrCreate returns a CachedState for the given hostname. If no such |
| // CachedState currently exists, it will be created and cached. |
| - // TODO(rtenneti): fix the server code and pass QuicServerInfoFactory as |
| - // argument. |
| CachedState* LookupOrCreate(const std::string& server_hostname); |
| // FillInchoateClientHello sets |out| to be a CHLO message that elicits a |