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

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

Issue 2417023003: Remove stl_util's deletion functions from: (Closed)
Patch Set: internal snapshot 10 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
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.h ('k') | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f976fb6c83384330f5b31af93d3b85693ae99e77..a42e687b226574fa08050ba9e111784a2db42a4b 100644
--- a/net/quic/core/crypto/quic_crypto_client_config.cc
+++ b/net/quic/core/crypto/quic_crypto_client_config.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
@@ -62,7 +63,6 @@ QuicCryptoClientConfig::QuicCryptoClientConfig(
}
QuicCryptoClientConfig::~QuicCryptoClientConfig() {
- base::STLDeleteValues(&cached_states_);
}
QuicCryptoClientConfig::CachedState::CachedState()
@@ -393,13 +393,13 @@ void QuicCryptoClientConfig::SetDefaults() {
QuicCryptoClientConfig::CachedState* QuicCryptoClientConfig::LookupOrCreate(
const QuicServerId& server_id) {
- CachedStateMap::const_iterator it = cached_states_.find(server_id);
+ auto it = cached_states_.find(server_id);
if (it != cached_states_.end()) {
- return it->second;
+ return it->second.get();
}
CachedState* cached = new CachedState;
- cached_states_.insert(std::make_pair(server_id, cached));
+ cached_states_.insert(std::make_pair(server_id, base::WrapUnique(cached)));
bool cache_populated = PopulateFromCanonicalConfig(server_id, cached);
UMA_HISTOGRAM_BOOLEAN(
"Net.QuicCryptoClientConfig.PopulatedFromCanonicalConfig",
@@ -408,8 +408,7 @@ QuicCryptoClientConfig::CachedState* QuicCryptoClientConfig::LookupOrCreate(
}
void QuicCryptoClientConfig::ClearCachedStates(const ServerIdFilter& filter) {
- for (CachedStateMap::const_iterator it = cached_states_.begin();
- it != cached_states_.end(); ++it) {
+ for (auto it = cached_states_.begin(); it != cached_states_.end(); ++it) {
if (filter.Matches(it->first))
it->second->Clear();
}
@@ -983,7 +982,7 @@ bool QuicCryptoClientConfig::PopulateFromCanonicalConfig(
const QuicServerId& canonical_server_id =
canonical_server_map_[suffix_server_id];
- CachedState* canonical_state = cached_states_[canonical_server_id];
+ CachedState* canonical_state = cached_states_[canonical_server_id].get();
if (!canonical_state->proof_valid()) {
return false;
}
« no previous file with comments | « net/quic/core/crypto/quic_crypto_client_config.h ('k') | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698