LSC: Replace deprecated functions absl::MakeUnique and absl::make_unique
with std::make_unique
LSC documentation: go/absl-cleanup-lsc
Tested:
TAP for global presubmit queue
http://test/OCL:481924221:BASE:482276157:1666208427051:8e3e81aa
PiperOrigin-RevId: 482627825
diff --git a/quiche/balsa/balsa_headers.h b/quiche/balsa/balsa_headers.h
index 1420f4a..3287cc0 100644
--- a/quiche/balsa/balsa_headers.h
+++ b/quiche/balsa/balsa_headers.h
@@ -114,7 +114,7 @@
if (rhs.buffer == nullptr) {
buffer = nullptr;
} else {
- buffer = absl::make_unique<char[]>(buffer_size);
+ buffer = std::make_unique<char[]>(buffer_size);
memcpy(buffer.get(), rhs.buffer.get(), rhs.bytes_used());
}
}
@@ -310,7 +310,7 @@
BufferBlock AllocBlock() { return AllocCustomBlock(blocksize_); }
BufferBlock AllocCustomBlock(size_t blocksize) {
- return BufferBlock{absl::make_unique<char[]>(blocksize), blocksize,
+ return BufferBlock{std::make_unique<char[]>(blocksize), blocksize,
blocksize};
}
diff --git a/quiche/http2/adapter/nghttp2_adapter.cc b/quiche/http2/adapter/nghttp2_adapter.cc
index b2cb7c8..f724ea3 100644
--- a/quiche/http2/adapter/nghttp2_adapter.cc
+++ b/quiche/http2/adapter/nghttp2_adapter.cc
@@ -1,5 +1,7 @@
#include "quiche/http2/adapter/nghttp2_adapter.h"
+#include <memory>
+
#include "absl/algorithm/container.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@@ -294,9 +296,9 @@
options_ = owned_options;
}
- session_ = absl::make_unique<NgHttp2Session>(perspective_,
- callbacks::Create(), options_,
- static_cast<void*>(&visitor_));
+ session_ =
+ std::make_unique<NgHttp2Session>(perspective_, callbacks::Create(),
+ options_, static_cast<void*>(&visitor_));
if (owned_options != nullptr) {
nghttp2_option_del(owned_options);
}
diff --git a/quiche/http2/adapter/nghttp2_adapter_test.cc b/quiche/http2/adapter/nghttp2_adapter_test.cc
index aff31e4..9bdce39 100644
--- a/quiche/http2/adapter/nghttp2_adapter_test.cc
+++ b/quiche/http2/adapter/nghttp2_adapter_test.cc
@@ -1,5 +1,7 @@
#include "quiche/http2/adapter/nghttp2_adapter.h"
+#include <memory>
+
#include "quiche/http2/adapter/http2_protocol.h"
#include "quiche/http2/adapter/http2_visitor_interface.h"
#include "quiche/http2/adapter/mock_http2_visitor.h"
@@ -878,7 +880,7 @@
{":path", "/this/is/request/one"}});
const std::string kBody = "This is an example request body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
// nghttp2 does not require that the data source indicate the end of data
// before trailers are enqueued.
@@ -2051,7 +2053,7 @@
EXPECT_FALSE(adapter->want_write());
const char* kSentinel = "";
const absl::string_view kBody = "This is an example request body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kBody);
body1->EndData();
int stream_id =
@@ -2524,7 +2526,7 @@
DataSavingVisitor visitor;
auto adapter = NgHttp2Adapter::CreateClientAdapter(visitor);
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
EXPECT_TRUE(adapter->want_write());
@@ -2548,7 +2550,7 @@
auto adapter = NgHttp2Adapter::CreateClientAdapter(visitor);
const auto kLargeValue = std::string(63 * 1024, 'a');
- auto source = absl::make_unique<TestMetadataSource>(
+ auto source = std::make_unique<TestMetadataSource>(
ToHeaderBlock(ToHeaders({{"large-value", kLargeValue}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
EXPECT_TRUE(adapter->want_write());
@@ -2581,7 +2583,7 @@
DataSavingVisitor visitor;
auto adapter = NgHttp2Adapter::CreateClientAdapter(visitor);
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(0, 16384u, std::move(source));
EXPECT_TRUE(adapter->want_write());
@@ -2637,7 +2639,7 @@
EXPECT_FALSE(adapter->want_write());
const absl::string_view kBody = "This is an example request body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kBody);
body1->EndData();
const int stream_id =
@@ -2753,7 +2755,7 @@
visitor.Clear();
const std::string kLongBody = std::string(81000, 'c');
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kLongBody);
body1->EndData();
const int stream_id =
@@ -2806,7 +2808,7 @@
visitor.Clear();
const std::string kLongBody = std::string(81000, 'c');
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kLongBody);
body1->EndData();
const int stream_id =
@@ -3410,7 +3412,7 @@
const int64_t read_result = adapter->ProcessBytes(frames);
EXPECT_EQ(static_cast<size_t>(read_result), frames.size());
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
body->AppendPayload("Here is some data, which will lead to a fatal error");
TestDataFrameSource* body_ptr = body.get();
int submit_result = adapter->SubmitResponse(
@@ -3785,7 +3787,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
auto* body1_ptr = body1.get();
int submit_result = adapter->SubmitResponse(
@@ -4781,7 +4783,7 @@
const absl::string_view kBody = "This is an example response body.";
// A data fin is not sent so that the stream remains open, and the flow
// control state can be verified.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
int submit_result = adapter->SubmitResponse(
1,
@@ -4863,7 +4865,7 @@
EXPECT_FALSE(adapter->want_write());
const absl::string_view kBody = "This is an example response body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kBody);
int submit_result = adapter->SubmitResponse(
1,
@@ -4990,7 +4992,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
int submit_result = adapter->SubmitResponse(
@@ -5164,7 +5166,7 @@
const std::vector<Header> headers1 = ToHeaders(
{{":status", "200"}, {"content-length", "10"}, {"content-length", "10"}});
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload("perfection");
body1->EndData();
@@ -5222,7 +5224,7 @@
EXPECT_EQ(frames.size(), static_cast<size_t>(result));
const std::vector<Header> headers1 = ToHeaders({{":status", "200"}});
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
TestDataFrameSource* body1_ptr = body1.get();
int submit_result = adapter->SubmitResponse(1, headers1, std::move(body1));
@@ -5299,7 +5301,7 @@
const int64_t result = adapter->ProcessBytes(frames);
EXPECT_EQ(frames.size(), static_cast<size_t>(result));
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->SimulateError();
int submit_result = adapter->SubmitResponse(
1, ToHeaders({{":status", "200"}, {"x-comment", "Sure, sounds good."}}),
@@ -5533,7 +5535,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
int submit_result = adapter->SubmitResponse(
@@ -6323,14 +6325,14 @@
const int64_t initial_result = adapter->ProcessBytes(initial_frames);
EXPECT_EQ(static_cast<size_t>(initial_result), initial_frames.size());
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
body->AppendPayload("Here is some data, which will be completely ignored!");
int submit_result = adapter->SubmitResponse(
1, ToHeaders({{":status", "200"}}), std::move(body));
ASSERT_EQ(0, submit_result);
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
@@ -6462,7 +6464,7 @@
EXPECT_EQ(static_cast<size_t>(read_result), frames.size());
// Submit a response for the stream.
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
body->AppendPayload("This data is doomed to never be written.");
int submit_result = adapter->SubmitResponse(
1, ToHeaders({{":status", "200"}}), std::move(body));
@@ -6475,7 +6477,7 @@
adapter->SubmitSettings({});
// Submit some metadata.
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
@@ -7094,7 +7096,7 @@
EXPECT_EQ(static_cast<size_t>(read_result), frames.size());
// Submit a response for the stream.
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
TestDataFrameSource& body_ref = *body;
body_ref.AppendPayload(std::string(70000, 'a'));
int submit_result = adapter->SubmitResponse(
diff --git a/quiche/http2/adapter/nghttp2_data_provider.cc b/quiche/http2/adapter/nghttp2_data_provider.cc
index f10b2b8..c0d76d1 100644
--- a/quiche/http2/adapter/nghttp2_data_provider.cc
+++ b/quiche/http2/adapter/nghttp2_data_provider.cc
@@ -1,5 +1,7 @@
#include "quiche/http2/adapter/nghttp2_data_provider.h"
+#include <memory>
+
#include "quiche/http2/adapter/http2_visitor_interface.h"
#include "quiche/http2/adapter/nghttp2_util.h"
@@ -50,7 +52,7 @@
if (source == nullptr) {
return nullptr;
}
- auto provider = absl::make_unique<nghttp2_data_provider>();
+ auto provider = std::make_unique<nghttp2_data_provider>();
provider->source.ptr = source;
provider->read_callback = &callbacks::DataFrameSourceReadCallback;
return provider;
diff --git a/quiche/http2/adapter/nghttp2_util.cc b/quiche/http2/adapter/nghttp2_util.cc
index f2abee6..efce5c5 100644
--- a/quiche/http2/adapter/nghttp2_util.cc
+++ b/quiche/http2/adapter/nghttp2_util.cc
@@ -1,6 +1,7 @@
#include "quiche/http2/adapter/nghttp2_util.h"
#include <cstdint>
+#include <memory>
#include "absl/strings/str_join.h"
#include "absl/strings/string_view.h"
@@ -215,7 +216,7 @@
std::unique_ptr<DataFrameSource> MakeZeroCopyDataFrameSource(
nghttp2_data_provider provider, void* user_data,
nghttp2_send_data_callback send_data) {
- return absl::make_unique<Nghttp2DataFrameSource>(
+ return std::make_unique<Nghttp2DataFrameSource>(
std::move(provider), std::move(send_data), user_data);
}
diff --git a/quiche/http2/adapter/oghttp2_adapter.cc b/quiche/http2/adapter/oghttp2_adapter.cc
index a5bf877..fbfc76a 100644
--- a/quiche/http2/adapter/oghttp2_adapter.cc
+++ b/quiche/http2/adapter/oghttp2_adapter.cc
@@ -1,5 +1,7 @@
#include "quiche/http2/adapter/oghttp2_adapter.h"
+#include <memory>
+
#include "absl/memory/memory.h"
#include "absl/strings/str_cat.h"
#include "quiche/http2/adapter/http2_util.h"
@@ -42,12 +44,12 @@
void OgHttp2Adapter::SubmitPriorityForStream(Http2StreamId stream_id,
Http2StreamId parent_stream_id,
int weight, bool exclusive) {
- session_->EnqueueFrame(absl::make_unique<SpdyPriorityIR>(
+ session_->EnqueueFrame(std::make_unique<SpdyPriorityIR>(
stream_id, parent_stream_id, weight, exclusive));
}
void OgHttp2Adapter::SubmitPing(Http2PingId ping_id) {
- session_->EnqueueFrame(absl::make_unique<SpdyPingIR>(ping_id));
+ session_->EnqueueFrame(std::make_unique<SpdyPingIR>(ping_id));
}
void OgHttp2Adapter::SubmitShutdownNotice() {
@@ -57,14 +59,14 @@
void OgHttp2Adapter::SubmitGoAway(Http2StreamId last_accepted_stream_id,
Http2ErrorCode error_code,
absl::string_view opaque_data) {
- session_->EnqueueFrame(absl::make_unique<SpdyGoAwayIR>(
+ session_->EnqueueFrame(std::make_unique<SpdyGoAwayIR>(
last_accepted_stream_id, TranslateErrorCode(error_code),
std::string(opaque_data)));
}
void OgHttp2Adapter::SubmitWindowUpdate(Http2StreamId stream_id,
int window_increment) {
session_->EnqueueFrame(
- absl::make_unique<SpdyWindowUpdateIR>(stream_id, window_increment));
+ std::make_unique<SpdyWindowUpdateIR>(stream_id, window_increment));
}
void OgHttp2Adapter::SubmitMetadata(Http2StreamId stream_id,
@@ -124,7 +126,7 @@
void OgHttp2Adapter::SubmitRst(Http2StreamId stream_id,
Http2ErrorCode error_code) {
- session_->EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ session_->EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, TranslateErrorCode(error_code)));
}
@@ -160,8 +162,7 @@
OgHttp2Adapter::OgHttp2Adapter(Http2VisitorInterface& visitor, Options options)
: Http2Adapter(visitor),
- session_(absl::make_unique<OgHttp2Session>(visitor, std::move(options))) {
-}
+ session_(std::make_unique<OgHttp2Session>(visitor, std::move(options))) {}
} // namespace adapter
} // namespace http2
diff --git a/quiche/http2/adapter/oghttp2_adapter_test.cc b/quiche/http2/adapter/oghttp2_adapter_test.cc
index a98dcd1..673ea23 100644
--- a/quiche/http2/adapter/oghttp2_adapter_test.cc
+++ b/quiche/http2/adapter/oghttp2_adapter_test.cc
@@ -1,5 +1,6 @@
#include "quiche/http2/adapter/oghttp2_adapter.h"
+#include <memory>
#include <string>
#include "absl/strings/str_join.h"
@@ -1192,7 +1193,7 @@
{":path", "/this/is/request/one"}});
const std::string kBody = "This is an example request body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
@@ -2709,7 +2710,7 @@
visitor.Clear();
const std::string kBody = "This is an example request body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kBody);
body1->EndData();
const int stream_id =
@@ -2829,7 +2830,7 @@
visitor.Clear();
const std::string kLongBody = std::string(81000, 'c');
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kLongBody);
body1->EndData();
const int stream_id =
@@ -2886,7 +2887,7 @@
visitor.Clear();
const std::string kLongBody = std::string(81000, 'c');
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kLongBody);
body1->EndData();
const int stream_id =
@@ -3478,7 +3479,7 @@
{":path", "/this/is/request/one"}});
const std::string kBody = std::string(100 * 1024, 'a');
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
@@ -3492,7 +3493,7 @@
{":authority", "example.com"},
{":path", "/this/is/request/two"}});
- auto body2 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body2 = std::make_unique<TestDataFrameSource>(visitor, false);
body2->AppendPayload(kBody);
body2->EndData();
@@ -3560,7 +3561,7 @@
{":authority", "example.com"},
{":path", "/this/is/request/one"}});
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload("Really small body.");
body1->EndData();
@@ -3575,7 +3576,7 @@
{":path", "/this/is/request/two"}});
const std::string kBody = std::string(100 * 1024, 'a');
- auto body2 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body2 = std::make_unique<TestDataFrameSource>(visitor, false);
body2->AppendPayload(kBody);
body2->EndData();
@@ -3625,7 +3626,7 @@
{":path", "/this/is/request/one"}});
const std::string kBody = std::string(100 * 1024, 'a');
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
@@ -3646,7 +3647,7 @@
EXPECT_FALSE(adapter->want_write());
EXPECT_EQ(0, adapter->GetSendWindowSize());
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
EXPECT_CALL(visitor, OnBeforeFrameSent(kMetadataFrameType, 1, _, 0x4));
@@ -3744,7 +3745,7 @@
options.perspective = Perspective::kServer;
auto adapter = OgHttp2Adapter::Create(visitor, options);
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
EXPECT_TRUE(adapter->want_write());
@@ -3769,7 +3770,7 @@
auto adapter = OgHttp2Adapter::Create(visitor, options);
const auto kLargeValue = std::string(63 * 1024, 'a');
- auto source = absl::make_unique<TestMetadataSource>(
+ auto source = std::make_unique<TestMetadataSource>(
ToHeaderBlock(ToHeaders({{"large-value", kLargeValue}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
EXPECT_TRUE(adapter->want_write());
@@ -3804,7 +3805,7 @@
options.perspective = Perspective::kServer;
auto adapter = OgHttp2Adapter::Create(visitor, options);
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(0, 16384u, std::move(source));
EXPECT_TRUE(adapter->want_write());
@@ -4176,7 +4177,7 @@
const int64_t read_result = adapter->ProcessBytes(frames);
EXPECT_EQ(static_cast<size_t>(read_result), frames.size());
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
body->AppendPayload("Here is some data, which will lead to a fatal error");
TestDataFrameSource* body_ptr = body.get();
int submit_result = adapter->SubmitResponse(
@@ -4352,7 +4353,7 @@
const std::vector<Header> headers1 = ToHeaders(
{{":status", "200"}, {"content-length", "10"}, {"content-length", "10"}});
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload("perfection");
body1->EndData();
@@ -4414,7 +4415,7 @@
EXPECT_EQ(frames.size(), static_cast<size_t>(result));
const std::vector<Header> headers1 = ToHeaders({{":status", "200"}});
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
TestDataFrameSource* body1_ptr = body1.get();
int submit_result = adapter->SubmitResponse(1, headers1, std::move(body1));
@@ -4549,7 +4550,7 @@
const int64_t result = adapter->ProcessBytes(frames);
EXPECT_EQ(frames.size(), static_cast<size_t>(result));
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->SimulateError();
int submit_result = adapter->SubmitResponse(
1, ToHeaders({{":status", "200"}, {"x-comment", "Sure, sounds good."}}),
@@ -4844,7 +4845,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
int submit_result = adapter->SubmitResponse(
@@ -4921,7 +4922,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
body1->EndData();
int submit_result = adapter->SubmitResponse(
@@ -4950,7 +4951,7 @@
spdy::Http2HeaderBlock block;
block["key"] = "wild value!";
adapter->SubmitMetadata(
- 1, 16384u, absl::make_unique<TestMetadataSource>(std::move(block)));
+ 1, 16384u, std::make_unique<TestMetadataSource>(std::move(block)));
int trailer_result =
adapter->SubmitTrailer(1, ToHeaders({{":final-status", "a-ok"}}));
@@ -5169,7 +5170,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
auto* body1_ptr = body1.get();
int submit_result = adapter->SubmitResponse(
@@ -6157,7 +6158,7 @@
const absl::string_view kBody = "This is an example response body.";
// A data fin is not sent so that the stream remains open, and the flow
// control state can be verified.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload(kBody);
int submit_result = adapter->SubmitResponse(
1,
@@ -6244,7 +6245,7 @@
EXPECT_FALSE(adapter->want_write());
const absl::string_view kBody = "This is an example response body.";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload(kBody);
int submit_result = adapter->SubmitResponse(
1,
@@ -6371,7 +6372,7 @@
if (stream_id < 10) {
const Http2StreamId new_stream_id = stream_id + 2;
auto body =
- absl::make_unique<TestDataFrameSource>(client_visitor, true);
+ std::make_unique<TestDataFrameSource>(client_visitor, true);
body->AppendPayload("This is an example request body.");
body->EndData();
const int created_stream_id = client_adapter->SubmitRequest(
@@ -7000,14 +7001,14 @@
const int64_t initial_result = adapter->ProcessBytes(initial_frames);
EXPECT_EQ(static_cast<size_t>(initial_result), initial_frames.size());
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
body->AppendPayload("Here is some data, which will be completely ignored!");
int submit_result = adapter->SubmitResponse(
1, ToHeaders({{":status", "200"}}), std::move(body));
ASSERT_EQ(0, submit_result);
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
@@ -7184,7 +7185,7 @@
EXPECT_EQ(static_cast<size_t>(read_result), frames.size());
// Submit a response for the stream.
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
body->AppendPayload("This data is doomed to never be written.");
int submit_result = adapter->SubmitResponse(
1, ToHeaders({{":status", "200"}}), std::move(body));
@@ -7197,7 +7198,7 @@
adapter->SubmitSettings({});
// Submit some metadata.
- auto source = absl::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
+ auto source = std::make_unique<TestMetadataSource>(ToHeaderBlock(ToHeaders(
{{"query-cost", "is too darn high"}, {"secret-sauce", "hollandaise"}})));
adapter->SubmitMetadata(1, 16384u, std::move(source));
@@ -7993,7 +7994,7 @@
EXPECT_EQ(static_cast<size_t>(read_result), frames.size());
// Submit a response for the stream.
- auto body = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body = std::make_unique<TestDataFrameSource>(visitor, true);
TestDataFrameSource& body_ref = *body;
body_ref.AppendPayload(std::string(70000, 'a'));
int submit_result = adapter->SubmitResponse(
diff --git a/quiche/http2/adapter/oghttp2_session.cc b/quiche/http2/adapter/oghttp2_session.cc
index 96b3ab1..75d160a 100644
--- a/quiche/http2/adapter/oghttp2_session.cc
+++ b/quiche/http2/adapter/oghttp2_session.cc
@@ -1,6 +1,7 @@
#include "quiche/http2/adapter/oghttp2_session.h"
#include <cstdint>
+#include <memory>
#include <utility>
#include <vector>
@@ -214,10 +215,10 @@
: session_(session), visitor_(visitor) {
if (session_.options_.validate_http_headers) {
QUICHE_VLOG(2) << "instantiating regular header validator";
- validator_ = absl::make_unique<HeaderValidator>();
+ validator_ = std::make_unique<HeaderValidator>();
} else {
QUICHE_VLOG(2) << "instantiating noop header validator";
- validator_ = absl::make_unique<NoopHeaderValidator>();
+ validator_ = std::make_unique<NoopHeaderValidator>();
}
}
@@ -530,7 +531,7 @@
void OgHttp2Session::StartGracefulShutdown() {
if (IsServerSession()) {
if (!queued_goaway_) {
- EnqueueFrame(absl::make_unique<spdy::SpdyGoAwayIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyGoAwayIR>(
std::numeric_limits<int32_t>::max(), spdy::ERROR_CODE_NO_ERROR,
"graceful_shutdown"));
}
@@ -762,7 +763,7 @@
options_.rst_stream_no_error_when_incomplete && IsServerSession()) {
// Since the peer has not yet ended the stream, this endpoint should
// send a RST_STREAM NO_ERROR. See RFC 7540 Section 8.1.
- frames_.push_front(absl::make_unique<spdy::SpdyRstStreamIR>(
+ frames_.push_front(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, spdy::SpdyErrorCode::ERROR_CODE_NO_ERROR));
auto queued_result = queued_frames_.insert({stream_id, 1});
if (!queued_result.second) {
@@ -904,7 +905,7 @@
std::unique_ptr<MetadataSource> source) {
const uint32_t max_payload_size =
std::min(kMaxAllowedMetadataFrameSize, max_frame_payload_);
- auto payload_buffer = absl::make_unique<uint8_t[]>(max_payload_size);
+ auto payload_buffer = std::make_unique<uint8_t[]>(max_payload_size);
while (true) {
auto [written, end_metadata] =
@@ -916,7 +917,7 @@
QUICHE_DCHECK_LE(static_cast<size_t>(written), max_payload_size);
auto payload = absl::string_view(
reinterpret_cast<const char*>(payload_buffer.get()), written);
- EnqueueFrame(absl::make_unique<spdy::SpdyUnknownIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyUnknownIR>(
stream_id, kMetadataFrameType, end_metadata ? kMetadataEndFlag : 0u,
std::string(payload)));
if (end_metadata) {
@@ -990,7 +991,7 @@
<< "DataFrameSource will send fin, preventing trailers!";
// Save trailers so they can be written once data is done.
state.trailers =
- absl::make_unique<spdy::Http2HeaderBlock>(ToHeaderBlock(trailers));
+ std::make_unique<spdy::Http2HeaderBlock>(ToHeaderBlock(trailers));
if (!options_.trailers_require_end_data || !iter->second.data_deferred) {
trailers_ready_.insert(stream_id);
}
@@ -1057,7 +1058,7 @@
if (static_cast<int64_t>(length) >
iter->second.window_manager.CurrentWindowSize()) {
// Peer exceeded the stream flow control limit.
- EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, spdy::ERROR_CODE_FLOW_CONTROL_ERROR));
return;
}
@@ -1069,7 +1070,7 @@
}
if (!iter->second.can_receive_body && length > 0) {
- EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, spdy::ERROR_CODE_PROTOCOL_ERROR));
return;
}
@@ -1208,7 +1209,7 @@
void OgHttp2Session::OnSettings() {
visitor_.OnSettingsStart();
- auto settings = absl::make_unique<SpdySettingsIR>();
+ auto settings = std::make_unique<SpdySettingsIR>();
settings->set_is_ack(true);
EnqueueFrame(std::move(settings));
}
@@ -1312,7 +1313,7 @@
void OgHttp2Session::OnPing(spdy::SpdyPingId unique_id, bool is_ack) {
visitor_.OnPing(unique_id, is_ack);
if (options_.auto_ping_ack && !is_ack) {
- auto ping = absl::make_unique<spdy::SpdyPingIR>(unique_id);
+ auto ping = std::make_unique<spdy::SpdyPingIR>(unique_id);
ping->set_is_ack(true);
EnqueueFrame(std::move(ping));
}
@@ -1410,7 +1411,7 @@
if (stream_map_.size() >= pending_max_inbound_concurrent_streams_) {
// The new stream would exceed our advertised but unacked
// MAX_CONCURRENT_STREAMS. Refuse the stream for parity with nghttp2.
- EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, spdy::ERROR_CODE_REFUSED_STREAM));
const bool ok = visitor_.OnInvalidFrame(
stream_id, Http2VisitorInterface::InvalidFrameError::kRefusedStream);
@@ -1558,7 +1559,7 @@
auto it = streams_reset_.find(stream_id);
if (it == streams_reset_.end()) {
EnqueueFrame(
- absl::make_unique<spdy::SpdyRstStreamIR>(stream_id, spdy_error_code));
+ std::make_unique<spdy::SpdyRstStreamIR>(stream_id, spdy_error_code));
if (result == Http2VisitorInterface::HEADER_FIELD_INVALID ||
result == Http2VisitorInterface::HEADER_HTTP_MESSAGING) {
@@ -1614,7 +1615,7 @@
std::unique_ptr<SpdySettingsIR> OgHttp2Session::PrepareSettingsFrame(
absl::Span<const Http2Setting> settings) {
- auto settings_ir = absl::make_unique<SpdySettingsIR>();
+ auto settings_ir = std::make_unique<SpdySettingsIR>();
for (const Http2Setting& setting : settings) {
settings_ir->AddSetting(setting.id, setting.value);
}
@@ -1681,14 +1682,14 @@
void OgHttp2Session::SendWindowUpdate(Http2StreamId stream_id,
size_t update_delta) {
EnqueueFrame(
- absl::make_unique<spdy::SpdyWindowUpdateIR>(stream_id, update_delta));
+ std::make_unique<spdy::SpdyWindowUpdateIR>(stream_id, update_delta));
}
void OgHttp2Session::SendHeaders(Http2StreamId stream_id,
spdy::Http2HeaderBlock headers,
bool end_stream) {
auto frame =
- absl::make_unique<spdy::SpdyHeadersIR>(stream_id, std::move(headers));
+ std::make_unique<spdy::SpdyHeadersIR>(stream_id, std::move(headers));
frame->set_fin(end_stream);
EnqueueFrame(std::move(frame));
}
@@ -1696,7 +1697,7 @@
void OgHttp2Session::SendTrailers(Http2StreamId stream_id,
spdy::Http2HeaderBlock trailers) {
auto frame =
- absl::make_unique<spdy::SpdyHeadersIR>(stream_id, std::move(trailers));
+ std::make_unique<spdy::SpdyHeadersIR>(stream_id, std::move(trailers));
frame->set_fin(true);
EnqueueFrame(std::move(frame));
trailers_ready_.erase(stream_id);
@@ -1709,7 +1710,7 @@
!iter->second.half_closed_remote) {
// Since the peer has not yet ended the stream, this endpoint should
// send a RST_STREAM NO_ERROR. See RFC 7540 Section 8.1.
- EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
iter->first, spdy::SpdyErrorCode::ERROR_CODE_NO_ERROR));
iter->second.half_closed_remote = true;
}
@@ -1836,7 +1837,7 @@
latched_error_ = true;
visitor_.OnConnectionError(error);
decoder_.StopProcessing();
- EnqueueFrame(absl::make_unique<spdy::SpdyGoAwayIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyGoAwayIR>(
highest_processed_stream_id_, TranslateErrorCode(error_code),
ConnectionErrorToString(error)));
}
@@ -1923,7 +1924,7 @@
}
void OgHttp2Session::HandleContentLengthError(Http2StreamId stream_id) {
- EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, spdy::ERROR_CODE_PROTOCOL_ERROR));
}
@@ -1961,7 +1962,7 @@
const int64_t current_window_size = stream_state.send_window;
const int64_t new_window_size = current_window_size + delta;
if (new_window_size > spdy::kSpdyMaximumWindowSize) {
- EnqueueFrame(absl::make_unique<spdy::SpdyRstStreamIR>(
+ EnqueueFrame(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, spdy::ERROR_CODE_FLOW_CONTROL_ERROR));
} else {
stream_state.send_window += delta;
diff --git a/quiche/http2/adapter/oghttp2_session_test.cc b/quiche/http2/adapter/oghttp2_session_test.cc
index c61f166..59f5c4b 100644
--- a/quiche/http2/adapter/oghttp2_session_test.cc
+++ b/quiche/http2/adapter/oghttp2_session_test.cc
@@ -1,5 +1,7 @@
#include "quiche/http2/adapter/oghttp2_session.h"
+#include <memory>
+
#include "quiche/http2/adapter/mock_http2_visitor.h"
#include "quiche/http2/adapter/test_frame_sequence.h"
#include "quiche/http2/adapter/test_utils.h"
@@ -76,7 +78,7 @@
// Submit a request to ensure the first stream is created.
const char* kSentinel1 = "arbitrary pointer 1";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload("This is an example request body.");
body1->EndData();
int stream_id =
@@ -172,7 +174,7 @@
options.perspective = Perspective::kClient;
OgHttp2Session session(visitor, options);
EXPECT_FALSE(session.want_write());
- session.EnqueueFrame(absl::make_unique<spdy::SpdyPingIR>(42));
+ session.EnqueueFrame(std::make_unique<spdy::SpdyPingIR>(42));
EXPECT_TRUE(session.want_write());
EXPECT_CALL(visitor, OnBeforeFrameSent(SETTINGS, 0, _, 0x0));
@@ -198,7 +200,7 @@
options.perspective = Perspective::kClient;
OgHttp2Session session(visitor, options);
EXPECT_FALSE(session.want_write());
- session.EnqueueFrame(absl::make_unique<spdy::SpdySettingsIR>());
+ session.EnqueueFrame(std::make_unique<spdy::SpdySettingsIR>());
EXPECT_TRUE(session.want_write());
EXPECT_CALL(visitor, OnBeforeFrameSent(SETTINGS, 0, _, 0x0));
@@ -262,7 +264,7 @@
EXPECT_EQ(0, session.GetHpackEncoderDynamicTableSize());
const char* kSentinel1 = "arbitrary pointer 1";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload("This is an example request body.");
body1->EndData();
int stream_id =
@@ -332,7 +334,7 @@
EXPECT_FALSE(session.want_write());
const char* kSentinel1 = "arbitrary pointer 1";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
TestDataFrameSource* body_ref = body1.get();
int stream_id =
session.SubmitRequest(ToHeaders({{":method", "POST"},
@@ -388,7 +390,7 @@
EXPECT_FALSE(session.want_write());
const char* kSentinel1 = "arbitrary pointer 1";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
TestDataFrameSource* body_ref = body1.get();
int stream_id =
session.SubmitRequest(ToHeaders({{":method", "POST"},
@@ -443,7 +445,7 @@
EXPECT_FALSE(session.want_write());
const char* kSentinel1 = "arbitrary pointer 1";
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, true);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, true);
body1->AppendPayload("This is an example request body.");
body1->EndData();
int stream_id =
@@ -621,7 +623,7 @@
options.perspective = Perspective::kServer;
OgHttp2Session session(visitor, options);
EXPECT_FALSE(session.want_write());
- session.EnqueueFrame(absl::make_unique<spdy::SpdyPingIR>(42));
+ session.EnqueueFrame(std::make_unique<spdy::SpdyPingIR>(42));
EXPECT_TRUE(session.want_write());
EXPECT_CALL(visitor, OnBeforeFrameSent(SETTINGS, 0, _, 0x0));
@@ -643,7 +645,7 @@
options.perspective = Perspective::kServer;
OgHttp2Session session(visitor, options);
EXPECT_FALSE(session.want_write());
- session.EnqueueFrame(absl::make_unique<spdy::SpdySettingsIR>());
+ session.EnqueueFrame(std::make_unique<spdy::SpdySettingsIR>());
EXPECT_TRUE(session.want_write());
EXPECT_CALL(visitor, OnBeforeFrameSent(SETTINGS, 0, _, 0x0));
@@ -717,7 +719,7 @@
EXPECT_FALSE(session.want_write());
// A data fin is not sent so that the stream remains open, and the flow
// control state can be verified.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload("This is an example response body.");
int submit_result = session.SubmitResponse(
1,
@@ -808,7 +810,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload("This is an example response body.");
body1->EndData();
int submit_result = session.SubmitResponse(
@@ -900,7 +902,7 @@
// The body source must indicate that the end of the body is not the end of
// the stream.
- auto body1 = absl::make_unique<TestDataFrameSource>(visitor, false);
+ auto body1 = std::make_unique<TestDataFrameSource>(visitor, false);
body1->AppendPayload("This is an example response body.");
body1->EndData();
int submit_result = session.SubmitResponse(
diff --git a/quiche/http2/adapter/test_frame_sequence.cc b/quiche/http2/adapter/test_frame_sequence.cc
index b91caf6..9477aba 100644
--- a/quiche/http2/adapter/test_frame_sequence.cc
+++ b/quiche/http2/adapter/test_frame_sequence.cc
@@ -1,5 +1,7 @@
#include "quiche/http2/adapter/test_frame_sequence.h"
+#include <memory>
+
#include "quiche/http2/adapter/http2_util.h"
#include "quiche/http2/adapter/oghttp2_util.h"
#include "quiche/spdy/core/hpack/hpack_encoder.h"
@@ -32,7 +34,7 @@
TestFrameSequence& TestFrameSequence::Data(Http2StreamId stream_id,
absl::string_view payload, bool fin,
absl::optional<int> padding_length) {
- auto data = absl::make_unique<spdy::SpdyDataIR>(stream_id, payload);
+ auto data = std::make_unique<spdy::SpdyDataIR>(stream_id, payload);
data->set_fin(fin);
if (padding_length) {
data->set_padding_len(padding_length.value());
@@ -43,14 +45,14 @@
TestFrameSequence& TestFrameSequence::RstStream(Http2StreamId stream_id,
Http2ErrorCode error) {
- frames_.push_back(absl::make_unique<spdy::SpdyRstStreamIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyRstStreamIR>(
stream_id, TranslateErrorCode(error)));
return *this;
}
TestFrameSequence& TestFrameSequence::Settings(
absl::Span<const Http2Setting> settings) {
- auto settings_frame = absl::make_unique<spdy::SpdySettingsIR>();
+ auto settings_frame = std::make_unique<spdy::SpdySettingsIR>();
for (const Http2Setting& setting : settings) {
settings_frame->AddSetting(setting.id, setting.value);
}
@@ -59,7 +61,7 @@
}
TestFrameSequence& TestFrameSequence::SettingsAck() {
- auto settings = absl::make_unique<spdy::SpdySettingsIR>();
+ auto settings = std::make_unique<spdy::SpdySettingsIR>();
settings->set_is_ack(true);
frames_.push_back(std::move(settings));
return *this;
@@ -68,18 +70,18 @@
TestFrameSequence& TestFrameSequence::PushPromise(
Http2StreamId stream_id, Http2StreamId promised_stream_id,
absl::Span<const Header> headers) {
- frames_.push_back(absl::make_unique<spdy::SpdyPushPromiseIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyPushPromiseIR>(
stream_id, promised_stream_id, ToHeaderBlock(headers)));
return *this;
}
TestFrameSequence& TestFrameSequence::Ping(Http2PingId id) {
- frames_.push_back(absl::make_unique<spdy::SpdyPingIR>(id));
+ frames_.push_back(std::make_unique<spdy::SpdyPingIR>(id));
return *this;
}
TestFrameSequence& TestFrameSequence::PingAck(Http2PingId id) {
- auto ping = absl::make_unique<spdy::SpdyPingIR>(id);
+ auto ping = std::make_unique<spdy::SpdyPingIR>(id);
ping->set_is_ack(true);
frames_.push_back(std::move(ping));
return *this;
@@ -88,7 +90,7 @@
TestFrameSequence& TestFrameSequence::GoAway(Http2StreamId last_good_stream_id,
Http2ErrorCode error,
absl::string_view payload) {
- frames_.push_back(absl::make_unique<spdy::SpdyGoAwayIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyGoAwayIR>(
last_good_stream_id, TranslateErrorCode(error), std::string(payload)));
return *this;
}
@@ -113,17 +115,17 @@
std::string encoded_block = encoder.EncodeHeaderBlock(block);
const size_t pos = encoded_block.size() / 2;
const uint8_t flags = fin ? 0x1 : 0x0;
- frames_.push_back(absl::make_unique<spdy::SpdyUnknownIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyUnknownIR>(
stream_id, static_cast<uint8_t>(spdy::SpdyFrameType::HEADERS), flags,
encoded_block.substr(0, pos)));
- auto continuation = absl::make_unique<spdy::SpdyContinuationIR>(stream_id);
+ auto continuation = std::make_unique<spdy::SpdyContinuationIR>(stream_id);
continuation->set_end_headers(true);
continuation->take_encoding(encoded_block.substr(pos));
frames_.push_back(std::move(continuation));
} else {
auto headers =
- absl::make_unique<spdy::SpdyHeadersIR>(stream_id, std::move(block));
+ std::make_unique<spdy::SpdyHeadersIR>(stream_id, std::move(block));
headers->set_fin(fin);
frames_.push_back(std::move(headers));
}
@@ -139,14 +141,14 @@
TestFrameSequence& TestFrameSequence::WindowUpdate(Http2StreamId stream_id,
int32_t delta) {
frames_.push_back(
- absl::make_unique<spdy::SpdyWindowUpdateIR>(stream_id, delta));
+ std::make_unique<spdy::SpdyWindowUpdateIR>(stream_id, delta));
return *this;
}
TestFrameSequence& TestFrameSequence::Priority(Http2StreamId stream_id,
Http2StreamId parent_stream_id,
int weight, bool exclusive) {
- frames_.push_back(absl::make_unique<spdy::SpdyPriorityIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyPriorityIR>(
stream_id, parent_stream_id, weight, exclusive));
return *this;
}
@@ -156,13 +158,13 @@
bool multiple_frames) {
if (multiple_frames) {
const size_t pos = payload.size() / 2;
- frames_.push_back(absl::make_unique<spdy::SpdyUnknownIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyUnknownIR>(
stream_id, kMetadataFrameType, 0, std::string(payload.substr(0, pos))));
- frames_.push_back(absl::make_unique<spdy::SpdyUnknownIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyUnknownIR>(
stream_id, kMetadataFrameType, kMetadataEndFlag,
std::string(payload.substr(pos))));
} else {
- frames_.push_back(absl::make_unique<spdy::SpdyUnknownIR>(
+ frames_.push_back(std::make_unique<spdy::SpdyUnknownIR>(
stream_id, kMetadataFrameType, kMetadataEndFlag, std::string(payload)));
}
return *this;
diff --git a/quiche/http2/core/http2_trace_logging.cc b/quiche/http2/core/http2_trace_logging.cc
index 591d63a..ac0a827 100644
--- a/quiche/http2/core/http2_trace_logging.cc
+++ b/quiche/http2/core/http2_trace_logging.cc
@@ -1,6 +1,7 @@
#include "quiche/http2/core/http2_trace_logging.h"
#include <cstdint>
+#include <memory>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
@@ -192,7 +193,7 @@
wrapped_->OnHeaderFrameStart(stream_id);
if (is_enabled_()) {
recording_headers_handler_ =
- absl::make_unique<spdy::RecordingHeadersHandler>(result);
+ std::make_unique<spdy::RecordingHeadersHandler>(result);
result = recording_headers_handler_.get();
} else {
recording_headers_handler_ = nullptr;
diff --git a/quiche/spdy/core/metadata_extension.cc b/quiche/spdy/core/metadata_extension.cc
index 7fa32ec..c22167f 100644
--- a/quiche/spdy/core/metadata_extension.cc
+++ b/quiche/spdy/core/metadata_extension.cc
@@ -1,6 +1,7 @@
#include "quiche/spdy/core/metadata_extension.h"
#include <list>
+#include <memory>
#include <string>
#include "absl/memory/memory.h"
@@ -49,7 +50,7 @@
progressive_encoder_->Next(spdy::kHttp2DefaultFramePayloadLimit);
const bool end_metadata = !HasNext();
const uint8_t flags = end_metadata ? MetadataVisitor::kEndMetadataFlag : 0;
- return absl::make_unique<spdy::SpdyUnknownIR>(
+ return std::make_unique<spdy::SpdyUnknownIR>(
stream_id_, MetadataVisitor::kMetadataFrameType, flags,
std::move(payload));
}
@@ -106,7 +107,7 @@
}
auto it = metadata_map_.find(stream_id);
if (it == metadata_map_.end()) {
- auto state = absl::make_unique<MetadataPayloadState>(
+ auto state = std::make_unique<MetadataPayloadState>(
length, flags & kEndMetadataFlag);
auto result =
metadata_map_.insert(std::make_pair(stream_id, std::move(state)));
diff --git a/quiche/spdy/core/metadata_extension_test.cc b/quiche/spdy/core/metadata_extension_test.cc
index 4c47b91..ee20e6d 100644
--- a/quiche/spdy/core/metadata_extension_test.cc
+++ b/quiche/spdy/core/metadata_extension_test.cc
@@ -1,5 +1,7 @@
#include "quiche/spdy/core/metadata_extension.h"
+#include <memory>
+
#include "absl/container/flat_hash_map.h"
#include "absl/functional/bind_front.h"
#include "absl/strings/str_cat.h"
@@ -29,7 +31,7 @@
MetadataExtensionTest() : test_buffer_(kBuffer, kBufferSize) {}
void SetUp() override {
- extension_ = absl::make_unique<MetadataVisitor>(
+ extension_ = std::make_unique<MetadataVisitor>(
bind_front(&MetadataExtensionTest::OnCompletePayload, this),
bind_front(&MetadataExtensionTest::OnMetadataSupport, this));
}
diff --git a/quiche/spdy/core/spdy_framer_test.cc b/quiche/spdy/core/spdy_framer_test.cc
index dbc6073..4f940f8 100644
--- a/quiche/spdy/core/spdy_framer_test.cc
+++ b/quiche/spdy/core/spdy_framer_test.cc
@@ -9,6 +9,7 @@
#include <algorithm>
#include <cstdint>
#include <limits>
+#include <memory>
#include <tuple>
#include <utility>
#include <vector>
@@ -595,7 +596,7 @@
SpdyFramerTest()
: output_(output_buffer, kSize),
framer_(SpdyFramer::ENABLE_COMPRESSION),
- deframer_(absl::make_unique<Http2DecoderAdapter>()) {}
+ deframer_(std::make_unique<Http2DecoderAdapter>()) {}
protected:
void SetUp() override {
@@ -4064,7 +4065,7 @@
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
}
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
} while (++flags != 0);
}
@@ -4095,7 +4096,7 @@
deframer_->spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
} while (++flags != 0);
}
@@ -4142,7 +4143,7 @@
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
}
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
} while (++flags != 0);
}
@@ -4177,7 +4178,7 @@
deframer_->spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
} while (++flags != 0);
}
@@ -4262,7 +4263,7 @@
deframer_->spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
} while (++flags != 0);
}
@@ -4289,7 +4290,7 @@
deframer_->spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
} while (++flags != 0);
}
@@ -4437,7 +4438,7 @@
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_->spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
deframer_->spdy_framer_error());
- deframer_ = absl::make_unique<Http2DecoderAdapter>();
+ deframer_ = std::make_unique<Http2DecoderAdapter>();
deframer_->set_visitor(&visitor);
EXPECT_CALL(visitor, OnCommonHeader(1, 4, 0x3, 0x0));