Replace QuicheStrCat() with absl::StrCat() PiperOrigin-RevId: 345517224 Change-Id: I2dec334eccee000424364223479bf955fe252f1e
diff --git a/http2/hpack/decoder/hpack_block_decoder.cc b/http2/hpack/decoder/hpack_block_decoder.cc index 509a493..3211daa 100644 --- a/http2/hpack/decoder/hpack_block_decoder.cc +++ b/http2/hpack/decoder/hpack_block_decoder.cc
@@ -6,10 +6,10 @@ #include <cstdint> +#include "absl/strings/str_cat.h" #include "net/third_party/quiche/src/http2/platform/api/http2_flags.h" #include "net/third_party/quiche/src/http2/platform/api/http2_logging.h" #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace http2 { @@ -53,7 +53,7 @@ } std::string HpackBlockDecoder::DebugString() const { - return quiche::QuicheStrCat( + return absl::StrCat( "HpackBlockDecoder(", entry_decoder_.DebugString(), ", listener@", Http2Hex(reinterpret_cast<intptr_t>(listener_)), (before_entry_ ? ", between entries)" : ", in an entry)"));
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder.cc b/http2/hpack/decoder/hpack_entry_type_decoder.cc index 5df119f..c2fe470 100644 --- a/http2/hpack/decoder/hpack_entry_type_decoder.cc +++ b/http2/hpack/decoder/hpack_entry_type_decoder.cc
@@ -4,16 +4,16 @@ #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder.h" +#include "absl/strings/str_cat.h" #include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h" #include "net/third_party/quiche/src/http2/platform/api/http2_flags.h" #include "net/third_party/quiche/src/http2/platform/api/http2_logging.h" #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace http2 { std::string HpackEntryTypeDecoder::DebugString() const { - return quiche::QuicheStrCat( + return absl::StrCat( "HpackEntryTypeDecoder(varint_decoder=", varint_decoder_.DebugString(), ", entry_type=", entry_type_, ")"); }
diff --git a/http2/hpack/decoder/hpack_string_decoder.cc b/http2/hpack/decoder/hpack_string_decoder.cc index ad5bb54..bc1e43b 100644 --- a/http2/hpack/decoder/hpack_string_decoder.cc +++ b/http2/hpack/decoder/hpack_string_decoder.cc
@@ -4,15 +4,15 @@ #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" +#include "absl/strings/str_cat.h" namespace http2 { std::string HpackStringDecoder::DebugString() const { - return quiche::QuicheStrCat( - "HpackStringDecoder(state=", StateToString(state_), - ", length=", length_decoder_.DebugString(), ", remaining=", remaining_, - ", huffman=", huffman_encoded_ ? "true)" : "false)"); + return absl::StrCat("HpackStringDecoder(state=", StateToString(state_), + ", length=", length_decoder_.DebugString(), + ", remaining=", remaining_, + ", huffman=", huffman_encoded_ ? "true)" : "false)"); } // static @@ -25,7 +25,7 @@ case kResumeDecodingLength: return "kResumeDecodingLength"; } - return quiche::QuicheStrCat("UNKNOWN_STATE(", static_cast<uint32_t>(v), ")"); + return absl::StrCat("UNKNOWN_STATE(", static_cast<uint32_t>(v), ")"); } std::ostream& operator<<(std::ostream& out, const HpackStringDecoder& v) {
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/http2/hpack/decoder/hpack_whole_entry_buffer.cc index ecdcdc9..4d54b16 100644 --- a/http2/hpack/decoder/hpack_whole_entry_buffer.cc +++ b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -4,12 +4,12 @@ #include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h" +#include "absl/strings/str_cat.h" #include "net/third_party/quiche/src/http2/platform/api/http2_estimate_memory_usage.h" #include "net/third_party/quiche/src/http2/platform/api/http2_flags.h" #include "net/third_party/quiche/src/http2/platform/api/http2_logging.h" #include "net/third_party/quiche/src/http2/platform/api/http2_macros.h" #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace http2 { @@ -92,7 +92,7 @@ << (huffman_encoded ? "true" : "false") << ", len=" << len; if (!error_detected_) { if (len > max_string_size_bytes_) { - std::string detailed_error = quiche::QuicheStrCat( + std::string detailed_error = absl::StrCat( "Value length (", len, ") of [", name_.GetStringIfComplete(), "] is longer than permitted (", max_string_size_bytes_, ")"); HTTP2_DVLOG(1) << detailed_error;
diff --git a/http2/http2_constants.cc b/http2/http2_constants.cc index 08351c4..61481e4 100644 --- a/http2/http2_constants.cc +++ b/http2/http2_constants.cc
@@ -4,10 +4,10 @@ #include "net/third_party/quiche/src/http2/http2_constants.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "net/third_party/quiche/src/http2/platform/api/http2_logging.h" #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace http2 { @@ -36,7 +36,7 @@ case Http2FrameType::ALTSVC: return "ALTSVC"; } - return quiche::QuicheStrCat("UnknownFrameType(", static_cast<int>(v), ")"); + return absl::StrCat("UnknownFrameType(", static_cast<int>(v), ")"); } std::string Http2FrameTypeToString(uint8_t v) { @@ -121,7 +121,7 @@ case 0xd: return "HTTP_1_1_REQUIRED"; } - return quiche::QuicheStrCat("UnknownErrorCode(0x", Http2Hex(v), ")"); + return absl::StrCat("UnknownErrorCode(0x", Http2Hex(v), ")"); } std::string Http2ErrorCodeToString(Http2ErrorCode v) { return Http2ErrorCodeToString(static_cast<uint32_t>(v)); @@ -142,7 +142,7 @@ case 0x6: return "MAX_HEADER_LIST_SIZE"; } - return quiche::QuicheStrCat("UnknownSettingsParameter(0x", Http2Hex(v), ")"); + return absl::StrCat("UnknownSettingsParameter(0x", Http2Hex(v), ")"); } std::string Http2SettingsParameterToString(Http2SettingsParameter v) { return Http2SettingsParameterToString(static_cast<uint32_t>(v));
diff --git a/http2/http2_structures.cc b/http2/http2_structures.cc index 3558331..7d4f745 100644 --- a/http2/http2_structures.cc +++ b/http2/http2_structures.cc
@@ -7,8 +7,8 @@ #include <cstring> // For std::memcmp #include <sstream> +#include "absl/strings/str_cat.h" #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace http2 { @@ -21,9 +21,9 @@ } std::string Http2FrameHeader::ToString() const { - return quiche::QuicheStrCat( - "length=", payload_length, ", type=", Http2FrameTypeToString(type), - ", flags=", FlagsToString(), ", stream=", stream_id); + return absl::StrCat("length=", payload_length, + ", type=", Http2FrameTypeToString(type), + ", flags=", FlagsToString(), ", stream=", stream_id); } std::string Http2FrameHeader::FlagsToString() const {
diff --git a/http2/http2_structures_test.cc b/http2/http2_structures_test.cc index 6b060cf..97b7b34 100644 --- a/http2/http2_structures_test.cc +++ b/http2/http2_structures_test.cc
@@ -19,11 +19,11 @@ #include <type_traits> #include <vector> +#include "absl/strings/str_cat.h" #include "net/third_party/quiche/src/http2/http2_structures_test_util.h" #include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h" #include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h" #include "net/third_party/quiche/src/http2/test_tools/http2_random.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" #include "net/third_party/quiche/src/common/platform/api/quiche_test.h" using ::testing::AssertionResult; @@ -441,8 +441,7 @@ std::stringstream s; s << v; - EXPECT_EQ(quiche::QuicheStrCat("promised_stream_id=", promised_stream_id), - s.str()); + EXPECT_EQ(absl::StrCat("promised_stream_id=", promised_stream_id), s.str()); // High-bit is reserved, but not used, so we can set it. promised_stream_id |= 0x80000000; @@ -499,9 +498,8 @@ std::stringstream s; s << v; - EXPECT_EQ( - quiche::QuicheStrCat("window_size_increment=", window_size_increment), - s.str()); + EXPECT_EQ(absl::StrCat("window_size_increment=", window_size_increment), + s.str()); // High-bit is reserved, but not used, so we can set it. window_size_increment |= 0x80000000; @@ -525,7 +523,7 @@ std::stringstream s; s << v; - EXPECT_EQ(quiche::QuicheStrCat("origin_length=", origin_length), s.str()); + EXPECT_EQ(absl::StrCat("origin_length=", origin_length), s.str()); Http2AltSvcFields w{++origin_length}; EXPECT_EQ(w, w);
diff --git a/quic/masque/masque_client_bin.cc b/quic/masque/masque_client_bin.cc index 0e44092..f0eda82 100644 --- a/quic/masque/masque_client_bin.cc +++ b/quic/masque/masque_client_bin.cc
@@ -9,6 +9,7 @@ #include <memory> +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" #include "net/third_party/quiche/src/quic/core/quic_server_id.h" #include "net/third_party/quiche/src/quic/masque/masque_client_tools.h" @@ -21,7 +22,6 @@ #include "net/third_party/quiche/src/quic/platform/api/quic_system_event_loop.h" #include "net/third_party/quiche/src/quic/tools/fake_proof_verifier.h" #include "net/third_party/quiche/src/quic/tools/quic_url.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" DEFINE_QUIC_COMMAND_LINE_FLAG(bool, @@ -51,7 +51,7 @@ QuicUrl masque_url(urls[0], "https"); if (masque_url.host().empty()) { - masque_url = QuicUrl(quiche::QuicheStrCat("https://", urls[0]), "https"); + masque_url = QuicUrl(absl::StrCat("https://", urls[0]), "https"); } if (masque_url.host().empty()) { QUIC_LOG(ERROR) << "Failed to parse MASQUE server address " << urls[0];
diff --git a/quic/masque/masque_client_tools.cc b/quic/masque/masque_client_tools.cc index e59204a..b8aec5c 100644 --- a/quic/masque/masque_client_tools.cc +++ b/quic/masque/masque_client_tools.cc
@@ -26,7 +26,7 @@ // Build the client, and try to connect. const QuicSocketAddress addr = - LookupAddress(url.host(), quiche::QuicheStrCat(url.port())); + LookupAddress(url.host(), absl::StrCat(url.port())); if (!addr.IsInitialized()) { QUIC_LOG(ERROR) << "Unable to resolve address: " << url.host(); return false;
diff --git a/quic/masque/masque_epoll_client.cc b/quic/masque/masque_epoll_client.cc index 3b7c201..7d4f145 100644 --- a/quic/masque/masque_epoll_client.cc +++ b/quic/masque/masque_epoll_client.cc
@@ -47,8 +47,7 @@ QuicEpollServer* epoll_server, std::unique_ptr<ProofVerifier> proof_verifier) { // Build the masque_client, and try to connect. - QuicSocketAddress addr = - tools::LookupAddress(host, quiche::QuicheStrCat(port)); + QuicSocketAddress addr = tools::LookupAddress(host, absl::StrCat(port)); if (!addr.IsInitialized()) { QUIC_LOG(ERROR) << "Unable to resolve address: " << host; return nullptr; @@ -59,7 +58,7 @@ // MasqueEpollClient is private and therefore not accessible from make_unique. auto masque_client = QuicWrapUnique(new MasqueEpollClient( addr, server_id, epoll_server, std::move(proof_verifier), - quiche::QuicheStrCat(host, ":", port))); + absl::StrCat(host, ":", port))); if (masque_client == nullptr) { QUIC_LOG(ERROR) << "Failed to create masque_client";
diff --git a/quic/masque/masque_server_backend.cc b/quic/masque/masque_server_backend.cc index fc2fdc0..86a7ff5 100644 --- a/quic/masque/masque_server_backend.cc +++ b/quic/masque/masque_server_backend.cc
@@ -3,8 +3,8 @@ // found in the LICENSE file. #include "net/third_party/quiche/src/quic/masque/masque_server_backend.h" +#include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" -#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace quic { @@ -12,9 +12,9 @@ std::string GetRequestHandlerKey( const QuicSimpleServerBackend::RequestHandler* request_handler) { - return quiche::QuicheStrCat(request_handler->connection_id().ToString(), "_", - request_handler->stream_id(), "_", - request_handler->peer_host()); + return absl::StrCat(request_handler->connection_id().ToString(), "_", + request_handler->stream_id(), "_", + request_handler->peer_host()); } } // namespace