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

Unified Diff: net/quic/core/crypto/quic_crypto_client_config.cc

Issue 2460223002: Adds std:: to stl types (#049) (Closed)
Patch Set: for review Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/core/crypto/quic_crypto_client_config.cc
diff --git a/net/quic/core/crypto/quic_crypto_client_config.cc b/net/quic/core/crypto/quic_crypto_client_config.cc
index 3df23ce756f77034dfb4452d6e53acbb1236770d..b2f7a5854f4fc06344205ee9596e9eaa769b8db1 100644
--- a/net/quic/core/crypto/quic_crypto_client_config.cc
+++ b/net/quic/core/crypto/quic_crypto_client_config.cc
@@ -192,14 +192,15 @@ void QuicCryptoClientConfig::CachedState::InvalidateServerConfig() {
server_config_.clear();
scfg_.reset();
SetProofInvalid();
- queue<QuicConnectionId> empty_queue;
+ std::queue<QuicConnectionId> empty_queue;
swap(server_designated_connection_ids_, empty_queue);
}
-void QuicCryptoClientConfig::CachedState::SetProof(const vector<string>& certs,
- StringPiece cert_sct,
- StringPiece chlo_hash,
- StringPiece signature) {
+void QuicCryptoClientConfig::CachedState::SetProof(
+ const std::vector<string>& certs,
+ StringPiece cert_sct,
+ StringPiece chlo_hash,
+ StringPiece signature) {
bool has_changed = signature != server_config_sig_ ||
chlo_hash != chlo_hash_ || certs_.size() != certs.size();
@@ -235,7 +236,7 @@ void QuicCryptoClientConfig::CachedState::Clear() {
proof_verify_details_.reset();
scfg_.reset();
++generation_counter_;
- queue<QuicConnectionId> empty_queue;
+ std::queue<QuicConnectionId> empty_queue;
swap(server_designated_connection_ids_, empty_queue);
}
@@ -259,8 +260,8 @@ void QuicCryptoClientConfig::CachedState::SetProofInvalid() {
bool QuicCryptoClientConfig::CachedState::Initialize(
StringPiece server_config,
StringPiece source_address_token,
- const vector<string>& certs,
- StringPiece cert_sct,
+ const std::vector<string>& certs,
+ const string& cert_sct,
StringPiece chlo_hash,
StringPiece signature,
QuicWallTime now,
@@ -281,11 +282,11 @@ bool QuicCryptoClientConfig::CachedState::Initialize(
return false;
}
+ chlo_hash.CopyToString(&chlo_hash_);
signature.CopyToString(&server_config_sig_);
source_address_token.CopyToString(&source_address_token_);
- cert_sct.CopyToString(&cert_sct_);
- chlo_hash.CopyToString(&chlo_hash_);
certs_ = certs;
+ cert_sct_ = cert_sct;
return true;
}
@@ -298,7 +299,7 @@ const string& QuicCryptoClientConfig::CachedState::source_address_token()
return source_address_token_;
}
-const vector<string>& QuicCryptoClientConfig::CachedState::certs() const {
+const std::vector<string>& QuicCryptoClientConfig::CachedState::certs() const {
return certs_;
}
@@ -468,17 +469,17 @@ void QuicCryptoClientConfig::FillInchoateClientHello(
out->SetStringPiece(kCertificateSCTTag, "");
- const vector<string>& certs = cached->certs();
+ const std::vector<string>& certs = cached->certs();
// We save |certs| in the QuicCryptoNegotiatedParameters so that, if the
// client config is being used for multiple connections, another connection
// doesn't update the cached certificates and cause us to be unable to
// process the server's compressed certificate chain.
out_params->cached_certs = certs;
if (!certs.empty()) {
- vector<uint64_t> hashes;
+ std::vector<uint64_t> hashes;
hashes.reserve(certs.size());
- for (vector<string>::const_iterator i = certs.begin(); i != certs.end();
- ++i) {
+ for (std::vector<string>::const_iterator i = certs.begin();
+ i != certs.end(); ++i) {
hashes.push_back(QuicUtils::FNV1a_64_Hash(i->data(), i->size()));
}
out->SetVector(kCCRT, hashes);
@@ -612,7 +613,7 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
}
out->SetStringPiece(kPUBS, out_params->client_key_exchange->public_value());
- const vector<string>& certs = cached->certs();
+ const std::vector<string>& certs = cached->certs();
if (certs.empty()) {
*error_details = "No certs to calculate XLCT";
return QUIC_CRYPTO_INTERNAL_ERROR;
@@ -726,7 +727,7 @@ QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
QuicWallTime now,
QuicVersion version,
StringPiece chlo_hash,
- const vector<string>& cached_certs,
+ const std::vector<string>& cached_certs,
CachedState* cached,
string* error_details) {
DCHECK(error_details != nullptr);
@@ -763,7 +764,7 @@ QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
bool has_proof = message.GetStringPiece(kPROF, &proof);
bool has_cert = message.GetStringPiece(kCertificateTag, &cert_bytes);
if (has_proof && has_cert) {
- vector<string> certs;
+ std::vector<string> certs;
if (!CertCompressor::DecompressChain(cert_bytes, cached_certs,
common_cert_sets, &certs)) {
*error_details = "Certificate data invalid";

Powered by Google App Engine
This is Rietveld 408576698