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

Unified Diff: net/spdy/core/hpack/hpack_constants.cc

Issue 2840563003: Implement SpdyMakeUnique and SpdyWrapUnique. (Closed)
Patch Set: Created 3 years, 8 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/spdy/core/fuzzing/hpack_fuzz_util.cc ('k') | net/spdy/core/hpack/hpack_encoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/core/hpack/hpack_constants.cc
diff --git a/net/spdy/core/hpack/hpack_constants.cc b/net/spdy/core/hpack/hpack_constants.cc
index fd97bef464e7280775cdbe89f1129b0a608e6936..2c96c1dc8f8af68087908235e5c07a0b5688d896 100644
--- a/net/spdy/core/hpack/hpack_constants.cc
+++ b/net/spdy/core/hpack/hpack_constants.cc
@@ -11,6 +11,7 @@
#include "base/memory/singleton.h"
#include "net/spdy/core/hpack/hpack_huffman_table.h"
#include "net/spdy/core/hpack/hpack_static_table.h"
+#include "net/spdy/platform/api/spdy_ptr_util.h"
namespace net {
@@ -22,7 +23,7 @@ struct SharedHpackHuffmanTable {
public:
SharedHpackHuffmanTable() {
std::vector<HpackHuffmanSymbol> code = HpackHuffmanCode();
- std::unique_ptr<HpackHuffmanTable> mutable_table(new HpackHuffmanTable());
+ auto mutable_table = SpdyMakeUnique<HpackHuffmanTable>();
CHECK(mutable_table->Initialize(&code[0], code.size()));
CHECK(mutable_table->IsInitialized());
table = std::move(mutable_table);
@@ -41,7 +42,7 @@ struct SharedHpackStaticTable {
public:
SharedHpackStaticTable() {
std::vector<HpackStaticEntry> static_table = HpackStaticTableVector();
- std::unique_ptr<HpackStaticTable> mutable_table(new HpackStaticTable());
+ auto mutable_table = SpdyMakeUnique<HpackStaticTable>();
mutable_table->Initialize(&static_table[0], static_table.size());
CHECK(mutable_table->IsInitialized());
table = std::move(mutable_table);
« no previous file with comments | « net/spdy/core/fuzzing/hpack_fuzz_util.cc ('k') | net/spdy/core/hpack/hpack_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698