Replace QuicheStrCat() with absl::StrCat()
PiperOrigin-RevId: 345724381
Change-Id: Ie9decd3ceb0b643894e8420d2e5b88024c1eafd5
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc
index e850aad..dda0c3e 100644
--- a/quic/core/http/end_to_end_test.cc
+++ b/quic/core/http/end_to_end_test.cc
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
@@ -65,7 +66,6 @@
#include "net/third_party/quiche/src/quic/tools/quic_server.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_client_stream.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using spdy::kV3LowestPriority;
@@ -104,9 +104,8 @@
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- std::string rv =
- quiche::QuicheStrCat(ParsedQuicVersionToString(p.version), "_",
- QuicTagToString(p.congestion_control_tag));
+ std::string rv = absl::StrCat(ParsedQuicVersionToString(p.version), "_",
+ QuicTagToString(p.congestion_control_tag));
std::replace(rv.begin(), rv.end(), ',', '_');
std::replace(rv.begin(), rv.end(), ' ', '_');
return rv;
@@ -3566,8 +3565,7 @@
std::string body =
use_large_response
? large_resource
- : quiche::QuicheStrCat("This is server push response body for ",
- url);
+ : absl::StrCat("This is server push response body for ", url);
SpdyHeaderBlock response_headers;
response_headers[":status"] = "200";
response_headers["content-length"] =
@@ -3630,7 +3628,7 @@
for (const std::string& url : push_urls) {
QUIC_DVLOG(1) << "send request for pushed stream on url " << url;
std::string expected_body =
- quiche::QuicheStrCat("This is server push response body for ", url);
+ absl::StrCat("This is server push response body for ", url);
std::string response_body = client_->SendSynchronousRequest(url);
QUIC_DVLOG(1) << "response body " << response_body;
EXPECT_EQ(expected_body, response_body);
@@ -3684,7 +3682,7 @@
// as the responses are already in the client's cache.
QUIC_DVLOG(1) << "send request for pushed stream on url " << url;
std::string expected_body =
- quiche::QuicheStrCat("This is server push response body for ", url);
+ absl::StrCat("This is server push response body for ", url);
std::string response_body = client_->SendSynchronousRequest(url);
QUIC_DVLOG(1) << "response body " << response_body;
EXPECT_EQ(expected_body, response_body);
@@ -3724,8 +3722,7 @@
const size_t kNumResources = 1 + kNumMaxStreams; // 11.
std::string push_urls[11];
for (size_t i = 0; i < kNumResources; ++i) {
- push_urls[i] =
- quiche::QuicheStrCat("https://example.com/push_resources", i);
+ push_urls[i] = absl::StrCat("https://example.com/push_resources", i);
}
AddRequestAndResponseWithServerPush("example.com", "/push_example", kBody,
push_urls, kNumResources, 0);
@@ -3742,9 +3739,8 @@
for (const std::string& url : push_urls) {
// Sending subsequent requesets will not actually send anything on the wire,
// as the responses are already in the client's cache.
- EXPECT_EQ(
- quiche::QuicheStrCat("This is server push response body for ", url),
- client_->SendSynchronousRequest(url));
+ EXPECT_EQ(absl::StrCat("This is server push response body for ", url),
+ client_->SendSynchronousRequest(url));
}
// Only 1 request should have been sent.
@@ -3787,7 +3783,7 @@
const size_t kNumResources = kNumMaxStreams + 1;
std::string push_urls[11];
for (size_t i = 0; i < kNumResources; ++i) {
- push_urls[i] = quiche::QuicheStrCat("http://example.com/push_resources", i);
+ push_urls[i] = absl::StrCat("http://example.com/push_resources", i);
}
AddRequestAndResponseWithServerPush("example.com", "/push_example", kBody,
push_urls, kNumResources, kBodySize);
diff --git a/quic/core/http/http_decoder.cc b/quic/core/http/http_decoder.cc
index 78703a6..590f2fc 100644
--- a/quic/core/http/http_decoder.cc
+++ b/quic/core/http/http_decoder.cc
@@ -154,10 +154,9 @@
static_cast<uint64_t>(http2::Http2FrameType::WINDOW_UPDATE) ||
current_frame_type_ ==
static_cast<uint64_t>(http2::Http2FrameType::CONTINUATION)) {
- RaiseError(
- QUIC_HTTP_RECEIVE_SPDY_FRAME,
- quiche::QuicheStrCat("HTTP/2 frame received in a HTTP/3 connection: ",
- current_frame_type_));
+ RaiseError(QUIC_HTTP_RECEIVE_SPDY_FRAME,
+ absl::StrCat("HTTP/2 frame received in a HTTP/3 connection: ",
+ current_frame_type_));
return false;
}
state_ = STATE_READING_FRAME_LENGTH;
diff --git a/quic/core/http/http_decoder_test.cc b/quic/core/http/http_decoder_test.cc
index f7b84bd..68f9d7f 100644
--- a/quic/core/http/http_decoder_test.cc
+++ b/quic/core/http/http_decoder_test.cc
@@ -9,6 +9,7 @@
#include "absl/base/macros.h"
#include "absl/strings/escaping.h"
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
#include "net/third_party/quiche/src/quic/core/http/http_frames.h"
@@ -17,7 +18,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using ::testing::_;
@@ -164,8 +164,7 @@
// Append garbage to |input|, then process it in a single call to
// HttpDecoder::ProcessInput(). Verify that garbage is not read.
QuicByteCount ProcessInputWithGarbageAppended(absl::string_view input) {
- std::string input_with_garbage_appended =
- quiche::QuicheStrCat(input, "blahblah");
+ std::string input_with_garbage_appended = absl::StrCat(input, "blahblah");
QuicByteCount processed_bytes = ProcessInput(input_with_garbage_appended);
// Guaranteed by HttpDecoder::ProcessInput() contract.
@@ -258,11 +257,11 @@
TEST_F(HttpDecoderTest, PushPromiseFrame) {
InSequence s;
- std::string input = quiche::QuicheStrCat(
- absl::HexStringToBytes("05" // type (PUSH PROMISE)
- "0f" // length
- "C000000000000101"), // push id 257
- "Headers"); // headers
+ std::string input =
+ absl::StrCat(absl::HexStringToBytes("05" // type (PUSH PROMISE)
+ "0f" // length
+ "C000000000000101"), // push id 257
+ "Headers"); // headers
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnPushPromiseFrameStart(2)).WillOnce(Return(false));
@@ -485,10 +484,9 @@
TEST_F(HttpDecoderTest, DataFrame) {
InSequence s;
- std::string input =
- quiche::QuicheStrCat(absl::HexStringToBytes("00" // type (DATA)
- "05"), // length
- "Data!"); // data
+ std::string input = absl::StrCat(absl::HexStringToBytes("00" // type (DATA)
+ "05"), // length
+ "Data!"); // data
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnDataFrameStart(2, 5)).WillOnce(Return(false));
@@ -615,9 +613,9 @@
TEST_F(HttpDecoderTest, HeadersFrame) {
InSequence s;
std::string input =
- quiche::QuicheStrCat(absl::HexStringToBytes("01" // type (HEADERS)
- "07"), // length
- "Headers"); // headers
+ absl::StrCat(absl::HexStringToBytes("01" // type (HEADERS)
+ "07"), // length
+ "Headers"); // headers
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnHeadersFrameStart(2, 7)).WillOnce(Return(false));
@@ -799,12 +797,12 @@
TEST_F(HttpDecoderTest, HeadersPausedThenData) {
InSequence s;
std::string input =
- quiche::QuicheStrCat(absl::HexStringToBytes("01" // type (HEADERS)
- "07"), // length
- "Headers", // headers
- absl::HexStringToBytes("00" // type (DATA)
- "05"), // length
- "Data!"); // data
+ absl::StrCat(absl::HexStringToBytes("01" // type (HEADERS)
+ "07"), // length
+ "Headers", // headers
+ absl::HexStringToBytes("00" // type (DATA)
+ "05"), // length
+ "Data!"); // data
// Visitor pauses processing, maybe because header decompression is blocked.
EXPECT_CALL(visitor_, OnHeadersFrameStart(2, 7));
diff --git a/quic/core/http/http_frames.h b/quic/core/http/http_frames.h
index 4959879..319e42b 100644
--- a/quic/core/http/http_frames.h
+++ b/quic/core/http/http_frames.h
@@ -11,11 +11,11 @@
#include <ostream>
#include <sstream>
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
@@ -84,7 +84,7 @@
std::string ToString() const {
std::string s;
for (auto it : values) {
- std::string setting = quiche::QuicheStrCat(
+ std::string setting = absl::StrCat(
SpdyUtils::H3SettingsToString(
static_cast<Http3AndQpackSettingsIdentifiers>(it.first)),
" = ", it.second, "; ");
@@ -165,11 +165,10 @@
rhs.priority_field_value);
}
std::string ToString() const {
- return quiche::QuicheStrCat(
- "Priority Frame : {prioritized_element_type: ",
- static_cast<int>(prioritized_element_type),
- ", prioritized_element_id: ", prioritized_element_id,
- ", priority_field_value: ", priority_field_value, "}");
+ return absl::StrCat("Priority Frame : {prioritized_element_type: ",
+ static_cast<int>(prioritized_element_type),
+ ", prioritized_element_id: ", prioritized_element_id,
+ ", priority_field_value: ", priority_field_value, "}");
}
friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(
diff --git a/quic/core/http/quic_headers_stream_test.cc b/quic/core/http/quic_headers_stream_test.cc
index 8f604b3..dc6a46d 100644
--- a/quic/core/http/quic_headers_stream_test.cc
+++ b/quic/core/http/quic_headers_stream_test.cc
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
@@ -25,7 +26,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
@@ -191,7 +191,7 @@
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& tp) {
- return quiche::QuicheStrCat(
+ return absl::StrCat(
ParsedQuicVersionToString(tp.version), "_",
(tp.perspective == Perspective::IS_CLIENT ? "client" : "server"));
}
@@ -687,36 +687,32 @@
data.AddSetting(SETTINGS_ENABLE_PUSH, 1);
data.AddSetting(SETTINGS_MAX_FRAME_SIZE, 1250);
SpdySerializedFrame frame(framer_->SerializeFrame(data));
- EXPECT_CALL(
- *connection_,
- CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
+ EXPECT_CALL(*connection_,
+ CloseConnection(
+ QUIC_INVALID_HEADERS_STREAM_DATA,
+ absl::StrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
SETTINGS_MAX_CONCURRENT_STREAMS),
- _));
- EXPECT_CALL(
- *connection_,
- CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
+ _));
+ EXPECT_CALL(*connection_,
+ CloseConnection(
+ QUIC_INVALID_HEADERS_STREAM_DATA,
+ absl::StrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
SETTINGS_INITIAL_WINDOW_SIZE),
- _));
+ _));
if (session_.perspective() == Perspective::IS_CLIENT) {
- EXPECT_CALL(
- *connection_,
- CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
+ EXPECT_CALL(*connection_,
+ CloseConnection(
+ QUIC_INVALID_HEADERS_STREAM_DATA,
+ absl::StrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
SETTINGS_ENABLE_PUSH),
- _));
+ _));
}
- EXPECT_CALL(
- *connection_,
- CloseConnection(
- QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
+ EXPECT_CALL(*connection_,
+ CloseConnection(
+ QUIC_INVALID_HEADERS_STREAM_DATA,
+ absl::StrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
SETTINGS_MAX_FRAME_SIZE),
- _));
+ _));
stream_frame_.data_buffer = frame.data();
stream_frame_.data_length = frame.size();
headers_stream_->OnStreamFrame(stream_frame_);
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc
index 4f5f1cf..cc6857f 100644
--- a/quic/core/http/quic_receive_control_stream.cc
+++ b/quic/core/http/quic_receive_control_stream.cc
@@ -284,7 +284,7 @@
void QuicReceiveControlStream::OnWrongFrame(absl::string_view frame_type) {
OnUnrecoverableError(
QUIC_HTTP_FRAME_UNEXPECTED_ON_CONTROL_STREAM,
- quiche::QuicheStrCat(frame_type, " frame received on control stream"));
+ absl::StrCat(frame_type, " frame received on control stream"));
}
} // namespace quic
diff --git a/quic/core/http/quic_receive_control_stream_test.cc b/quic/core/http/quic_receive_control_stream_test.cc
index 5a401b6..51948e6 100644
--- a/quic/core/http/quic_receive_control_stream_test.cc
+++ b/quic/core/http/quic_receive_control_stream_test.cc
@@ -51,7 +51,7 @@
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& tp) {
- return quiche::QuicheStrCat(
+ return absl::StrCat(
ParsedQuicVersionToString(tp.version), "_",
(tp.perspective == Perspective::IS_CLIENT ? "client" : "server"));
}
diff --git a/quic/core/http/quic_send_control_stream_test.cc b/quic/core/http/quic_send_control_stream_test.cc
index 4f1b461..95857e3 100644
--- a/quic/core/http/quic_send_control_stream_test.cc
+++ b/quic/core/http/quic_send_control_stream_test.cc
@@ -48,7 +48,7 @@
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& tp) {
- return quiche::QuicheStrCat(
+ return absl::StrCat(
ParsedQuicVersionToString(tp.version), "_",
(tp.perspective == Perspective::IS_CLIENT ? "client" : "server"));
}
diff --git a/quic/core/http/quic_spdy_client_session_test.cc b/quic/core/http/quic_spdy_client_session_test.cc
index 93d3e58..88ad4f8 100644
--- a/quic/core/http/quic_spdy_client_session_test.cc
+++ b/quic/core/http/quic_spdy_client_session_test.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "absl/base/macros.h"
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
@@ -950,7 +951,7 @@
connection_->transport_version(), promise_count);
auto headers = QuicHeaderList();
headers.OnHeaderBlockStart();
- headers.OnHeader(":path", quiche::QuicheStrCat("/", promise_count));
+ headers.OnHeader(":path", absl::StrCat("/", promise_count));
headers.OnHeader(":authority", "www.google.com");
headers.OnHeader(":method", "GET");
headers.OnHeader(":scheme", "https");
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc
index 06b1760..7f7deb2 100644
--- a/quic/core/http/quic_spdy_session.cc
+++ b/quic/core/http/quic_spdy_session.cc
@@ -12,6 +12,7 @@
#include "absl/base/attributes.h"
#include "absl/strings/numbers.h"
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/http/quic_headers_stream.h"
@@ -25,7 +26,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_stack_trace.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
@@ -201,10 +201,10 @@
default:
code = QUIC_INVALID_HEADERS_STREAM_DATA;
}
- CloseConnection(quiche::QuicheStrCat(
- "SPDY framing error: ", detailed_error,
- Http2DecoderAdapter::SpdyFramerErrorToString(error)),
- code);
+ CloseConnection(
+ absl::StrCat("SPDY framing error: ", detailed_error,
+ Http2DecoderAdapter::SpdyFramerErrorToString(error)),
+ code);
}
void OnDataFrameHeader(SpdyStreamId /*stream_id*/,
@@ -471,8 +471,7 @@
DCHECK(VersionUsesHttp3(transport_version()));
CloseConnectionWithDetails(
- error_code,
- quiche::QuicheStrCat("Decoder stream error: ", error_message));
+ error_code, absl::StrCat("Decoder stream error: ", error_message));
}
void QuicSpdySession::OnEncoderStreamError(QuicErrorCode error_code,
@@ -480,8 +479,7 @@
DCHECK(VersionUsesHttp3(transport_version()));
CloseConnectionWithDetails(
- error_code,
- quiche::QuicheStrCat("Encoder stream error: ", error_message));
+ error_code, absl::StrCat("Encoder stream error: ", error_message));
}
void QuicSpdySession::OnStreamHeadersPriority(
@@ -583,11 +581,11 @@
// This should never happen, because |buffered_stream_priorities_| should
// only contain entries for streams that are allowed to be open by the peer
// but have not been opened yet.
- std::string error_message = quiche::QuicheStrCat(
- "Too many stream priority values buffered: ",
- buffered_stream_priorities_.size(),
- ", which should not exceed the incoming stream limit of ",
- max_open_incoming_bidirectional_streams());
+ std::string error_message =
+ absl::StrCat("Too many stream priority values buffered: ",
+ buffered_stream_priorities_.size(),
+ ", which should not exceed the incoming stream limit of ",
+ max_open_incoming_bidirectional_streams());
QUIC_BUG << error_message;
connection()->CloseConnection(
QUIC_INTERNAL_ERROR, error_message,
@@ -654,9 +652,9 @@
id > last_received_http3_goaway_id_.value()) {
CloseConnectionWithDetails(
QUIC_HTTP_GOAWAY_ID_LARGER_THAN_PREVIOUS,
- quiche::QuicheStrCat("GOAWAY received with ID ", id,
- " greater than previously received ID ",
- last_received_http3_goaway_id_.value()));
+ absl::StrCat("GOAWAY received with ID ", id,
+ " greater than previously received ID ",
+ last_received_http3_goaway_id_.value()));
return;
}
last_received_http3_goaway_id_ = id;
@@ -863,7 +861,7 @@
<< QuicStackTrace();
connection()->CloseConnection(
QUIC_INVALID_STREAM_ID,
- quiche::QuicheStrCat("stream ", stream_id, " is static"),
+ absl::StrCat("stream ", stream_id, " is static"),
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return nullptr;
}
@@ -994,13 +992,12 @@
was_zero_rtt_rejected()
? QUIC_HTTP_ZERO_RTT_REJECTION_SETTINGS_MISMATCH
: QUIC_HTTP_ZERO_RTT_RESUMPTION_SETTINGS_MISMATCH,
- quiche::QuicheStrCat(
- was_zero_rtt_rejected()
- ? "Server rejected 0-RTT, aborting because "
- : "",
- "Server sent an SETTINGS_QPACK_MAX_TABLE_CAPACITY: ", value,
- "while current value is: ",
- qpack_encoder_->MaximumDynamicTableCapacity()));
+ absl::StrCat(was_zero_rtt_rejected()
+ ? "Server rejected 0-RTT, aborting because "
+ : "",
+ "Server sent an SETTINGS_QPACK_MAX_TABLE_CAPACITY: ",
+ value, "while current value is: ",
+ qpack_encoder_->MaximumDynamicTableCapacity()));
return false;
}
// However, limit the dynamic table capacity to
@@ -1021,13 +1018,12 @@
was_zero_rtt_rejected()
? QUIC_HTTP_ZERO_RTT_REJECTION_SETTINGS_MISMATCH
: QUIC_HTTP_ZERO_RTT_RESUMPTION_SETTINGS_MISMATCH,
- quiche::QuicheStrCat(
- was_zero_rtt_rejected()
- ? "Server rejected 0-RTT, aborting because "
- : "",
- "Server sent an SETTINGS_MAX_FIELD_SECTION_SIZE: ", value,
- "which reduces current value: ",
- max_outbound_header_list_size_));
+ absl::StrCat(was_zero_rtt_rejected()
+ ? "Server rejected 0-RTT, aborting because "
+ : "",
+ "Server sent an SETTINGS_MAX_FIELD_SECTION_SIZE: ",
+ value, "which reduces current value: ",
+ max_outbound_header_list_size_));
return false;
}
max_outbound_header_list_size_ = value;
@@ -1042,13 +1038,12 @@
was_zero_rtt_rejected()
? QUIC_HTTP_ZERO_RTT_REJECTION_SETTINGS_MISMATCH
: QUIC_HTTP_ZERO_RTT_RESUMPTION_SETTINGS_MISMATCH,
- quiche::QuicheStrCat(
- was_zero_rtt_rejected()
- ? "Server rejected 0-RTT, aborting because "
- : "",
- "Server sent an SETTINGS_QPACK_BLOCKED_STREAMS: ", value,
- "which reduces current value: ",
- qpack_encoder_->maximum_blocked_streams()));
+ absl::StrCat(was_zero_rtt_rejected()
+ ? "Server rejected 0-RTT, aborting because "
+ : "",
+ "Server sent an SETTINGS_QPACK_BLOCKED_STREAMS: ",
+ value, "which reduces current value: ",
+ qpack_encoder_->maximum_blocked_streams()));
return false;
}
break;
@@ -1062,8 +1057,8 @@
case spdy::SETTINGS_MAX_FRAME_SIZE:
CloseConnectionWithDetails(
QUIC_HTTP_RECEIVE_SPDY_SETTING,
- quiche::QuicheStrCat(
- "received HTTP/2 specific setting in HTTP/3 session: ", id));
+ absl::StrCat("received HTTP/2 specific setting in HTTP/3 session: ",
+ id));
return false;
default:
QUIC_DVLOG(1) << ENDPOINT << "Unknown setting identifier " << id
@@ -1091,8 +1086,8 @@
if (IsConnected()) {
CloseConnectionWithDetails(
QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat("Invalid value for SETTINGS_ENABLE_PUSH: ",
- value));
+ absl::StrCat("Invalid value for SETTINGS_ENABLE_PUSH: ",
+ value));
}
return true;
}
@@ -1108,8 +1103,7 @@
if (IsConnected()) {
CloseConnectionWithDetails(
QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat(
- "Unsupported field of HTTP/2 SETTINGS frame: ", id));
+ absl::StrCat("Unsupported field of HTTP/2 SETTINGS frame: ", id));
}
}
break;
@@ -1125,8 +1119,7 @@
if (IsConnected()) {
CloseConnectionWithDetails(
QUIC_INVALID_HEADERS_STREAM_DATA,
- quiche::QuicheStrCat("Unsupported field of HTTP/2 SETTINGS frame: ",
- id));
+ absl::StrCat("Unsupported field of HTTP/2 SETTINGS frame: ", id));
}
}
return true;
@@ -1462,10 +1455,9 @@
if (max_push_id < old_max_push_id.value()) {
CloseConnectionWithDetails(
QUIC_HTTP_INVALID_MAX_PUSH_ID,
- quiche::QuicheStrCat(
- "MAX_PUSH_ID received with value ", max_push_id,
- " which is smaller that previously received value ",
- old_max_push_id.value()));
+ absl::StrCat("MAX_PUSH_ID received with value ", max_push_id,
+ " which is smaller that previously received value ",
+ old_max_push_id.value()));
return false;
}
@@ -1508,11 +1500,10 @@
void QuicSpdySession::CloseConnectionOnDuplicateHttp3UnidirectionalStreams(
absl::string_view type) {
- QUIC_PEER_BUG << quiche::QuicheStrCat("Received a duplicate ", type,
- " stream: Closing connection.");
- CloseConnectionWithDetails(
- QUIC_HTTP_DUPLICATE_UNIDIRECTIONAL_STREAM,
- quiche::QuicheStrCat(type, " stream is received twice."));
+ QUIC_PEER_BUG << absl::StrCat("Received a duplicate ", type,
+ " stream: Closing connection.");
+ CloseConnectionWithDetails(QUIC_HTTP_DUPLICATE_UNIDIRECTIONAL_STREAM,
+ absl::StrCat(type, " stream is received twice."));
}
// static
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc
index d16935b..4eb0997 100644
--- a/quic/core/http/quic_spdy_session_test.cc
+++ b/quic/core/http/quic_spdy_session_test.cc
@@ -12,6 +12,7 @@
#include "absl/base/macros.h"
#include "absl/strings/escaping.h"
+#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
@@ -44,7 +45,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_send_buffer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
@@ -708,8 +708,8 @@
EXPECT_CALL(*connection_, SendControlFrame(_));
EXPECT_CALL(*connection_, OnStreamReset(closed_stream_id, _));
stream2->Reset(QUIC_BAD_APPLICATION_PAYLOAD);
- std::string msg = quiche::QuicheStrCat("Marking unknown stream ",
- closed_stream_id, " blocked.");
+ std::string msg =
+ absl::StrCat("Marking unknown stream ", closed_stream_id, " blocked.");
EXPECT_QUIC_BUG(session_.MarkConnectionLevelWriteBlocked(closed_stream_id),
msg);
}
@@ -1554,8 +1554,8 @@
while (!headers_stream->IsFlowControlBlocked() && stream_id < 2000) {
EXPECT_FALSE(session_.IsConnectionFlowControlBlocked());
EXPECT_FALSE(session_.IsStreamFlowControlBlocked());
- headers["header"] = quiche::QuicheStrCat(
- random.RandUint64(), random.RandUint64(), random.RandUint64());
+ headers["header"] = absl::StrCat(random.RandUint64(), random.RandUint64(),
+ random.RandUint64());
session_.WriteHeadersOnHeadersStream(stream_id, headers.Clone(), true,
spdy::SpdyStreamPrecedence(0),
nullptr);
@@ -2531,8 +2531,7 @@
&headers_buffer);
absl::string_view headers_frame_header(headers_buffer.get(),
headers_frame_header_length);
- std::string headers =
- quiche::QuicheStrCat(headers_frame_header, headers_payload);
+ std::string headers = absl::StrCat(headers_frame_header, headers_payload);
stream->OnStreamFrame(QuicStreamFrame(stream_id, false, 0, headers));
// Decoding is blocked because dynamic table entry has not been received yet.
@@ -2566,8 +2565,7 @@
&headers_buffer);
absl::string_view headers_frame_header(headers_buffer.get(),
headers_frame_header_length);
- std::string headers =
- quiche::QuicheStrCat(headers_frame_header, headers_payload);
+ std::string headers = absl::StrCat(headers_frame_header, headers_payload);
stream->OnStreamFrame(QuicStreamFrame(stream_id, false, 0, headers));
// Decoding is blocked because dynamic table entry has not been received yet.
diff --git a/quic/core/http/quic_spdy_stream.cc b/quic/core/http/quic_spdy_stream.cc
index afcc28f..62a81ae 100644
--- a/quic/core/http/quic_spdy_stream.cc
+++ b/quic/core/http/quic_spdy_stream.cc
@@ -171,7 +171,7 @@
void CloseConnectionOnWrongFrame(absl::string_view frame_type) {
stream_->OnUnrecoverableError(
QUIC_HTTP_FRAME_UNEXPECTED_ON_SPDY_STREAM,
- quiche::QuicheStrCat(frame_type, " frame received on data stream"));
+ absl::StrCat(frame_type, " frame received on data stream"));
}
QuicSpdyStream* stream_;
@@ -597,7 +597,7 @@
void QuicSpdyStream::OnHeaderDecodingError(absl::string_view error_message) {
qpack_decoded_headers_accumulator_.reset();
- std::string connection_close_error_message = quiche::QuicheStrCat(
+ std::string connection_close_error_message = absl::StrCat(
"Error decoding ", headers_decompressed_ ? "trailers" : "headers",
" on stream ", id(), ": ", error_message);
OnUnrecoverableError(QUIC_QPACK_DECOMPRESSION_FAILED,
@@ -620,7 +620,7 @@
PriorityUpdateFrame priority_update;
priority_update.prioritized_element_type = REQUEST_STREAM;
priority_update.prioritized_element_id = id();
- priority_update.priority_field_value = quiche::QuicheStrCat("u=", urgency);
+ priority_update.priority_field_value = absl::StrCat("u=", urgency);
spdy_session_->WriteHttp3PriorityUpdate(priority_update);
}
diff --git a/quic/core/http/quic_spdy_stream_test.cc b/quic/core/http/quic_spdy_stream_test.cc
index 38062ca..ce107fd 100644
--- a/quic/core/http/quic_spdy_stream_test.cc
+++ b/quic/core/http/quic_spdy_stream_test.cc
@@ -434,7 +434,7 @@
&headers_buffer);
absl::string_view headers_frame_header(headers_buffer.get(),
headers_frame_header_length);
- return quiche::QuicheStrCat(headers_frame_header, payload);
+ return absl::StrCat(headers_frame_header, payload);
}
// Construct PUSH_PROMISE frame with given payload.
@@ -449,7 +449,7 @@
frame, &push_promise_buffer);
absl::string_view push_promise_frame_header(
push_promise_buffer.get(), push_promise_frame_header_length);
- return quiche::QuicheStrCat(push_promise_frame_header, payload);
+ return absl::StrCat(push_promise_frame_header, payload);
}
std::string DataFrame(absl::string_view payload) {
@@ -458,7 +458,7 @@
HttpEncoder::SerializeDataFrameHeader(payload.length(), &data_buffer);
absl::string_view data_frame_header(data_buffer.get(),
data_frame_header_length);
- return quiche::QuicheStrCat(data_frame_header, payload);
+ return absl::StrCat(data_frame_header, payload);
}
std::string UnknownFrame(uint64_t frame_type, absl::string_view payload) {
@@ -2016,8 +2016,7 @@
std::string trailers =
HeadersFrame({std::make_pair("custom-key", "custom-value")});
- std::string stream_frame_payload =
- quiche::QuicheStrCat(headers, data, trailers);
+ std::string stream_frame_payload = absl::StrCat(headers, data, trailers);
QuicStreamFrame frame(stream_->id(), false, 0, stream_frame_payload);
stream_->OnStreamFrame(frame);
@@ -2051,8 +2050,7 @@
std::string trailers = HeadersFrame(trailers_block);
// Feed all three HTTP/3 frames in a single stream frame.
- std::string stream_frame_payload =
- quiche::QuicheStrCat(headers, data, trailers);
+ std::string stream_frame_payload = absl::StrCat(headers, data, trailers);
QuicStreamFrame frame(stream_->id(), false, 0, stream_frame_payload);
stream_->OnStreamFrame(frame);
@@ -2092,7 +2090,7 @@
HeadersFrame(absl::HexStringToBytes("00002a94e7036261"));
std::string data = DataFrame(kDataFramePayload);
- std::string stream_frame_payload = quiche::QuicheStrCat(headers, data);
+ std::string stream_frame_payload = absl::StrCat(headers, data);
QuicStreamFrame frame(stream_->id(), false, 0, stream_frame_payload);
EXPECT_CALL(
@@ -2948,7 +2946,7 @@
// Combine the two frames to make sure they are processed in a single
// QuicSpdyStream::OnDataAvailable() call.
- std::string frames = quiche::QuicheStrCat(settings, headers);
+ std::string frames = absl::StrCat(settings, headers);
EXPECT_EQ(0u, stream_->sequencer()->NumBytesConsumed());
diff --git a/quic/core/http/spdy_utils.cc b/quic/core/http/spdy_utils.cc
index 2a888fb..46f2326 100644
--- a/quic/core/http/spdy_utils.cc
+++ b/quic/core/http/spdy_utils.cc
@@ -9,13 +9,13 @@
#include <vector>
#include "absl/strings/numbers.h"
+#include "absl/strings/str_cat.h"
#include "absl/strings/str_split.h"
#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
@@ -165,7 +165,7 @@
RETURN_STRING_LITERAL(SETTINGS_MAX_FIELD_SECTION_SIZE);
RETURN_STRING_LITERAL(SETTINGS_QPACK_BLOCKED_STREAMS);
}
- return quiche::QuicheStrCat("UNSUPPORTED_SETTINGS_TYPE(", identifier, ")");
+ return absl::StrCat("UNSUPPORTED_SETTINGS_TYPE(", identifier, ")");
}
#undef RETURN_STRING_LITERAL // undef for jumbo builds