Use quiche string libraries in third_party/quic/quartc

gfe-relnote: n/a, no functional change
PiperOrigin-RevId: 285209158
Change-Id: I5c208ceed99a1cab430ce8b24672a0f132cdc4dc
diff --git a/quic/quartc/quartc_crypto_helpers.cc b/quic/quartc/quartc_crypto_helpers.cc
index edc6996..e3b96ad 100644
--- a/quic/quartc/quartc_crypto_helpers.cc
+++ b/quic/quartc/quartc_crypto_helpers.cc
@@ -14,7 +14,7 @@
                                 const std::string& hostname,
                                 const std::string& /*server_config*/,
                                 QuicTransportVersion /*transport_version*/,
-                                QuicStringPiece /*chlo_hash*/,
+                                quiche::QuicheStringPiece /*chlo_hash*/,
                                 std::unique_ptr<Callback> callback) {
   QuicReferenceCountedPointer<ProofSource::Chain> chain =
       GetCertChain(server_address, hostname);
@@ -37,7 +37,7 @@
     const QuicSocketAddress& /*server_address*/,
     const std::string& /*hostname*/,
     uint16_t /*signature_algorithm*/,
-    QuicStringPiece /*in*/,
+    quiche::QuicheStringPiece /*in*/,
     std::unique_ptr<SignatureCallback> callback) {
   callback->Run(true, "Dummy signature");
 }
@@ -47,7 +47,7 @@
     const uint16_t /*port*/,
     const std::string& /*server_config*/,
     QuicTransportVersion /*transport_version*/,
-    QuicStringPiece /*chlo_hash*/,
+    quiche::QuicheStringPiece /*chlo_hash*/,
     const std::vector<std::string>& /*certs*/,
     const std::string& /*cert_sct*/,
     const std::string& /*signature*/,
@@ -85,7 +85,7 @@
 }
 
 std::unique_ptr<QuicCryptoClientConfig> CreateCryptoClientConfig(
-    QuicStringPiece pre_shared_key) {
+    quiche::QuicheStringPiece pre_shared_key) {
   auto config = std::make_unique<QuicCryptoClientConfig>(
       std::make_unique<InsecureProofVerifier>());
   config->set_pad_inchoate_hello(false);
@@ -96,9 +96,10 @@
   return config;
 }
 
-CryptoServerConfig CreateCryptoServerConfig(QuicRandom* random,
-                                            const QuicClock* clock,
-                                            QuicStringPiece pre_shared_key) {
+CryptoServerConfig CreateCryptoServerConfig(
+    QuicRandom* random,
+    const QuicClock* clock,
+    quiche::QuicheStringPiece pre_shared_key) {
   CryptoServerConfig crypto_server_config;
 
   // Generate a random source address token secret. For long-running servers
diff --git a/quic/quartc/quartc_crypto_helpers.h b/quic/quartc/quartc_crypto_helpers.h
index cdf14a0..8f0fe96 100644
--- a/quic/quartc/quartc_crypto_helpers.h
+++ b/quic/quartc/quartc_crypto_helpers.h
@@ -17,7 +17,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_versions.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -47,7 +47,7 @@
                 const std::string& hostname,
                 const std::string& server_config,
                 QuicTransportVersion transport_version,
-                QuicStringPiece chlo_hash,
+                quiche::QuicheStringPiece chlo_hash,
                 std::unique_ptr<Callback> callback) override;
 
   QuicReferenceCountedPointer<Chain> GetCertChain(
@@ -58,7 +58,7 @@
       const QuicSocketAddress& server_address,
       const std::string& hostname,
       uint16_t signature_algorithm,
-      QuicStringPiece in,
+      quiche::QuicheStringPiece in,
       std::unique_ptr<SignatureCallback> callback) override;
 };
 
@@ -76,7 +76,7 @@
       const uint16_t port,
       const std::string& server_config,
       QuicTransportVersion transport_version,
-      QuicStringPiece chlo_hash,
+      quiche::QuicheStringPiece chlo_hash,
       const std::vector<std::string>& certs,
       const std::string& cert_sct,
       const std::string& signature,
@@ -109,11 +109,12 @@
 };
 
 std::unique_ptr<QuicCryptoClientConfig> CreateCryptoClientConfig(
-    QuicStringPiece pre_shared_key);
+    quiche::QuicheStringPiece pre_shared_key);
 
-CryptoServerConfig CreateCryptoServerConfig(QuicRandom* random,
-                                            const QuicClock* clock,
-                                            QuicStringPiece pre_shared_key);
+CryptoServerConfig CreateCryptoServerConfig(
+    QuicRandom* random,
+    const QuicClock* clock,
+    quiche::QuicheStringPiece pre_shared_key);
 
 }  // namespace quic
 
diff --git a/quic/quartc/quartc_dispatcher.cc b/quic/quartc/quartc_dispatcher.cc
index b174519..57de849 100644
--- a/quic/quartc/quartc_dispatcher.cc
+++ b/quic/quartc/quartc_dispatcher.cc
@@ -7,6 +7,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/core/quic_versions.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_factory.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -52,7 +53,7 @@
 QuartcSession* QuartcDispatcher::CreateQuicSession(
     QuicConnectionId connection_id,
     const QuicSocketAddress& client_address,
-    QuicStringPiece /*alpn*/,
+    quiche::QuicheStringPiece /*alpn*/,
     const ParsedQuicVersion& version) {
   // Make our expected connection ID non-mutable since we have a connection.
   SetShouldUpdateExpectedServerConnectionIdLength(false);
diff --git a/quic/quartc/quartc_dispatcher.h b/quic/quartc/quartc_dispatcher.h
index 06e799e..b294330 100644
--- a/quic/quartc/quartc_dispatcher.h
+++ b/quic/quartc/quartc_dispatcher.h
@@ -15,8 +15,8 @@
 #include "net/third_party/quiche/src/quic/core/quic_version_manager.h"
 #include "net/third_party/quiche/src/quic/core/quic_versions.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -42,7 +42,7 @@
 
   QuartcSession* CreateQuicSession(QuicConnectionId server_connection_id,
                                    const QuicSocketAddress& client_address,
-                                   QuicStringPiece alpn,
+                                   quiche::QuicheStringPiece alpn,
                                    const ParsedQuicVersion& version) override;
 
   // TODO(b/124399417): Override GenerateNewServerConnectionId and request a
diff --git a/quic/quartc/quartc_endpoint.cc b/quic/quartc/quartc_endpoint.cc
index 5860454..ca8fad6 100644
--- a/quic/quartc/quartc_endpoint.cc
+++ b/quic/quartc/quartc_endpoint.cc
@@ -11,6 +11,7 @@
 #include "net/third_party/quiche/src/quic/quartc/quartc_connection_helper.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_crypto_helpers.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_dispatcher.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -52,7 +53,7 @@
     QuicRandom* random,
     QuartcEndpoint::Delegate* delegate,
     const QuartcSessionConfig& config,
-    QuicStringPiece serialized_server_config,
+    quiche::QuicheStringPiece serialized_server_config,
     std::unique_ptr<QuicVersionManager> version_manager)
     : alarm_factory_(alarm_factory),
       clock_(clock),
@@ -127,7 +128,8 @@
   delegate_->OnConnectionClosed(frame, source);
 }
 
-void QuartcClientEndpoint::OnMessageReceived(QuicStringPiece message) {
+void QuartcClientEndpoint::OnMessageReceived(
+    quiche::QuicheStringPiece message) {
   delegate_->OnMessageReceived(message);
 }
 
diff --git a/quic/quartc/quartc_endpoint.h b/quic/quartc/quartc_endpoint.h
index 0f557a2..f284d27 100644
--- a/quic/quartc/quartc_endpoint.h
+++ b/quic/quartc/quartc_endpoint.h
@@ -10,11 +10,11 @@
 #include "net/third_party/quiche/src/quic/core/quic_alarm_factory.h"
 #include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_clock.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_connection_helper.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_crypto_helpers.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_dispatcher.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_factory.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -62,7 +62,7 @@
       QuicRandom* random,
       QuartcEndpoint::Delegate* delegate,
       const QuartcSessionConfig& config,
-      QuicStringPiece serialized_server_config,
+      quiche::QuicheStringPiece serialized_server_config,
       std::unique_ptr<QuicVersionManager> version_manager = nullptr);
 
   void Connect(QuartcPacketTransport* packet_transport) override;
@@ -76,7 +76,7 @@
                                  QuicTime::Delta latest_rtt) override;
   void OnConnectionClosed(const QuicConnectionCloseFrame& frame,
                           ConnectionCloseSource source) override;
-  void OnMessageReceived(QuicStringPiece message) override;
+  void OnMessageReceived(quiche::QuicheStringPiece message) override;
   void OnMessageSent(int64_t datagram_id) override;
   void OnMessageAcked(int64_t datagram_id, QuicTime receive_timestamp) override;
   void OnMessageLost(int64_t datagram_id) override;
@@ -164,7 +164,7 @@
 
   // Accessor to retrieve the server crypto config.  May only be called after
   // Connect().
-  QuicStringPiece server_crypto_config() const {
+  quiche::QuicheStringPiece server_crypto_config() const {
     return crypto_config_.serialized_crypto_config;
   }
 
diff --git a/quic/quartc/quartc_factory.cc b/quic/quartc/quartc_factory.cc
index ffbb95e..0b98a21 100644
--- a/quic/quartc/quartc_factory.cc
+++ b/quic/quartc/quartc_factory.cc
@@ -15,6 +15,7 @@
 #include "net/third_party/quiche/src/quic/quartc/quartc_connection_helper.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_crypto_helpers.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -24,7 +25,7 @@
     QuicAlarmFactory* alarm_factory,
     QuicConnectionHelperInterface* connection_helper,
     const ParsedQuicVersionVector& supported_versions,
-    QuicStringPiece server_crypto_config,
+    quiche::QuicheStringPiece server_crypto_config,
     QuartcPacketTransport* packet_transport) {
   DCHECK(packet_transport);
 
diff --git a/quic/quartc/quartc_factory.h b/quic/quartc/quartc_factory.h
index df55cd3..665b8e7 100644
--- a/quic/quartc/quartc_factory.h
+++ b/quic/quartc/quartc_factory.h
@@ -10,6 +10,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_simple_buffer_allocator.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_packet_writer.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -43,7 +44,7 @@
     QuicAlarmFactory* alarm_factory,
     QuicConnectionHelperInterface* connection_helper,
     const ParsedQuicVersionVector& supported_versions,
-    QuicStringPiece server_crypto_config,
+    quiche::QuicheStringPiece server_crypto_config,
     QuartcPacketTransport* packet_transport);
 
 // Configures global settings, such as supported quic versions.
diff --git a/quic/quartc/quartc_fakes.h b/quic/quartc/quartc_fakes.h
index 91ea9a9..41594df 100644
--- a/quic/quartc/quartc_fakes.h
+++ b/quic/quartc/quartc_fakes.h
@@ -13,6 +13,7 @@
 #include "net/third_party/quiche/src/quic/quartc/quartc_endpoint.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_stream.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -54,7 +55,7 @@
     last_incoming_stream_->SetDelegate(stream_delegate_);
   }
 
-  void OnMessageReceived(QuicStringPiece message) override {
+  void OnMessageReceived(quiche::QuicheStringPiece message) override {
     incoming_messages_.emplace_back(message);
   }
 
diff --git a/quic/quartc/quartc_multiplexer.cc b/quic/quartc/quartc_multiplexer.cc
index cb7d77c..3abc3cd 100644
--- a/quic/quartc/quartc_multiplexer.cc
+++ b/quic/quartc/quartc_multiplexer.cc
@@ -10,6 +10,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -176,7 +177,7 @@
   session_delegate_->OnConnectionClosed(frame, source);
 }
 
-void QuartcMultiplexer::OnMessageReceived(QuicStringPiece message) {
+void QuartcMultiplexer::OnMessageReceived(quiche::QuicheStringPiece message) {
   QuicDataReader reader(message);
   QuicVariableLengthIntegerLength channel_id_length =
       reader.PeekVarInt62Length();
diff --git a/quic/quartc/quartc_multiplexer.h b/quic/quartc/quartc_multiplexer.h
index 9cb581d..b90026b 100644
--- a/quic/quartc/quartc_multiplexer.h
+++ b/quic/quartc/quartc_multiplexer.h
@@ -11,10 +11,10 @@
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_endpoint.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_stream.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -104,7 +104,7 @@
 
   // Called when a message is recieved by this channel.
   virtual void OnMessageReceived(uint64_t channel_id,
-                                 QuicStringPiece message) = 0;
+                                 quiche::QuicheStringPiece message) = 0;
 };
 
 // Delegate for session-wide events.
@@ -159,7 +159,7 @@
                                  QuicTime::Delta latest_rtt) override;
   void OnConnectionClosed(const QuicConnectionCloseFrame& frame,
                           ConnectionCloseSource source) override;
-  void OnMessageReceived(QuicStringPiece message) override;
+  void OnMessageReceived(quiche::QuicheStringPiece message) override;
   void OnMessageSent(int64_t datagram_id) override;
   void OnMessageAcked(int64_t datagram_id, QuicTime receive_timestamp) override;
   void OnMessageLost(int64_t datagram_id) override;
diff --git a/quic/quartc/quartc_multiplexer_test.cc b/quic/quartc/quartc_multiplexer_test.cc
index 9b989be..2a6e838 100644
--- a/quic/quartc/quartc_multiplexer_test.cc
+++ b/quic/quartc/quartc_multiplexer_test.cc
@@ -14,7 +14,6 @@
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test_mem_slice_vector.h"
 #include "net/third_party/quiche/src/quic/quartc/counting_packet_filter.h"
@@ -26,6 +25,8 @@
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/link.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace {
@@ -126,7 +127,7 @@
   }
 
   void OnMessageReceived(uint64_t channel_id,
-                         QuicStringPiece message) override {
+                         quiche::QuicheStringPiece message) override {
     messages_received_.emplace_back(channel_id, message);
   }
 
@@ -267,7 +268,7 @@
   std::vector<testing::Matcher<std::pair<int64_t, QuicTime>>> ack_matchers_1;
   std::vector<testing::Matcher<std::pair<int64_t, QuicTime>>> ack_matchers_2;
   for (int i = 0; i < num_messages; ++i) {
-    messages_1.emplace_back(1, QuicStrCat("message for 1: ", i));
+    messages_1.emplace_back(1, quiche::QuicheStrCat("message for 1: ", i));
     test::QuicTestMemSliceVector slice_1(
         {std::make_pair(const_cast<char*>(messages_1.back().second.data()),
                         messages_1.back().second.size())});
@@ -275,7 +276,7 @@
     messages_sent_1.push_back(i);
     ack_matchers_1.push_back(Pair(i, Gt(QuicTime::Zero())));
 
-    messages_2.emplace_back(2, QuicStrCat("message for 2: ", i));
+    messages_2.emplace_back(2, quiche::QuicheStrCat("message for 2: ", i));
     test::QuicTestMemSliceVector slice_2(
         {std::make_pair(const_cast<char*>(messages_2.back().second.data()),
                         messages_2.back().second.size())});
@@ -324,7 +325,7 @@
   std::vector<std::pair<uint64_t, std::string>> messages_2;
   messages_2.reserve(num_messages);
   for (int i = 0; i < num_messages; ++i) {
-    messages_1.emplace_back(1, QuicStrCat("message for 1: ", i));
+    messages_1.emplace_back(1, quiche::QuicheStrCat("message for 1: ", i));
     test::QuicTestMemSliceVector slice_1(
         {std::make_pair(const_cast<char*>(messages_1.back().second.data()),
                         messages_1.back().second.size())});
@@ -333,7 +334,7 @@
     stream_1->SetDelegate(&fake_send_stream_delegate);
     stream_1->WriteMemSlices(slice_1.span(), /*fin=*/true);
 
-    messages_2.emplace_back(2, QuicStrCat("message for 2: ", i));
+    messages_2.emplace_back(2, quiche::QuicheStrCat("message for 2: ", i));
     test::QuicTestMemSliceVector slice_2(
         {std::make_pair(const_cast<char*>(messages_2.back().second.data()),
                         messages_2.back().second.size())});
@@ -386,14 +387,14 @@
   std::vector<int64_t> messages_sent_1;
   std::vector<int64_t> messages_sent_2;
   for (int i = 0; i < num_messages; ++i) {
-    messages_1.emplace_back(1, QuicStrCat("message for 1: ", i));
+    messages_1.emplace_back(1, quiche::QuicheStrCat("message for 1: ", i));
     test::QuicTestMemSliceVector slice_1(
         {std::make_pair(const_cast<char*>(messages_1.back().second.data()),
                         messages_1.back().second.size())});
     send_channel_1->SendOrQueueMessage(slice_1.span(), i);
     messages_sent_1.push_back(i);
 
-    messages_2.emplace_back(2, QuicStrCat("message for 2: ", i));
+    messages_2.emplace_back(2, quiche::QuicheStrCat("message for 2: ", i));
     test::QuicTestMemSliceVector slice_2(
         {std::make_pair(const_cast<char*>(messages_2.back().second.data()),
                         messages_2.back().second.size())});
@@ -406,7 +407,8 @@
   // Now send something retransmittable to prompt loss detection.
   // If we never send anything retransmittable, we will never get acks, and
   // never detect losses.
-  messages_1.emplace_back(1, QuicStrCat("message for 1: ", num_messages));
+  messages_1.emplace_back(
+      1, quiche::QuicheStrCat("message for 1: ", num_messages));
   test::QuicTestMemSliceVector slice(
       {std::make_pair(const_cast<char*>(messages_1.back().second.data()),
                       messages_1.back().second.size())});
@@ -449,7 +451,7 @@
   std::vector<int64_t> messages_sent;
   std::vector<testing::Matcher<std::pair<int64_t, QuicTime>>> ack_matchers;
   for (int i = 0; i < num_messages; ++i) {
-    messages.emplace_back(1, QuicStrCat("message for 1: ", i));
+    messages.emplace_back(1, quiche::QuicheStrCat("message for 1: ", i));
     test::QuicTestMemSliceVector slice(
         {std::make_pair(const_cast<char*>(messages.back().second.data()),
                         messages.back().second.size())});
diff --git a/quic/quartc/quartc_session.cc b/quic/quartc/quartc_session.cc
index 654e540..4186f64 100644
--- a/quic/quartc/quartc_session.cc
+++ b/quic/quartc/quartc_session.cc
@@ -11,6 +11,7 @@
 #include "net/third_party/quiche/src/quic/core/tls_server_handshaker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_storage.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_crypto_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace {
@@ -276,7 +277,7 @@
                    packet);
 }
 
-void QuartcSession::OnMessageReceived(QuicStringPiece message) {
+void QuartcSession::OnMessageReceived(quiche::QuicheStringPiece message) {
   session_delegate_->OnMessageReceived(message);
 }
 
@@ -363,7 +364,7 @@
     const QuicClock* clock,
     std::unique_ptr<QuartcPacketWriter> packet_writer,
     std::unique_ptr<QuicCryptoClientConfig> client_crypto_config,
-    QuicStringPiece server_crypto_config)
+    quiche::QuicheStringPiece server_crypto_config)
     : QuartcSession(std::move(connection),
                     /*visitor=*/nullptr,
                     config,
diff --git a/quic/quartc/quartc_session.h b/quic/quartc/quartc_session.h
index 1c0fd31..e389867 100644
--- a/quic/quartc/quartc_session.h
+++ b/quic/quartc/quartc_session.h
@@ -18,6 +18,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_storage.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_packet_writer.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_stream.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -139,7 +140,7 @@
                                     ConnectionCloseSource source) = 0;
 
     // Called when message (sent as SendMessage) is received.
-    virtual void OnMessageReceived(QuicStringPiece message) = 0;
+    virtual void OnMessageReceived(quiche::QuicheStringPiece message) = 0;
 
     // Called when message is sent to QUIC.
     //
@@ -179,7 +180,7 @@
   // QuicConnection.
   void OnTransportReceived(const char* data, size_t data_len) override;
 
-  void OnMessageReceived(QuicStringPiece message) override;
+  void OnMessageReceived(quiche::QuicheStringPiece message) override;
 
   // Called when message with |message_id| gets acked.
   void OnMessageAcked(QuicMessageId message_id,
@@ -256,7 +257,7 @@
       const QuicClock* clock,
       std::unique_ptr<QuartcPacketWriter> packet_writer,
       std::unique_ptr<QuicCryptoClientConfig> client_crypto_config,
-      QuicStringPiece server_crypto_config);
+      quiche::QuicheStringPiece server_crypto_config);
   QuartcClientSession(const QuartcClientSession&) = delete;
   QuartcClientSession& operator=(const QuartcClientSession&) = delete;
 
diff --git a/quic/quartc/quartc_session_test.cc b/quic/quartc/quartc_session_test.cc
index 195baa4..920dfd9 100644
--- a/quic/quartc/quartc_session_test.cc
+++ b/quic/quartc/quartc_session_test.cc
@@ -23,6 +23,8 @@
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/packet_filter.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -41,7 +43,8 @@
 
 static QuicByteCount kDefaultMaxPacketSize = 1200;
 
-test::QuicTestMemSliceVector CreateMemSliceVector(QuicStringPiece data) {
+test::QuicTestMemSliceVector CreateMemSliceVector(
+    quiche::QuicheStringPiece data) {
   return test::QuicTestMemSliceVector(
       {std::pair<char*, size_t>(const_cast<char*>(data.data()), data.size())});
 }
@@ -248,8 +251,8 @@
     std::vector<int64_t> sent_datagram_ids;
     int64_t current_datagram_id = 0;
     while (peer_sending->send_message_queue_size() < queue_size) {
-      sent_messages.push_back(
-          QuicStrCat("Sending message, index=", sent_messages.size()));
+      sent_messages.push_back(quiche::QuicheStrCat("Sending message, index=",
+                                                   sent_messages.size()));
       ASSERT_TRUE(peer_sending->SendOrQueueMessage(
           CreateMemSliceVector(sent_messages.back()).span(),
           current_datagram_id));
diff --git a/quic/quartc/quartc_stream.cc b/quic/quartc/quartc_stream.cc
index 46f89db..8fd9c76 100644
--- a/quic/quartc/quartc_stream.cc
+++ b/quic/quartc/quartc_stream.cc
@@ -14,7 +14,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -157,7 +157,7 @@
 }
 
 void QuartcStream::FinishWriting() {
-  WriteOrBufferData(QuicStringPiece(nullptr, 0), true, nullptr);
+  WriteOrBufferData(quiche::QuicheStringPiece(nullptr, 0), true, nullptr);
 }
 
 void QuartcStream::SetDelegate(Delegate* delegate) {
diff --git a/quic/quartc/simulated_packet_transport.cc b/quic/quartc/simulated_packet_transport.cc
index 05f71c4..263c213 100644
--- a/quic/quartc/simulated_packet_transport.cc
+++ b/quic/quartc/simulated_packet_transport.cc
@@ -6,7 +6,7 @@
 
 #include <utility>
 
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
 
 namespace quic {
 namespace simulator {
@@ -19,7 +19,7 @@
     : Endpoint(simulator, name),
       peer_name_(peer_name),
       egress_queue_(simulator,
-                    QuicStringPrintf("%s (TX Queue)", name.c_str()),
+                    quiche::QuicheStringPrintf("%s (TX Queue)", name.c_str()),
                     queue_capacity) {
   egress_queue_.set_listener_interface(this);
 }
diff --git a/quic/quartc/test/quartc_bidi_test.cc b/quic/quartc/test/quartc_bidi_test.cc
index bb823c6..d7dbee5 100644
--- a/quic/quartc/test/quartc_bidi_test.cc
+++ b/quic/quartc/test/quartc_bidi_test.cc
@@ -7,7 +7,6 @@
 #include "net/third_party/quiche/src/quic/core/quic_bandwidth.h"
 #include "net/third_party/quiche/src/quic/core/quic_time.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/quic/quartc/simulated_packet_transport.h"
 #include "net/third_party/quiche/src/quic/quartc/test/bidi_test_runner.h"
diff --git a/quic/quartc/test/quartc_competing_endpoint.cc b/quic/quartc/test/quartc_competing_endpoint.cc
index f82f47e..bb073ec 100644
--- a/quic/quartc/test/quartc_competing_endpoint.cc
+++ b/quic/quartc/test/quartc_competing_endpoint.cc
@@ -6,7 +6,7 @@
 
 #include <utility>
 
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
 
 namespace quic {
 namespace test {
@@ -19,7 +19,7 @@
     const std::string& peer_name,
     Perspective perspective,
     QuicConnectionId connection_id)
-    : Actor(simulator, QuicStrCat(name, " actor")),
+    : Actor(simulator, quiche::QuicheStrCat(name, " actor")),
       send_interval_(send_interval),
       bytes_per_interval_(bytes_per_interval),
       endpoint_(std::make_unique<simulator::QuicEndpoint>(simulator,
diff --git a/quic/quartc/test/quartc_data_source.cc b/quic/quartc/test/quartc_data_source.cc
index c109325..5856bef 100644
--- a/quic/quartc/test/quartc_data_source.cc
+++ b/quic/quartc/test/quartc_data_source.cc
@@ -6,6 +6,7 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
 #include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -24,7 +25,7 @@
 
 }  // namespace
 
-bool ParsedQuartcDataFrame::Parse(QuicStringPiece data,
+bool ParsedQuartcDataFrame::Parse(quiche::QuicheStringPiece data,
                                   ParsedQuartcDataFrame* out) {
   QuicDataReader reader(data.data(), data.size());
 
@@ -42,7 +43,7 @@
   if (!reader.ReadUInt64(&time_bits)) {
     return false;
   }
-  QuicStringPiece payload = reader.ReadRemainingPayload();
+  quiche::QuicheStringPiece payload = reader.ReadRemainingPayload();
 
   out->source_id = source_id;
   out->sequence_number = sequence_number;
diff --git a/quic/quartc/test/quartc_data_source.h b/quic/quartc/test/quartc_data_source.h
index 557a1de..8c5ee3b 100644
--- a/quic/quartc/test/quartc_data_source.h
+++ b/quic/quartc/test/quartc_data_source.h
@@ -11,7 +11,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_bandwidth.h"
 #include "net/third_party/quiche/src/quic/core/quic_time.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_clock.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -24,7 +24,7 @@
 struct ParsedQuartcDataFrame {
   // Parses the given data as a frame generated by QuartcDataSource.  Returns
   // true if parsing succeeds or false if parsing fails.
-  static bool Parse(QuicStringPiece data, ParsedQuartcDataFrame* out);
+  static bool Parse(quiche::QuicheStringPiece data, ParsedQuartcDataFrame* out);
 
   // Note that a properly formatted, parseable frame always contains these three
   // header fields.
diff --git a/quic/quartc/test/quartc_data_source_test.cc b/quic/quartc/test/quartc_data_source_test.cc
index 62038c6..3bf7e66 100644
--- a/quic/quartc/test/quartc_data_source_test.cc
+++ b/quic/quartc/test/quartc_data_source_test.cc
@@ -9,6 +9,7 @@
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -26,7 +27,7 @@
 
 void FakeDelegate::OnDataProduced(const char* data, size_t length) {
   ParsedQuartcDataFrame frame;
-  QuicStringPiece message(data, length);
+  quiche::QuicheStringPiece message(data, length);
   if (ParsedQuartcDataFrame::Parse(message, &frame)) {
     frames_.push_back(frame);
   } else {
diff --git a/quic/quartc/test/quartc_peer.cc b/quic/quartc/test/quartc_peer.cc
index 885e6b1..ea1257d 100644
--- a/quic/quartc/test/quartc_peer.cc
+++ b/quic/quartc/test/quartc_peer.cc
@@ -7,7 +7,7 @@
 #include <utility>
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_storage.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -100,7 +100,7 @@
   SetEnabled(false);
 }
 
-void QuartcPeer::OnMessageReceived(QuicStringPiece message) {
+void QuartcPeer::OnMessageReceived(quiche::QuicheStringPiece message) {
   ReceivedMessage received;
   received.receive_time = clock_->Now();
 
diff --git a/quic/quartc/test/quartc_peer.h b/quic/quartc/test/quartc_peer.h
index 4906fd0..7d88d4a 100644
--- a/quic/quartc/test/quartc_peer.h
+++ b/quic/quartc/test/quartc_peer.h
@@ -14,11 +14,11 @@
 #include "net/third_party/quiche/src/quic/core/quic_time.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_endpoint.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_stream.h"
 #include "net/third_party/quiche/src/quic/quartc/test/quartc_data_source.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -84,7 +84,7 @@
                                  QuicTime::Delta latest_rtt) override;
   void OnConnectionClosed(const QuicConnectionCloseFrame& frame,
                           ConnectionCloseSource source) override;
-  void OnMessageReceived(QuicStringPiece message) override;
+  void OnMessageReceived(quiche::QuicheStringPiece message) override;
   void OnMessageSent(int64_t /*datagram_id*/) override {}
   void OnMessageAcked(int64_t /*datagram_id*/,
                       QuicTime /*receive_timestamp*/) override {}
diff --git a/quic/quartc/test/quic_trace_interceptor.cc b/quic/quartc/test/quic_trace_interceptor.cc
index 1ab29d4..6550a6f 100644
--- a/quic/quartc/test/quic_trace_interceptor.cc
+++ b/quic/quartc/test/quic_trace_interceptor.cc
@@ -8,15 +8,15 @@
 #include <utility>
 
 #include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test_output.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_endpoint.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
 
-QuicTraceInterceptor::QuicTraceInterceptor(QuicStringPiece identifier)
+QuicTraceInterceptor::QuicTraceInterceptor(quiche::QuicheStringPiece identifier)
     : identifier_(identifier.data(), identifier.size()), delegate_(nullptr) {}
 
 QuicTraceInterceptor::~QuicTraceInterceptor() {
@@ -58,7 +58,8 @@
   delegate_->OnConnectionClosed(frame, source);
 }
 
-void QuicTraceInterceptor::OnMessageReceived(QuicStringPiece message) {
+void QuicTraceInterceptor::OnMessageReceived(
+    quiche::QuicheStringPiece message) {
   delegate_->OnMessageReceived(message);
 }
 
diff --git a/quic/quartc/test/quic_trace_interceptor.h b/quic/quartc/test/quic_trace_interceptor.h
index df283af..378133d 100644
--- a/quic/quartc/test/quic_trace_interceptor.h
+++ b/quic/quartc/test/quic_trace_interceptor.h
@@ -10,10 +10,10 @@
 #include "net/third_party/quiche/src/quic/core/quic_connection.h"
 #include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
 #include "net/third_party/quiche/src/quic/core/quic_trace_visitor.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_endpoint.h"
 #include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
 #include "net/third_party/quiche/src/quic/quartc/test/bidi_test_runner.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -23,7 +23,7 @@
   // Creates a trace visitor that records its output using the given identifier.
   // |identifier| is combined with the test name and timestamp to form a
   // filename for the trace.
-  explicit QuicTraceInterceptor(QuicStringPiece identifier);
+  explicit QuicTraceInterceptor(quiche::QuicheStringPiece identifier);
   ~QuicTraceInterceptor() override;
 
   // QuartcEndpointIntercept overrides.
@@ -36,7 +36,7 @@
                                  QuicTime::Delta latest_rtt) override;
   void OnConnectionClosed(const QuicConnectionCloseFrame& frame,
                           ConnectionCloseSource source) override;
-  void OnMessageReceived(QuicStringPiece message) override;
+  void OnMessageReceived(quiche::QuicheStringPiece message) override;
   void OnMessageSent(int64_t datagram_id) override;
   void OnMessageAcked(int64_t datagram_id, QuicTime receive_timestamp) override;
   void OnMessageLost(int64_t datagram_id) override;
diff --git a/quic/quartc/test/random_delay_link.cc b/quic/quartc/test/random_delay_link.cc
index 71e161c..e4cfcac 100644
--- a/quic/quartc/test/random_delay_link.cc
+++ b/quic/quartc/test/random_delay_link.cc
@@ -7,10 +7,10 @@
 #include <cmath>
 #include <cstdint>
 
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/link.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/port.h"
 #include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
 
 namespace quic {
 namespace simulator {
@@ -54,12 +54,12 @@
     QuicBandwidth bandwidth,
     QuicTime::Delta propagation_delay)
     : a_to_b_link_(simulator,
-                   QuicStringPrintf("%s (A-to-B)", name.c_str()),
+                   quiche::QuicheStringPrintf("%s (A-to-B)", name.c_str()),
                    sink_b,
                    bandwidth,
                    propagation_delay),
       b_to_a_link_(simulator,
-                   QuicStringPrintf("%s (B-to-A)", name.c_str()),
+                   quiche::QuicheStringPrintf("%s (B-to-A)", name.c_str()),
                    sink_a,
                    bandwidth,
                    propagation_delay) {}
@@ -69,14 +69,15 @@
     Endpoint* endpoint_b,
     QuicBandwidth bandwidth,
     QuicTime::Delta propagation_delay)
-    : SymmetricRandomDelayLink(endpoint_a->simulator(),
-                               QuicStringPrintf("Link [%s]<->[%s]",
-                                                endpoint_a->name().c_str(),
-                                                endpoint_b->name().c_str()),
-                               endpoint_a->GetRxPort(),
-                               endpoint_b->GetRxPort(),
-                               bandwidth,
-                               propagation_delay) {
+    : SymmetricRandomDelayLink(
+          endpoint_a->simulator(),
+          quiche::QuicheStringPrintf("Link [%s]<->[%s]",
+                                     endpoint_a->name().c_str(),
+                                     endpoint_b->name().c_str()),
+          endpoint_a->GetRxPort(),
+          endpoint_b->GetRxPort(),
+          bandwidth,
+          propagation_delay) {
   endpoint_a->SetTxPort(&a_to_b_link_);
   endpoint_b->SetTxPort(&b_to_a_link_);
 }