Remove usages of QuicMakeUnique, Http2MakeUnique, SpdyMakeUnique.
This is made possible by all embedders finally supporting C++14's
std::make_unique, which is already used in more than 100 files in quic/.
gfe-relnote: n/a, no functional change.
PiperOrigin-RevId: 273935577
Change-Id: Icd6dd234422f286d897ea13ae609a67310f96380
diff --git a/spdy/core/hpack/hpack_encoder.cc b/spdy/core/hpack/hpack_encoder.cc
index f4f427c..af76c3b 100644
--- a/spdy/core/hpack/hpack_encoder.cc
+++ b/spdy/core/hpack/hpack_encoder.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <limits>
+#include <utility>
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
@@ -13,7 +14,6 @@
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
namespace spdy {
@@ -322,8 +322,8 @@
: GatherRepresentation(header, ®ular_headers_);
}
}
- header_it_ =
- SpdyMakeUnique<RepresentationIterator>(pseudo_headers_, regular_headers_);
+ header_it_ = std::make_unique<RepresentationIterator>(pseudo_headers_,
+ regular_headers_);
encoder_->MaybeEmitTableSize();
}
@@ -360,7 +360,7 @@
std::unique_ptr<HpackEncoder::ProgressiveEncoder> HpackEncoder::EncodeHeaderSet(
const SpdyHeaderBlock& header_set) {
- return SpdyMakeUnique<Encoderator>(header_set, this);
+ return std::make_unique<Encoderator>(header_set, this);
}
} // namespace spdy
diff --git a/spdy/core/http2_frame_decoder_adapter.cc b/spdy/core/http2_frame_decoder_adapter.cc
index d5b20f0..bc2263e 100644
--- a/spdy/core/http2_frame_decoder_adapter.cc
+++ b/spdy/core/http2_frame_decoder_adapter.cc
@@ -32,7 +32,6 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
using ::spdy::ExtensionVisitorInterface;
@@ -48,7 +47,6 @@
using ::spdy::SpdyFrameType;
using ::spdy::SpdyHeadersHandlerInterface;
using ::spdy::SpdyKnownSettingsId;
-using ::spdy::SpdyMakeUnique;
using ::spdy::SpdySettingsId;
namespace http2 {
@@ -811,7 +809,7 @@
CorruptFrameHeader(&frame_header_);
CorruptFrameHeader(&hpack_first_frame_header_);
- frame_decoder_ = SpdyMakeUnique<Http2FrameDecoder>(this);
+ frame_decoder_ = std::make_unique<Http2FrameDecoder>(this);
hpack_decoder_ = nullptr;
}
@@ -950,7 +948,7 @@
HpackDecoderAdapter* Http2DecoderAdapter::GetHpackDecoder() {
if (hpack_decoder_ == nullptr) {
- hpack_decoder_ = SpdyMakeUnique<HpackDecoderAdapter>();
+ hpack_decoder_ = std::make_unique<HpackDecoderAdapter>();
}
return hpack_decoder_.get();
}
diff --git a/spdy/core/http2_priority_write_scheduler.h b/spdy/core/http2_priority_write_scheduler.h
index 1255839..4a2b4f0 100644
--- a/spdy/core/http2_priority_write_scheduler.h
+++ b/spdy/core/http2_priority_write_scheduler.h
@@ -24,7 +24,6 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_map_util.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
namespace spdy {
@@ -198,7 +197,7 @@
template <typename StreamIdType>
Http2PriorityWriteScheduler<StreamIdType>::Http2PriorityWriteScheduler() {
- auto root_stream_info = SpdyMakeUnique<StreamInfo>();
+ auto root_stream_info = std::make_unique<StreamInfo>();
root_stream_info_ = root_stream_info.get();
root_stream_info->id = kHttp2RootStreamId;
root_stream_info->weight = kHttp2DefaultStreamWeight;
@@ -238,7 +237,7 @@
parent = root_stream_info_;
}
- auto new_stream_info = SpdyMakeUnique<StreamInfo>();
+ auto new_stream_info = std::make_unique<StreamInfo>();
StreamInfo* new_stream_info_ptr = new_stream_info.get();
new_stream_info_ptr->id = stream_id;
new_stream_info_ptr->weight = precedence.weight();
diff --git a/spdy/core/mock_spdy_framer_visitor.h b/spdy/core/mock_spdy_framer_visitor.h
index 9dd709c..8600f5c 100644
--- a/spdy/core/mock_spdy_framer_visitor.h
+++ b/spdy/core/mock_spdy_framer_visitor.h
@@ -7,10 +7,10 @@
#include <cstdint>
#include <memory>
+#include <utility>
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
@@ -84,7 +84,7 @@
SpdyHeadersHandlerInterface* ReturnTestHeadersHandler(
SpdyStreamId /* stream_id */) {
if (headers_handler_ == nullptr) {
- headers_handler_ = SpdyMakeUnique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<TestHeadersHandler>();
}
return headers_handler_.get();
}
diff --git a/spdy/core/spdy_deframer_visitor.cc b/spdy/core/spdy_deframer_visitor.cc
index 0ea2020..e49b755 100644
--- a/spdy/core/spdy_deframer_visitor.cc
+++ b/spdy/core/spdy_deframer_visitor.cc
@@ -19,7 +19,6 @@
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
using ::testing::AssertionFailure;
@@ -240,13 +239,13 @@
// static
std::unique_ptr<SpdyTestDeframer> SpdyTestDeframer::CreateConverter(
std::unique_ptr<SpdyDeframerVisitorInterface> listener) {
- return SpdyMakeUnique<SpdyTestDeframerImpl>(std::move(listener));
+ return std::make_unique<SpdyTestDeframerImpl>(std::move(listener));
}
void SpdyTestDeframerImpl::AtDataEnd() {
SPDY_DVLOG(1) << "AtDataEnd";
CHECK_EQ(data_len_, padding_len_ + data_->size());
- auto ptr = SpdyMakeUnique<SpdyDataIR>(stream_id_, std::move(*data_));
+ auto ptr = std::make_unique<SpdyDataIR>(stream_id_, std::move(*data_));
CHECK_EQ(0u, data_->size());
data_.reset();
@@ -270,7 +269,7 @@
if (HTTP2_DIE_IF_NULL(goaway_description_)->empty()) {
listener_->OnGoAway(std::move(goaway_ir_));
} else {
- listener_->OnGoAway(SpdyMakeUnique<SpdyGoAwayIR>(
+ listener_->OnGoAway(std::make_unique<SpdyGoAwayIR>(
goaway_ir_->last_good_stream_id(), goaway_ir_->error_code(),
std::move(*goaway_description_)));
CHECK_EQ(0u, goaway_description_->size());
@@ -416,7 +415,7 @@
CHECK_EQ(frame_type_, UNSET)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK_GT(stream_id, 0u);
- auto ptr = SpdyMakeUnique<SpdyAltSvcIR>(stream_id);
+ auto ptr = std::make_unique<SpdyAltSvcIR>(stream_id);
ptr->set_origin(std::string(origin));
for (auto& altsvc : altsvc_vector) {
ptr->add_altsvc(altsvc);
@@ -456,7 +455,7 @@
stream_id_ = stream_id;
fin_ = fin;
data_len_ = length;
- data_ = SpdyMakeUnique<std::string>();
+ data_ = std::make_unique<std::string>();
}
// The SpdyFramer will not process any more data at this point.
@@ -481,8 +480,8 @@
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
frame_type_ = GOAWAY;
goaway_ir_ =
- SpdyMakeUnique<SpdyGoAwayIR>(last_good_stream_id, error_code, "");
- goaway_description_ = SpdyMakeUnique<std::string>();
+ std::make_unique<SpdyGoAwayIR>(last_good_stream_id, error_code, "");
+ goaway_description_ = std::make_unique<std::string>();
}
// If len==0 then we've reached the end of the GOAWAY frame.
@@ -529,9 +528,9 @@
fin_ = fin;
end_ = end;
- headers_ = SpdyMakeUnique<StringPairVector>();
- headers_handler_ = SpdyMakeUnique<TestHeadersHandler>();
- headers_ir_ = SpdyMakeUnique<SpdyHeadersIR>(stream_id);
+ headers_ = std::make_unique<StringPairVector>();
+ headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_ir_ = std::make_unique<SpdyHeadersIR>(stream_id);
headers_ir_->set_fin(fin);
if (has_priority) {
headers_ir_->set_has_priority(true);
@@ -551,7 +550,7 @@
<< " is_ack: " << (is_ack ? "true" : "false");
CHECK_EQ(frame_type_, UNSET)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
- auto ptr = SpdyMakeUnique<SpdyPingIR>(unique_id);
+ auto ptr = std::make_unique<SpdyPingIR>(unique_id);
if (is_ack) {
ptr->set_is_ack(is_ack);
listener_->OnPingAck(std::move(ptr));
@@ -569,7 +568,7 @@
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
CHECK_GT(stream_id, 0u);
- listener_->OnPriority(SpdyMakeUnique<SpdyPriorityIR>(
+ listener_->OnPriority(std::make_unique<SpdyPriorityIR>(
stream_id, parent_stream_id, weight, exclusive));
}
@@ -585,10 +584,10 @@
stream_id_ = stream_id;
end_ = end;
- headers_ = SpdyMakeUnique<StringPairVector>();
- headers_handler_ = SpdyMakeUnique<TestHeadersHandler>();
+ headers_ = std::make_unique<StringPairVector>();
+ headers_handler_ = std::make_unique<TestHeadersHandler>();
push_promise_ir_ =
- SpdyMakeUnique<SpdyPushPromiseIR>(stream_id, promised_stream_id);
+ std::make_unique<SpdyPushPromiseIR>(stream_id, promised_stream_id);
}
// Closes the specified stream. After this the sender may still send PRIORITY
@@ -602,7 +601,7 @@
CHECK_GT(stream_id, 0u);
listener_->OnRstStream(
- SpdyMakeUnique<SpdyRstStreamIR>(stream_id, error_code));
+ std::make_unique<SpdyRstStreamIR>(stream_id, error_code));
}
// Called for an individual setting. There is no negotiation; the sender is
@@ -631,15 +630,15 @@
frame_type_ = SETTINGS;
ack_ = false;
- settings_ = SpdyMakeUnique<SettingVector>();
- settings_ir_ = SpdyMakeUnique<SpdySettingsIR>();
+ settings_ = std::make_unique<SettingVector>();
+ settings_ir_ = std::make_unique<SpdySettingsIR>();
}
void SpdyTestDeframerImpl::OnSettingsAck() {
SPDY_DVLOG(1) << "OnSettingsAck";
CHECK_EQ(frame_type_, UNSET)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
- auto ptr = SpdyMakeUnique<SpdySettingsIR>();
+ auto ptr = std::make_unique<SpdySettingsIR>();
ptr->set_is_ack(true);
listener_->OnSettingsAck(std::move(ptr));
}
@@ -727,7 +726,7 @@
CHECK_NE(0, delta_window_size);
listener_->OnWindowUpdate(
- SpdyMakeUnique<SpdyWindowUpdateIR>(stream_id, delta_window_size));
+ std::make_unique<SpdyWindowUpdateIR>(stream_id, delta_window_size));
}
// Return true to indicate that the stream_id is valid; if not valid then
@@ -784,7 +783,7 @@
std::unique_ptr<SpdyDeframerVisitorInterface> wrapped)
: wrapped_(std::move(wrapped)) {
if (!wrapped_) {
- wrapped_ = SpdyMakeUnique<SpdyDeframerVisitorInterface>();
+ wrapped_ = std::make_unique<SpdyDeframerVisitorInterface>();
}
}
~LoggingSpdyDeframerDelegate() override = default;
@@ -875,7 +874,7 @@
std::unique_ptr<SpdyDeframerVisitorInterface>
SpdyDeframerVisitorInterface::LogBeforeVisiting(
std::unique_ptr<SpdyDeframerVisitorInterface> wrapped_listener) {
- return SpdyMakeUnique<LoggingSpdyDeframerDelegate>(
+ return std::make_unique<LoggingSpdyDeframerDelegate>(
std::move(wrapped_listener));
}
diff --git a/spdy/core/spdy_deframer_visitor.h b/spdy/core/spdy_deframer_visitor.h
index f95d513..f36daac 100644
--- a/spdy/core/spdy_deframer_visitor.h
+++ b/spdy/core/spdy_deframer_visitor.h
@@ -32,7 +32,7 @@
// // Create your visitor, a subclass of SpdyDeframerVisitorInterface.
// // For example, using DeframerCallbackCollector to collect frames:
// std::vector<CollectedFrame> collected_frames;
-// auto your_visitor = SpdyMakeUnique<DeframerCallbackCollector>(
+// auto your_visitor = std::make_unique<DeframerCallbackCollector>(
// &collected_frames);
//
// // Transfer ownership of your visitor to the converter, which ensures that
diff --git a/spdy/core/spdy_deframer_visitor_test.cc b/spdy/core/spdy_deframer_visitor_test.cc
index 82a85be..4beeb72 100644
--- a/spdy/core/spdy_deframer_visitor_test.cc
+++ b/spdy/core/spdy_deframer_visitor_test.cc
@@ -19,7 +19,6 @@
#include "net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
@@ -31,7 +30,7 @@
SpdyDeframerVisitorTest() : encoder_(SpdyFramer::ENABLE_COMPRESSION) {
decoder_.set_process_single_input_frame(true);
auto collector =
- SpdyMakeUnique<DeframerCallbackCollector>(&collected_frames_);
+ std::make_unique<DeframerCallbackCollector>(&collected_frames_);
auto log_and_collect =
SpdyDeframerVisitorInterface::LogBeforeVisiting(std::move(collector));
deframer_ = SpdyTestDeframer::CreateConverter(std::move(log_and_collect));
diff --git a/spdy/core/spdy_framer.cc b/spdy/core/spdy_framer.cc
index 59f7c3b..cf2201c 100644
--- a/spdy/core/spdy_framer.cc
+++ b/spdy/core/spdy_framer.cc
@@ -9,6 +9,7 @@
#include <iterator>
#include <list>
#include <new>
+#include <utility>
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
@@ -301,7 +302,7 @@
const size_t size_without_block =
is_first_frame_ ? GetFrameSizeSansBlock() : kContinuationFrameMinimumSize;
- auto encoding = SpdyMakeUnique<std::string>();
+ auto encoding = std::make_unique<std::string>();
encoder_->Next(kHttp2MaxControlFrameSendSize - size_without_block,
encoding.get());
has_next_frame_ = encoder_->HasNext();
@@ -412,12 +413,12 @@
std::unique_ptr<const SpdyFrameIR> frame_ir) {
switch (frame_ir->frame_type()) {
case SpdyFrameType::HEADERS: {
- return SpdyMakeUnique<SpdyHeaderFrameIterator>(
+ return std::make_unique<SpdyHeaderFrameIterator>(
framer,
SpdyWrapUnique(static_cast<const SpdyHeadersIR*>(frame_ir.release())));
}
case SpdyFrameType::PUSH_PROMISE: {
- return SpdyMakeUnique<SpdyPushPromiseFrameIterator>(
+ return std::make_unique<SpdyPushPromiseFrameIterator>(
framer, SpdyWrapUnique(
static_cast<const SpdyPushPromiseIR*>(frame_ir.release())));
}
@@ -426,8 +427,8 @@
HTTP2_FALLTHROUGH;
}
default: {
- return SpdyMakeUnique<SpdyControlFrameIterator>(framer,
- std::move(frame_ir));
+ return std::make_unique<SpdyControlFrameIterator>(framer,
+ std::move(frame_ir));
}
}
}
@@ -1268,7 +1269,7 @@
HpackEncoder* SpdyFramer::GetHpackEncoder() {
if (hpack_encoder_ == nullptr) {
- hpack_encoder_ = SpdyMakeUnique<HpackEncoder>(ObtainHpackHuffmanTable());
+ hpack_encoder_ = std::make_unique<HpackEncoder>(ObtainHpackHuffmanTable());
if (!compression_enabled()) {
hpack_encoder_->DisableCompression();
}
diff --git a/spdy/core/spdy_framer_test.cc b/spdy/core/spdy_framer_test.cc
index a424adb..63a16f4 100644
--- a/spdy/core/spdy_framer_test.cc
+++ b/spdy/core/spdy_framer_test.cc
@@ -10,6 +10,7 @@
#include <cstdint>
#include <limits>
#include <tuple>
+#include <utility>
#include <vector>
#include "net/third_party/quiche/src/spdy/core/array_output_buffer.h"
@@ -23,7 +24,6 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
@@ -86,7 +86,7 @@
// header serialization path.
static std::unique_ptr<SpdyHeadersIR> CloneSpdyHeadersIR(
const SpdyHeadersIR& headers) {
- auto new_headers = SpdyMakeUnique<SpdyHeadersIR>(
+ auto new_headers = std::make_unique<SpdyHeadersIR>(
headers.stream_id(), headers.header_block().Clone());
new_headers->set_fin(headers.fin());
new_headers->set_has_priority(headers.has_priority());
@@ -155,7 +155,7 @@
static std::unique_ptr<SpdyPushPromiseIR> CloneSpdyPushPromiseIR(
const SpdyPushPromiseIR& push_promise) {
- auto new_push_promise = SpdyMakeUnique<SpdyPushPromiseIR>(
+ auto new_push_promise = std::make_unique<SpdyPushPromiseIR>(
push_promise.stream_id(), push_promise.promised_stream_id(),
push_promise.header_block().Clone());
new_push_promise->set_fin(push_promise.fin());
@@ -315,7 +315,7 @@
SpdyHeadersHandlerInterface* OnHeaderFrameStart(
SpdyStreamId /*stream_id*/) override {
if (headers_handler_ == nullptr) {
- headers_handler_ = SpdyMakeUnique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<TestHeadersHandler>();
}
return headers_handler_.get();
}
@@ -408,7 +408,7 @@
altsvc_vector) override {
SPDY_VLOG(1) << "OnAltSvc(" << stream_id << ", \"" << origin
<< "\", altsvc_vector)";
- test_altsvc_ir_ = SpdyMakeUnique<SpdyAltSvcIR>(stream_id);
+ test_altsvc_ir_ = std::make_unique<SpdyAltSvcIR>(stream_id);
if (origin.length() > 0) {
test_altsvc_ir_->set_origin(std::string(origin));
}
@@ -1033,7 +1033,7 @@
SpdyContinuationIR continuation(/* stream_id = */ 0);
auto some_nonsense_encoding =
- SpdyMakeUnique<std::string>("some nonsense encoding");
+ std::make_unique<std::string>("some nonsense encoding");
continuation.take_encoding(std::move(some_nonsense_encoding));
continuation.set_end_headers(true);
SpdySerializedFrame frame(framer_.SerializeContinuation(continuation));
@@ -2307,7 +2307,7 @@
SpdyHeaderBlock header_block;
header_block["bar"] = "foo";
header_block["foo"] = "bar";
- auto buffer = SpdyMakeUnique<std::string>();
+ auto buffer = std::make_unique<std::string>();
HpackEncoder encoder(ObtainHpackHuffmanTable());
encoder.DisableCompression();
encoder.EncodeHeaderSet(header_block, buffer.get());
@@ -2635,7 +2635,7 @@
TEST_P(SpdyFramerTest, MultipleContinuationFramesWithIterator) {
SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION);
- auto headers = SpdyMakeUnique<SpdyHeadersIR>(/* stream_id = */ 1);
+ auto headers = std::make_unique<SpdyHeadersIR>(/* stream_id = */ 1);
headers->set_padding_len(256);
// Exact payload length will change with HPACK, but this should be long
@@ -2699,8 +2699,8 @@
TEST_P(SpdyFramerTest, PushPromiseFramesWithIterator) {
SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION);
auto push_promise =
- SpdyMakeUnique<SpdyPushPromiseIR>(/* stream_id = */ 1,
- /* promised_stream_id = */ 2);
+ std::make_unique<SpdyPushPromiseIR>(/* stream_id = */ 1,
+ /* promised_stream_id = */ 2);
push_promise->set_padding_len(256);
// Exact payload length will change with HPACK, but this should be long
@@ -2782,12 +2782,12 @@
};
TEST_F(SpdyControlFrameIteratorTest, RstStreamFrameWithIterator) {
- auto ir = SpdyMakeUnique<SpdyRstStreamIR>(0, ERROR_CODE_PROTOCOL_ERROR);
+ auto ir = std::make_unique<SpdyRstStreamIR>(0, ERROR_CODE_PROTOCOL_ERROR);
RunTest(std::move(ir));
}
TEST_F(SpdyControlFrameIteratorTest, SettingsFrameWithIterator) {
- auto ir = SpdyMakeUnique<SpdySettingsIR>();
+ auto ir = std::make_unique<SpdySettingsIR>();
uint32_t kValue = 0x0a0b0c0d;
SpdyKnownSettingsId kId = SETTINGS_INITIAL_WINDOW_SIZE;
ir->AddSetting(kId, kValue);
@@ -2796,22 +2796,22 @@
TEST_F(SpdyControlFrameIteratorTest, PingFrameWithIterator) {
const SpdyPingId kPingId = 0x123456789abcdeffULL;
- auto ir = SpdyMakeUnique<SpdyPingIR>(kPingId);
+ auto ir = std::make_unique<SpdyPingIR>(kPingId);
RunTest(std::move(ir));
}
TEST_F(SpdyControlFrameIteratorTest, GoAwayFrameWithIterator) {
- auto ir = SpdyMakeUnique<SpdyGoAwayIR>(0, ERROR_CODE_NO_ERROR, "GA");
+ auto ir = std::make_unique<SpdyGoAwayIR>(0, ERROR_CODE_NO_ERROR, "GA");
RunTest(std::move(ir));
}
TEST_F(SpdyControlFrameIteratorTest, WindowUpdateFrameWithIterator) {
- auto ir = SpdyMakeUnique<SpdyWindowUpdateIR>(1, 1);
+ auto ir = std::make_unique<SpdyWindowUpdateIR>(1, 1);
RunTest(std::move(ir));
}
TEST_F(SpdyControlFrameIteratorTest, AtlSvcFrameWithIterator) {
- auto ir = SpdyMakeUnique<SpdyAltSvcIR>(3);
+ auto ir = std::make_unique<SpdyAltSvcIR>(3);
ir->set_origin("origin");
ir->add_altsvc(SpdyAltSvcWireFormat::AlternativeService(
"pid1", "host", 443, 5, SpdyAltSvcWireFormat::VersionVector()));
@@ -2822,7 +2822,7 @@
}
TEST_F(SpdyControlFrameIteratorTest, PriorityFrameWithIterator) {
- auto ir = SpdyMakeUnique<SpdyPriorityIR>(2, 1, 17, true);
+ auto ir = std::make_unique<SpdyPriorityIR>(2, 1, 17, true);
RunTest(std::move(ir));
}
@@ -4619,7 +4619,7 @@
// to ProcessInput (i.e. will not be calling set_process_single_input_frame()).
TEST_P(SpdyFramerTest, ProcessAllInput) {
auto visitor =
- SpdyMakeUnique<TestSpdyVisitor>(SpdyFramer::DISABLE_COMPRESSION);
+ std::make_unique<TestSpdyVisitor>(SpdyFramer::DISABLE_COMPRESSION);
deframer_.set_visitor(visitor.get());
// Create two input frames.
@@ -4704,7 +4704,7 @@
for (size_t first_size = 0; first_size <= buf_size; ++first_size) {
SPDY_VLOG(1) << "first_size = " << first_size;
auto visitor =
- SpdyMakeUnique<TestSpdyVisitor>(SpdyFramer::DISABLE_COMPRESSION);
+ std::make_unique<TestSpdyVisitor>(SpdyFramer::DISABLE_COMPRESSION);
deframer_.set_visitor(visitor.get());
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
diff --git a/spdy/core/spdy_header_block.cc b/spdy/core/spdy_header_block.cc
index 705038a..8a1b65f 100644
--- a/spdy/core/spdy_header_block.cc
+++ b/spdy/core/spdy_header_block.cc
@@ -11,7 +11,6 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_unsafe_arena.h"
@@ -362,7 +361,7 @@
SpdyHeaderBlock::Storage* SpdyHeaderBlock::GetStorage() {
if (storage_ == nullptr) {
- storage_ = SpdyMakeUnique<Storage>();
+ storage_ = std::make_unique<Storage>();
}
return storage_.get();
}
diff --git a/spdy/core/spdy_protocol.cc b/spdy/core/spdy_protocol.cc
index dae7006..0ab6737 100644
--- a/spdy/core/spdy_protocol.cc
+++ b/spdy/core/spdy_protocol.cc
@@ -8,7 +8,6 @@
#include <ostream>
#include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
namespace spdy {
@@ -295,7 +294,7 @@
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, std::string data)
: SpdyFrameWithFinIR(stream_id),
- data_store_(SpdyMakeUnique<std::string>(std::move(data))),
+ data_store_(std::make_unique<std::string>(std::move(data))),
data_(data_store_->data()),
data_len_(data_store_->size()),
padded_(false),
@@ -415,7 +414,7 @@
SpdyContinuationIR::SpdyContinuationIR(SpdyStreamId stream_id)
: SpdyFrameIR(stream_id), end_headers_(false) {
- encoding_ = SpdyMakeUnique<std::string>();
+ encoding_ = std::make_unique<std::string>();
}
SpdyContinuationIR::~SpdyContinuationIR() = default;
diff --git a/spdy/core/spdy_protocol.h b/spdy/core/spdy_protocol.h
index b014107..cb6906c 100644
--- a/spdy/core/spdy_protocol.h
+++ b/spdy/core/spdy_protocol.h
@@ -25,7 +25,6 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
namespace spdy {
@@ -550,7 +549,7 @@
// Deep-copy of data (keep private copy).
void SetDataDeep(SpdyStringPiece data) {
- data_store_ = SpdyMakeUnique<std::string>(data.data(), data.size());
+ data_store_ = std::make_unique<std::string>(data.data(), data.size());
data_ = data_store_->data();
data_len_ = data.size();
}