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

Side by Side Diff: net/quic/test_tools/quic_crypto_server_config_peer.h

Issue 2671273003: Get rid of more va_arg methods in favor of std::vector<> arguments. Much simpler and more readable … (Closed)
Patch Set: address Ryan's comment. Created 3 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_
6 #define NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ 6 #define NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_
7 7
8 #include "net/quic/core/crypto/quic_crypto_server_config.h" 8 #include "net/quic/core/crypto/quic_crypto_server_config.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // Attempts to validate the single source address token in |token|. 53 // Attempts to validate the single source address token in |token|.
54 HandshakeFailureReason ValidateSingleSourceAddressToken( 54 HandshakeFailureReason ValidateSingleSourceAddressToken(
55 base::StringPiece token, 55 base::StringPiece token,
56 const QuicIpAddress& ip, 56 const QuicIpAddress& ip,
57 QuicWallTime now); 57 QuicWallTime now);
58 58
59 // Returns a new server nonce. 59 // Returns a new server nonce.
60 std::string NewServerNonce(QuicRandom* rand, QuicWallTime now) const; 60 std::string NewServerNonce(QuicRandom* rand, QuicWallTime now) const;
61 61
62 // CheckConfigs compares the state of the Configs in |server_config_| to the 62 // CheckConfigs compares the state of the Configs in |server_config_| to the
63 // description given as arguments. The arguments are given as 63 // description given as arguments.
64 // nullptr-terminated pairs. The first of each pair is the server config ID of 64 // The first of each pair is the server config ID of a Config. The second is a
65 // a Config. The second is a boolean describing whether the config is the 65 // boolean describing whether the config is the primary. For example:
66 // primary. For example: 66 // CheckConfigs(std::vector<std::pair<ServerConfigID, bool>>()); // checks
67 // CheckConfigs(nullptr); // checks that no Configs are loaded. 67 // that no Configs are loaded.
68 // 68 //
69 // // Checks that exactly three Configs are loaded with the given IDs and 69 // // Checks that exactly three Configs are loaded with the given IDs and
70 // // status. 70 // // status.
71 // CheckConfigs( 71 // CheckConfigs(
72 // "id1", false, 72 // {{"id1", false},
73 // "id2", true, 73 // {"id2", true},
74 // "id3", false, 74 // {"id3", false}});
75 // nullptr); 75 void CheckConfigs(
76 void CheckConfigs(const char* server_config_id1, ...); 76 std::vector<std::pair<ServerConfigID, bool>> expected_ids_and_status);
77 77
78 // ConfigsDebug returns a string that contains debugging information about 78 // ConfigsDebug returns a string that contains debugging information about
79 // the set of Configs loaded in |server_config_| and their status. 79 // the set of Configs loaded in |server_config_| and their status.
80 std::string ConfigsDebug(); 80 std::string ConfigsDebug();
81 81
82 void SelectNewPrimaryConfig(int seconds); 82 void SelectNewPrimaryConfig(int seconds);
83 83
84 static std::string CompressChain( 84 static std::string CompressChain(
85 QuicCompressedCertsCache* compressed_certs_cache, 85 QuicCompressedCertsCache* compressed_certs_cache,
86 const QuicReferenceCountedPointer<ProofSource::Chain>& chain, 86 const QuicReferenceCountedPointer<ProofSource::Chain>& chain,
87 const std::string& client_common_set_hashes, 87 const std::string& client_common_set_hashes,
88 const std::string& client_cached_cert_hashes, 88 const std::string& client_cached_cert_hashes,
89 const CommonCertSets* common_sets); 89 const CommonCertSets* common_sets);
90 90
91 uint32_t source_address_token_future_secs(); 91 uint32_t source_address_token_future_secs();
92 92
93 uint32_t source_address_token_lifetime_secs(); 93 uint32_t source_address_token_lifetime_secs();
94 94
95 private: 95 private:
96 QuicCryptoServerConfig* server_config_; 96 QuicCryptoServerConfig* server_config_;
97 }; 97 };
98 98
99 } // namespace test 99 } // namespace test
100 } // namespace net 100 } // namespace net
101 101
102 #endif // NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ 102 #endif // NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_
OLDNEW
« no previous file with comments | « net/quic/core/crypto/quic_crypto_server_config_test.cc ('k') | net/quic/test_tools/quic_crypto_server_config_peer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698