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

Unified Diff: net/quic/core/crypto/crypto_server_config_protobuf.h

Issue 2417183003: Remove stl_util's deletion functions from remaining quic code. (Closed)
Patch Set: rebase 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/crypto_server_config_protobuf.h
diff --git a/net/quic/core/crypto/crypto_server_config_protobuf.h b/net/quic/core/crypto/crypto_server_config_protobuf.h
index 28c2eb94b12f1d7c5332b3ea56060fef669d2b20..bd5e6413eb9f024f47da456e3035cca29eae70f5 100644
--- a/net/quic/core/crypto/crypto_server_config_protobuf.h
+++ b/net/quic/core/crypto/crypto_server_config_protobuf.h
@@ -8,12 +8,13 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
#include <vector>
#include "base/logging.h"
#include "base/macros.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
#include "net/quic/core/crypto/crypto_protocol.h"
@@ -47,7 +48,7 @@ class NET_EXPORT_PRIVATE QuicServerConfigProtobuf {
const PrivateKey& key(size_t i) const {
DCHECK_GT(keys_.size(), i);
- return *keys_[i];
+ return *keys_[i].get();
}
std::string config() const { return config_; }
@@ -55,11 +56,11 @@ class NET_EXPORT_PRIVATE QuicServerConfigProtobuf {
void set_config(base::StringPiece config) { config.CopyToString(&config_); }
QuicServerConfigProtobuf::PrivateKey* add_key() {
- keys_.push_back(new PrivateKey);
- return keys_.back();
+ keys_.push_back(base::MakeUnique<PrivateKey>());
+ return keys_.back().get();
}
- void clear_key() { base::STLDeleteElements(&keys_); }
+ void clear_key() { keys_.clear(); }
bool has_primary_time() const { return primary_time_ > 0; }
@@ -88,7 +89,7 @@ class NET_EXPORT_PRIVATE QuicServerConfigProtobuf {
}
private:
- std::vector<PrivateKey*> keys_;
+ std::vector<std::unique_ptr<PrivateKey>> keys_;
// config_ is a serialised config in QUIC wire format.
std::string config_;
« no previous file with comments | « net/quic/chromium/quic_stream_factory_test.cc ('k') | net/quic/core/crypto/crypto_server_config_protobuf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698