diff --git a/quic/core/crypto/aead_base_decrypter.cc b/quic/core/crypto/aead_base_decrypter.cc
index ab441b7..baaf6ce 100644
--- a/quic/core/crypto/aead_base_decrypter.cc
+++ b/quic/core/crypto/aead_base_decrypter.cc
@@ -14,6 +14,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -68,7 +69,7 @@
 
 AeadBaseDecrypter::~AeadBaseDecrypter() {}
 
-bool AeadBaseDecrypter::SetKey(QuicStringPiece key) {
+bool AeadBaseDecrypter::SetKey(quiche::QuicheStringPiece key) {
   DCHECK_EQ(key.size(), key_size_);
   if (key.size() != key_size_) {
     return false;
@@ -85,7 +86,7 @@
   return true;
 }
 
-bool AeadBaseDecrypter::SetNoncePrefix(QuicStringPiece nonce_prefix) {
+bool AeadBaseDecrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
   if (use_ietf_nonce_construction_) {
     QUIC_BUG << "Attempted to set nonce prefix on IETF QUIC crypter";
     return false;
@@ -98,7 +99,7 @@
   return true;
 }
 
-bool AeadBaseDecrypter::SetIV(QuicStringPiece iv) {
+bool AeadBaseDecrypter::SetIV(quiche::QuicheStringPiece iv) {
   if (!use_ietf_nonce_construction_) {
     QUIC_BUG << "Attempted to set IV on Google QUIC crypter";
     return false;
@@ -111,7 +112,7 @@
   return true;
 }
 
-bool AeadBaseDecrypter::SetPreliminaryKey(QuicStringPiece key) {
+bool AeadBaseDecrypter::SetPreliminaryKey(quiche::QuicheStringPiece key) {
   DCHECK(!have_preliminary_key_);
   SetKey(key);
   have_preliminary_key_ = true;
@@ -131,9 +132,10 @@
     prefix_size -= sizeof(QuicPacketNumber);
   }
   DiversifyPreliminaryKey(
-      QuicStringPiece(reinterpret_cast<const char*>(key_), key_size_),
-      QuicStringPiece(reinterpret_cast<const char*>(iv_), prefix_size), nonce,
-      key_size_, prefix_size, &key, &nonce_prefix);
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(key_), key_size_),
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(iv_),
+                                prefix_size),
+      nonce, key_size_, prefix_size, &key, &nonce_prefix);
 
   if (!SetKey(key) ||
       (!use_ietf_nonce_construction_ && !SetNoncePrefix(nonce_prefix)) ||
@@ -147,8 +149,8 @@
 }
 
 bool AeadBaseDecrypter::DecryptPacket(uint64_t packet_number,
-                                      QuicStringPiece associated_data,
-                                      QuicStringPiece ciphertext,
+                                      quiche::QuicheStringPiece associated_data,
+                                      quiche::QuicheStringPiece ciphertext,
                                       char* output,
                                       size_t* output_length,
                                       size_t max_output_length) {
@@ -199,13 +201,14 @@
   return nonce_size_;
 }
 
-QuicStringPiece AeadBaseDecrypter::GetKey() const {
-  return QuicStringPiece(reinterpret_cast<const char*>(key_), key_size_);
+quiche::QuicheStringPiece AeadBaseDecrypter::GetKey() const {
+  return quiche::QuicheStringPiece(reinterpret_cast<const char*>(key_),
+                                   key_size_);
 }
 
-QuicStringPiece AeadBaseDecrypter::GetNoncePrefix() const {
-  return QuicStringPiece(reinterpret_cast<const char*>(iv_),
-                         nonce_size_ - sizeof(QuicPacketNumber));
+quiche::QuicheStringPiece AeadBaseDecrypter::GetNoncePrefix() const {
+  return quiche::QuicheStringPiece(reinterpret_cast<const char*>(iv_),
+                                   nonce_size_ - sizeof(QuicPacketNumber));
 }
 
 }  // namespace quic
diff --git a/quic/core/crypto/aead_base_decrypter.h b/quic/core/crypto/aead_base_decrypter.h
index f0c5b01..e69b0ed 100644
--- a/quic/core/crypto/aead_base_decrypter.h
+++ b/quic/core/crypto/aead_base_decrypter.h
@@ -10,7 +10,7 @@
 #include "third_party/boringssl/src/include/openssl/aead.h"
 #include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -29,22 +29,22 @@
   ~AeadBaseDecrypter() override;
 
   // QuicDecrypter implementation
-  bool SetKey(QuicStringPiece key) override;
-  bool SetNoncePrefix(QuicStringPiece nonce_prefix) override;
-  bool SetIV(QuicStringPiece iv) override;
-  bool SetPreliminaryKey(QuicStringPiece key) override;
+  bool SetKey(quiche::QuicheStringPiece key) override;
+  bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
+  bool SetIV(quiche::QuicheStringPiece iv) override;
+  bool SetPreliminaryKey(quiche::QuicheStringPiece key) override;
   bool SetDiversificationNonce(const DiversificationNonce& nonce) override;
   bool DecryptPacket(uint64_t packet_number,
-                     QuicStringPiece associated_data,
-                     QuicStringPiece ciphertext,
+                     quiche::QuicheStringPiece associated_data,
+                     quiche::QuicheStringPiece ciphertext,
                      char* output,
                      size_t* output_length,
                      size_t max_output_length) override;
   size_t GetKeySize() const override;
   size_t GetNoncePrefixSize() const override;
   size_t GetIVSize() const override;
-  QuicStringPiece GetKey() const override;
-  QuicStringPiece GetNoncePrefix() const override;
+  quiche::QuicheStringPiece GetKey() const override;
+  quiche::QuicheStringPiece GetNoncePrefix() const override;
 
  protected:
   // Make these constants available to the subclasses so that the subclasses
diff --git a/quic/core/crypto/aead_base_encrypter.cc b/quic/core/crypto/aead_base_encrypter.cc
index a3173f5..b794e7e 100644
--- a/quic/core/crypto/aead_base_encrypter.cc
+++ b/quic/core/crypto/aead_base_encrypter.cc
@@ -12,6 +12,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -58,7 +59,7 @@
 
 AeadBaseEncrypter::~AeadBaseEncrypter() {}
 
-bool AeadBaseEncrypter::SetKey(QuicStringPiece key) {
+bool AeadBaseEncrypter::SetKey(quiche::QuicheStringPiece key) {
   DCHECK_EQ(key.size(), key_size_);
   if (key.size() != key_size_) {
     return false;
@@ -76,7 +77,7 @@
   return true;
 }
 
-bool AeadBaseEncrypter::SetNoncePrefix(QuicStringPiece nonce_prefix) {
+bool AeadBaseEncrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
   if (use_ietf_nonce_construction_) {
     QUIC_BUG << "Attempted to set nonce prefix on IETF QUIC crypter";
     return false;
@@ -89,7 +90,7 @@
   return true;
 }
 
-bool AeadBaseEncrypter::SetIV(QuicStringPiece iv) {
+bool AeadBaseEncrypter::SetIV(quiche::QuicheStringPiece iv) {
   if (!use_ietf_nonce_construction_) {
     QUIC_BUG << "Attempted to set IV on Google QUIC crypter";
     return false;
@@ -102,9 +103,9 @@
   return true;
 }
 
-bool AeadBaseEncrypter::Encrypt(QuicStringPiece nonce,
-                                QuicStringPiece associated_data,
-                                QuicStringPiece plaintext,
+bool AeadBaseEncrypter::Encrypt(quiche::QuicheStringPiece nonce,
+                                quiche::QuicheStringPiece associated_data,
+                                quiche::QuicheStringPiece plaintext,
                                 unsigned char* output) {
   DCHECK_EQ(nonce.size(), nonce_size_);
 
@@ -124,8 +125,8 @@
 }
 
 bool AeadBaseEncrypter::EncryptPacket(uint64_t packet_number,
-                                      QuicStringPiece associated_data,
-                                      QuicStringPiece plaintext,
+                                      quiche::QuicheStringPiece associated_data,
+                                      quiche::QuicheStringPiece plaintext,
                                       char* output,
                                       size_t* output_length,
                                       size_t max_output_length) {
@@ -147,8 +148,9 @@
     memcpy(nonce_buffer + prefix_len, &packet_number, sizeof(packet_number));
   }
 
-  if (!Encrypt(QuicStringPiece(nonce_buffer, nonce_size_), associated_data,
-               plaintext, reinterpret_cast<unsigned char*>(output))) {
+  if (!Encrypt(quiche::QuicheStringPiece(nonce_buffer, nonce_size_),
+               associated_data, plaintext,
+               reinterpret_cast<unsigned char*>(output))) {
     return false;
   }
   *output_length = ciphertext_size;
@@ -175,13 +177,14 @@
   return plaintext_size + auth_tag_size_;
 }
 
-QuicStringPiece AeadBaseEncrypter::GetKey() const {
-  return QuicStringPiece(reinterpret_cast<const char*>(key_), key_size_);
+quiche::QuicheStringPiece AeadBaseEncrypter::GetKey() const {
+  return quiche::QuicheStringPiece(reinterpret_cast<const char*>(key_),
+                                   key_size_);
 }
 
-QuicStringPiece AeadBaseEncrypter::GetNoncePrefix() const {
-  return QuicStringPiece(reinterpret_cast<const char*>(iv_),
-                         GetNoncePrefixSize());
+quiche::QuicheStringPiece AeadBaseEncrypter::GetNoncePrefix() const {
+  return quiche::QuicheStringPiece(reinterpret_cast<const char*>(iv_),
+                                   GetNoncePrefixSize());
 }
 
 }  // namespace quic
diff --git a/quic/core/crypto/aead_base_encrypter.h b/quic/core/crypto/aead_base_encrypter.h
index 51ac8e3..5209a02 100644
--- a/quic/core/crypto/aead_base_encrypter.h
+++ b/quic/core/crypto/aead_base_encrypter.h
@@ -10,7 +10,7 @@
 #include "third_party/boringssl/src/include/openssl/aead.h"
 #include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -29,12 +29,12 @@
   ~AeadBaseEncrypter() override;
 
   // QuicEncrypter implementation
-  bool SetKey(QuicStringPiece key) override;
-  bool SetNoncePrefix(QuicStringPiece nonce_prefix) override;
-  bool SetIV(QuicStringPiece iv) override;
+  bool SetKey(quiche::QuicheStringPiece key) override;
+  bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
+  bool SetIV(quiche::QuicheStringPiece iv) override;
   bool EncryptPacket(uint64_t packet_number,
-                     QuicStringPiece associated_data,
-                     QuicStringPiece plaintext,
+                     quiche::QuicheStringPiece associated_data,
+                     quiche::QuicheStringPiece plaintext,
                      char* output,
                      size_t* output_length,
                      size_t max_output_length) override;
@@ -43,14 +43,14 @@
   size_t GetIVSize() const override;
   size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
   size_t GetCiphertextSize(size_t plaintext_size) const override;
-  QuicStringPiece GetKey() const override;
-  QuicStringPiece GetNoncePrefix() const override;
+  quiche::QuicheStringPiece GetKey() const override;
+  quiche::QuicheStringPiece GetNoncePrefix() const override;
 
   // Necessary so unit tests can explicitly specify a nonce, instead of an IV
   // (or nonce prefix) and packet number.
-  bool Encrypt(QuicStringPiece nonce,
-               QuicStringPiece associated_data,
-               QuicStringPiece plaintext,
+  bool Encrypt(quiche::QuicheStringPiece nonce,
+               quiche::QuicheStringPiece associated_data,
+               quiche::QuicheStringPiece plaintext,
                unsigned char* output);
 
  protected:
diff --git a/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc b/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
index 9ce4bda..130ebd0 100644
--- a/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
+++ b/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
@@ -10,8 +10,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -200,12 +201,12 @@
 // DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the plaintext.
 QuicData* DecryptWithNonce(Aes128Gcm12Decrypter* decrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece ciphertext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece ciphertext) {
   uint64_t packet_number;
-  QuicStringPiece nonce_prefix(nonce.data(),
-                               nonce.size() - sizeof(packet_number));
+  quiche::QuicheStringPiece nonce_prefix(nonce.data(),
+                                         nonce.size() - sizeof(packet_number));
   decrypter->SetNoncePrefix(nonce_prefix);
   memcpy(&packet_number, nonce.data() + nonce_prefix.size(),
          sizeof(packet_number));
@@ -232,14 +233,14 @@
       bool has_pt = test_vectors[j].pt;
 
       // Decode the test vector.
-      std::string key = QuicTextUtils::HexDecode(test_vectors[j].key);
-      std::string iv = QuicTextUtils::HexDecode(test_vectors[j].iv);
-      std::string ct = QuicTextUtils::HexDecode(test_vectors[j].ct);
-      std::string aad = QuicTextUtils::HexDecode(test_vectors[j].aad);
-      std::string tag = QuicTextUtils::HexDecode(test_vectors[j].tag);
+      std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
+      std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
+      std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
+      std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
+      std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
       std::string pt;
       if (has_pt) {
-        pt = QuicTextUtils::HexDecode(test_vectors[j].pt);
+        pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
       }
 
       // The test vector's lengths should look sane. Note that the lengths
@@ -263,12 +264,12 @@
       Aes128Gcm12Decrypter decrypter;
       ASSERT_TRUE(decrypter.SetKey(key));
 
-      std::unique_ptr<QuicData> decrypted(
-          DecryptWithNonce(&decrypter, iv,
-                           // This deliberately tests that the decrypter can
-                           // handle an AAD that is set to nullptr, as opposed
-                           // to a zero-length, non-nullptr pointer.
-                           aad.length() ? aad : QuicStringPiece(), ciphertext));
+      std::unique_ptr<QuicData> decrypted(DecryptWithNonce(
+          &decrypter, iv,
+          // This deliberately tests that the decrypter can
+          // handle an AAD that is set to nullptr, as opposed
+          // to a zero-length, non-nullptr pointer.
+          aad.length() ? aad : quiche::QuicheStringPiece(), ciphertext));
       if (!decrypted) {
         EXPECT_FALSE(has_pt);
         continue;
diff --git a/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc b/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc
index d529d5d..0ca6b18 100644
--- a/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc
+++ b/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc
@@ -10,8 +10,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -158,9 +159,9 @@
 // EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the ciphertext.
 QuicData* EncryptWithNonce(Aes128Gcm12Encrypter* encrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece plaintext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece plaintext) {
   size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
   std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
 
@@ -181,12 +182,12 @@
     const TestGroupInfo& test_info = test_group_info[i];
     for (size_t j = 0; test_vectors[j].key != nullptr; j++) {
       // Decode the test vector.
-      std::string key = QuicTextUtils::HexDecode(test_vectors[j].key);
-      std::string iv = QuicTextUtils::HexDecode(test_vectors[j].iv);
-      std::string pt = QuicTextUtils::HexDecode(test_vectors[j].pt);
-      std::string aad = QuicTextUtils::HexDecode(test_vectors[j].aad);
-      std::string ct = QuicTextUtils::HexDecode(test_vectors[j].ct);
-      std::string tag = QuicTextUtils::HexDecode(test_vectors[j].tag);
+      std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
+      std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
+      std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
+      std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
+      std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
+      std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
 
       // The test vector's lengths should look sane. Note that the lengths
       // in |test_info| are in bits.
@@ -199,12 +200,12 @@
 
       Aes128Gcm12Encrypter encrypter;
       ASSERT_TRUE(encrypter.SetKey(key));
-      std::unique_ptr<QuicData> encrypted(
-          EncryptWithNonce(&encrypter, iv,
-                           // This deliberately tests that the encrypter can
-                           // handle an AAD that is set to nullptr, as opposed
-                           // to a zero-length, non-nullptr pointer.
-                           aad.length() ? aad : QuicStringPiece(), pt));
+      std::unique_ptr<QuicData> encrypted(EncryptWithNonce(
+          &encrypter, iv,
+          // This deliberately tests that the encrypter can
+          // handle an AAD that is set to nullptr, as opposed
+          // to a zero-length, non-nullptr pointer.
+          aad.length() ? aad : quiche::QuicheStringPiece(), pt));
       ASSERT_TRUE(encrypted.get());
 
       // The test vectors have 16 byte authenticators but this code only uses
diff --git a/quic/core/crypto/aes_128_gcm_decrypter_test.cc b/quic/core/crypto/aes_128_gcm_decrypter_test.cc
index 579f76d..3b6ad4d 100644
--- a/quic/core/crypto/aes_128_gcm_decrypter_test.cc
+++ b/quic/core/crypto/aes_128_gcm_decrypter_test.cc
@@ -10,8 +10,8 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -200,9 +200,9 @@
 // DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the plaintext.
 QuicData* DecryptWithNonce(Aes128GcmDecrypter* decrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece ciphertext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece ciphertext) {
   decrypter->SetIV(nonce);
   std::unique_ptr<char[]> output(new char[ciphertext.length()]);
   size_t output_length = 0;
@@ -227,14 +227,14 @@
       bool has_pt = test_vectors[j].pt;
 
       // Decode the test vector.
-      std::string key = QuicTextUtils::HexDecode(test_vectors[j].key);
-      std::string iv = QuicTextUtils::HexDecode(test_vectors[j].iv);
-      std::string ct = QuicTextUtils::HexDecode(test_vectors[j].ct);
-      std::string aad = QuicTextUtils::HexDecode(test_vectors[j].aad);
-      std::string tag = QuicTextUtils::HexDecode(test_vectors[j].tag);
+      std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
+      std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
+      std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
+      std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
+      std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
       std::string pt;
       if (has_pt) {
-        pt = QuicTextUtils::HexDecode(test_vectors[j].pt);
+        pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
       }
 
       // The test vector's lengths should look sane. Note that the lengths
@@ -252,12 +252,12 @@
       Aes128GcmDecrypter decrypter;
       ASSERT_TRUE(decrypter.SetKey(key));
 
-      std::unique_ptr<QuicData> decrypted(
-          DecryptWithNonce(&decrypter, iv,
-                           // This deliberately tests that the decrypter can
-                           // handle an AAD that is set to nullptr, as opposed
-                           // to a zero-length, non-nullptr pointer.
-                           aad.length() ? aad : QuicStringPiece(), ciphertext));
+      std::unique_ptr<QuicData> decrypted(DecryptWithNonce(
+          &decrypter, iv,
+          // This deliberately tests that the decrypter can
+          // handle an AAD that is set to nullptr, as opposed
+          // to a zero-length, non-nullptr pointer.
+          aad.length() ? aad : quiche::QuicheStringPiece(), ciphertext));
       if (!decrypted) {
         EXPECT_FALSE(has_pt);
         continue;
@@ -274,14 +274,14 @@
 TEST_F(Aes128GcmDecrypterTest, GenerateHeaderProtectionMask) {
   Aes128GcmDecrypter decrypter;
   std::string key =
-      QuicTextUtils::HexDecode("d9132370cb18476ab833649cf080d970");
+      quiche::QuicheTextUtils::HexDecode("d9132370cb18476ab833649cf080d970");
   std::string sample =
-      QuicTextUtils::HexDecode("d1d7998068517adb769b48b924a32c47");
+      quiche::QuicheTextUtils::HexDecode("d1d7998068517adb769b48b924a32c47");
   QuicDataReader sample_reader(sample.data(), sample.size());
   ASSERT_TRUE(decrypter.SetHeaderProtectionKey(key));
   std::string mask = decrypter.GenerateHeaderProtectionMask(&sample_reader);
   std::string expected_mask =
-      QuicTextUtils::HexDecode("b132c37d6164da4ea4dc9b763aceec27");
+      quiche::QuicheTextUtils::HexDecode("b132c37d6164da4ea4dc9b763aceec27");
   test::CompareCharArraysWithHexError("header protection mask", mask.data(),
                                       mask.size(), expected_mask.data(),
                                       expected_mask.size());
diff --git a/quic/core/crypto/aes_128_gcm_encrypter_test.cc b/quic/core/crypto/aes_128_gcm_encrypter_test.cc
index c557e11..8e48bfd 100644
--- a/quic/core/crypto/aes_128_gcm_encrypter_test.cc
+++ b/quic/core/crypto/aes_128_gcm_encrypter_test.cc
@@ -10,8 +10,8 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -158,9 +158,9 @@
 // EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the ciphertext.
 QuicData* EncryptWithNonce(Aes128GcmEncrypter* encrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece plaintext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece plaintext) {
   size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
   std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
 
@@ -181,12 +181,12 @@
     const TestGroupInfo& test_info = test_group_info[i];
     for (size_t j = 0; test_vectors[j].key != nullptr; j++) {
       // Decode the test vector.
-      std::string key = QuicTextUtils::HexDecode(test_vectors[j].key);
-      std::string iv = QuicTextUtils::HexDecode(test_vectors[j].iv);
-      std::string pt = QuicTextUtils::HexDecode(test_vectors[j].pt);
-      std::string aad = QuicTextUtils::HexDecode(test_vectors[j].aad);
-      std::string ct = QuicTextUtils::HexDecode(test_vectors[j].ct);
-      std::string tag = QuicTextUtils::HexDecode(test_vectors[j].tag);
+      std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
+      std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
+      std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
+      std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
+      std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
+      std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
 
       // The test vector's lengths should look sane. Note that the lengths
       // in |test_info| are in bits.
@@ -199,12 +199,12 @@
 
       Aes128GcmEncrypter encrypter;
       ASSERT_TRUE(encrypter.SetKey(key));
-      std::unique_ptr<QuicData> encrypted(
-          EncryptWithNonce(&encrypter, iv,
-                           // This deliberately tests that the encrypter can
-                           // handle an AAD that is set to nullptr, as opposed
-                           // to a zero-length, non-nullptr pointer.
-                           aad.length() ? aad : QuicStringPiece(), pt));
+      std::unique_ptr<QuicData> encrypted(EncryptWithNonce(
+          &encrypter, iv,
+          // This deliberately tests that the encrypter can
+          // handle an AAD that is set to nullptr, as opposed
+          // to a zero-length, non-nullptr pointer.
+          aad.length() ? aad : quiche::QuicheStringPiece(), pt));
       ASSERT_TRUE(encrypted.get());
 
       ASSERT_EQ(ct.length() + tag.length(), encrypted->length());
@@ -219,13 +219,15 @@
 
 TEST_F(Aes128GcmEncrypterTest, EncryptPacket) {
   std::string key =
-      QuicTextUtils::HexDecode("d95a145250826c25a77b6a84fd4d34fc");
-  std::string iv = QuicTextUtils::HexDecode("50c4431ebb18283448e276e2");
+      quiche::QuicheTextUtils::HexDecode("d95a145250826c25a77b6a84fd4d34fc");
+  std::string iv =
+      quiche::QuicheTextUtils::HexDecode("50c4431ebb18283448e276e2");
   uint64_t packet_num = 0x13278f44;
   std::string aad =
-      QuicTextUtils::HexDecode("875d49f64a70c9cbe713278f44ff000005");
-  std::string pt = QuicTextUtils::HexDecode("aa0003a250bd000000000001");
-  std::string ct = QuicTextUtils::HexDecode(
+      quiche::QuicheTextUtils::HexDecode("875d49f64a70c9cbe713278f44ff000005");
+  std::string pt =
+      quiche::QuicheTextUtils::HexDecode("aa0003a250bd000000000001");
+  std::string ct = quiche::QuicheTextUtils::HexDecode(
       "7dd4708b989ee7d38a013e3656e9b37beefd05808fe1ab41e3b4f2c0");
 
   std::vector<char> out(ct.size());
@@ -258,13 +260,13 @@
 TEST_F(Aes128GcmEncrypterTest, GenerateHeaderProtectionMask) {
   Aes128GcmEncrypter encrypter;
   std::string key =
-      QuicTextUtils::HexDecode("d9132370cb18476ab833649cf080d970");
+      quiche::QuicheTextUtils::HexDecode("d9132370cb18476ab833649cf080d970");
   std::string sample =
-      QuicTextUtils::HexDecode("d1d7998068517adb769b48b924a32c47");
+      quiche::QuicheTextUtils::HexDecode("d1d7998068517adb769b48b924a32c47");
   ASSERT_TRUE(encrypter.SetHeaderProtectionKey(key));
   std::string mask = encrypter.GenerateHeaderProtectionMask(sample);
   std::string expected_mask =
-      QuicTextUtils::HexDecode("b132c37d6164da4ea4dc9b763aceec27");
+      quiche::QuicheTextUtils::HexDecode("b132c37d6164da4ea4dc9b763aceec27");
   test::CompareCharArraysWithHexError("header protection mask", mask.data(),
                                       mask.size(), expected_mask.data(),
                                       expected_mask.size());
diff --git a/quic/core/crypto/aes_256_gcm_decrypter_test.cc b/quic/core/crypto/aes_256_gcm_decrypter_test.cc
index b3d61c7..f59a532 100644
--- a/quic/core/crypto/aes_256_gcm_decrypter_test.cc
+++ b/quic/core/crypto/aes_256_gcm_decrypter_test.cc
@@ -10,8 +10,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -204,9 +205,9 @@
 // DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the plaintext.
 QuicData* DecryptWithNonce(Aes256GcmDecrypter* decrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece ciphertext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece ciphertext) {
   decrypter->SetIV(nonce);
   std::unique_ptr<char[]> output(new char[ciphertext.length()]);
   size_t output_length = 0;
@@ -231,14 +232,14 @@
       bool has_pt = test_vectors[j].pt;
 
       // Decode the test vector.
-      std::string key = QuicTextUtils::HexDecode(test_vectors[j].key);
-      std::string iv = QuicTextUtils::HexDecode(test_vectors[j].iv);
-      std::string ct = QuicTextUtils::HexDecode(test_vectors[j].ct);
-      std::string aad = QuicTextUtils::HexDecode(test_vectors[j].aad);
-      std::string tag = QuicTextUtils::HexDecode(test_vectors[j].tag);
+      std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
+      std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
+      std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
+      std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
+      std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
       std::string pt;
       if (has_pt) {
-        pt = QuicTextUtils::HexDecode(test_vectors[j].pt);
+        pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
       }
 
       // The test vector's lengths should look sane. Note that the lengths
@@ -256,12 +257,12 @@
       Aes256GcmDecrypter decrypter;
       ASSERT_TRUE(decrypter.SetKey(key));
 
-      std::unique_ptr<QuicData> decrypted(
-          DecryptWithNonce(&decrypter, iv,
-                           // This deliberately tests that the decrypter can
-                           // handle an AAD that is set to nullptr, as opposed
-                           // to a zero-length, non-nullptr pointer.
-                           aad.length() ? aad : QuicStringPiece(), ciphertext));
+      std::unique_ptr<QuicData> decrypted(DecryptWithNonce(
+          &decrypter, iv,
+          // This deliberately tests that the decrypter can
+          // handle an AAD that is set to nullptr, as opposed
+          // to a zero-length, non-nullptr pointer.
+          aad.length() ? aad : quiche::QuicheStringPiece(), ciphertext));
       if (!decrypted) {
         EXPECT_FALSE(has_pt);
         continue;
@@ -277,15 +278,15 @@
 
 TEST_F(Aes256GcmDecrypterTest, GenerateHeaderProtectionMask) {
   Aes256GcmDecrypter decrypter;
-  std::string key = QuicTextUtils::HexDecode(
+  std::string key = quiche::QuicheTextUtils::HexDecode(
       "ed23ecbf54d426def5c52c3dcfc84434e62e57781d3125bb21ed91b7d3e07788");
   std::string sample =
-      QuicTextUtils::HexDecode("4d190c474be2b8babafb49ec4e38e810");
+      quiche::QuicheTextUtils::HexDecode("4d190c474be2b8babafb49ec4e38e810");
   QuicDataReader sample_reader(sample.data(), sample.size());
   ASSERT_TRUE(decrypter.SetHeaderProtectionKey(key));
   std::string mask = decrypter.GenerateHeaderProtectionMask(&sample_reader);
   std::string expected_mask =
-      QuicTextUtils::HexDecode("db9ed4e6ccd033af2eae01407199c56e");
+      quiche::QuicheTextUtils::HexDecode("db9ed4e6ccd033af2eae01407199c56e");
   test::CompareCharArraysWithHexError("header protection mask", mask.data(),
                                       mask.size(), expected_mask.data(),
                                       expected_mask.size());
diff --git a/quic/core/crypto/aes_256_gcm_encrypter_test.cc b/quic/core/crypto/aes_256_gcm_encrypter_test.cc
index 03f6b75..5136424 100644
--- a/quic/core/crypto/aes_256_gcm_encrypter_test.cc
+++ b/quic/core/crypto/aes_256_gcm_encrypter_test.cc
@@ -10,8 +10,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -165,9 +166,9 @@
 // EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the ciphertext.
 QuicData* EncryptWithNonce(Aes256GcmEncrypter* encrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece plaintext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece plaintext) {
   size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
   std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
 
@@ -188,12 +189,12 @@
     const TestGroupInfo& test_info = test_group_info[i];
     for (size_t j = 0; test_vectors[j].key != nullptr; j++) {
       // Decode the test vector.
-      std::string key = QuicTextUtils::HexDecode(test_vectors[j].key);
-      std::string iv = QuicTextUtils::HexDecode(test_vectors[j].iv);
-      std::string pt = QuicTextUtils::HexDecode(test_vectors[j].pt);
-      std::string aad = QuicTextUtils::HexDecode(test_vectors[j].aad);
-      std::string ct = QuicTextUtils::HexDecode(test_vectors[j].ct);
-      std::string tag = QuicTextUtils::HexDecode(test_vectors[j].tag);
+      std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
+      std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
+      std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
+      std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
+      std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
+      std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
 
       // The test vector's lengths should look sane. Note that the lengths
       // in |test_info| are in bits.
@@ -206,12 +207,12 @@
 
       Aes256GcmEncrypter encrypter;
       ASSERT_TRUE(encrypter.SetKey(key));
-      std::unique_ptr<QuicData> encrypted(
-          EncryptWithNonce(&encrypter, iv,
-                           // This deliberately tests that the encrypter can
-                           // handle an AAD that is set to nullptr, as opposed
-                           // to a zero-length, non-nullptr pointer.
-                           aad.length() ? aad : QuicStringPiece(), pt));
+      std::unique_ptr<QuicData> encrypted(EncryptWithNonce(
+          &encrypter, iv,
+          // This deliberately tests that the encrypter can
+          // handle an AAD that is set to nullptr, as opposed
+          // to a zero-length, non-nullptr pointer.
+          aad.length() ? aad : quiche::QuicheStringPiece(), pt));
       ASSERT_TRUE(encrypted.get());
 
       ASSERT_EQ(ct.length() + tag.length(), encrypted->length());
@@ -240,14 +241,14 @@
 
 TEST_F(Aes256GcmEncrypterTest, GenerateHeaderProtectionMask) {
   Aes256GcmEncrypter encrypter;
-  std::string key = QuicTextUtils::HexDecode(
+  std::string key = quiche::QuicheTextUtils::HexDecode(
       "ed23ecbf54d426def5c52c3dcfc84434e62e57781d3125bb21ed91b7d3e07788");
   std::string sample =
-      QuicTextUtils::HexDecode("4d190c474be2b8babafb49ec4e38e810");
+      quiche::QuicheTextUtils::HexDecode("4d190c474be2b8babafb49ec4e38e810");
   ASSERT_TRUE(encrypter.SetHeaderProtectionKey(key));
   std::string mask = encrypter.GenerateHeaderProtectionMask(sample);
   std::string expected_mask =
-      QuicTextUtils::HexDecode("db9ed4e6ccd033af2eae01407199c56e");
+      quiche::QuicheTextUtils::HexDecode("db9ed4e6ccd033af2eae01407199c56e");
   test::CompareCharArraysWithHexError("header protection mask", mask.data(),
                                       mask.size(), expected_mask.data(),
                                       expected_mask.size());
diff --git a/quic/core/crypto/aes_base_decrypter.cc b/quic/core/crypto/aes_base_decrypter.cc
index 6888ab2..f8c83f3 100644
--- a/quic/core/crypto/aes_base_decrypter.cc
+++ b/quic/core/crypto/aes_base_decrypter.cc
@@ -6,10 +6,11 @@
 
 #include "third_party/boringssl/src/include/openssl/aes.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
-bool AesBaseDecrypter::SetHeaderProtectionKey(QuicStringPiece key) {
+bool AesBaseDecrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
   if (key.size() != GetKeySize()) {
     QUIC_BUG << "Invalid key size for header protection";
     return false;
@@ -24,7 +25,7 @@
 
 std::string AesBaseDecrypter::GenerateHeaderProtectionMask(
     QuicDataReader* sample_reader) {
-  QuicStringPiece sample;
+  quiche::QuicheStringPiece sample;
   if (!sample_reader->ReadStringPiece(&sample, AES_BLOCK_SIZE)) {
     return std::string();
   }
diff --git a/quic/core/crypto/aes_base_decrypter.h b/quic/core/crypto/aes_base_decrypter.h
index e8e1cc8..2ff63a7 100644
--- a/quic/core/crypto/aes_base_decrypter.h
+++ b/quic/core/crypto/aes_base_decrypter.h
@@ -10,7 +10,7 @@
 #include "third_party/boringssl/src/include/openssl/aes.h"
 #include "net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -18,7 +18,7 @@
  public:
   using AeadBaseDecrypter::AeadBaseDecrypter;
 
-  bool SetHeaderProtectionKey(QuicStringPiece key) override;
+  bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
   std::string GenerateHeaderProtectionMask(
       QuicDataReader* sample_reader) override;
 
diff --git a/quic/core/crypto/aes_base_encrypter.cc b/quic/core/crypto/aes_base_encrypter.cc
index cdb21b8..c620329 100644
--- a/quic/core/crypto/aes_base_encrypter.cc
+++ b/quic/core/crypto/aes_base_encrypter.cc
@@ -6,10 +6,11 @@
 
 #include "third_party/boringssl/src/include/openssl/aes.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
-bool AesBaseEncrypter::SetHeaderProtectionKey(QuicStringPiece key) {
+bool AesBaseEncrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
   if (key.size() != GetKeySize()) {
     QUIC_BUG << "Invalid key size for header protection: " << key.size();
     return false;
@@ -23,7 +24,7 @@
 }
 
 std::string AesBaseEncrypter::GenerateHeaderProtectionMask(
-    QuicStringPiece sample) {
+    quiche::QuicheStringPiece sample) {
   if (sample.size() != AES_BLOCK_SIZE) {
     return std::string();
   }
diff --git a/quic/core/crypto/aes_base_encrypter.h b/quic/core/crypto/aes_base_encrypter.h
index e115eba..ba518fe 100644
--- a/quic/core/crypto/aes_base_encrypter.h
+++ b/quic/core/crypto/aes_base_encrypter.h
@@ -10,7 +10,7 @@
 #include "third_party/boringssl/src/include/openssl/aes.h"
 #include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -18,8 +18,9 @@
  public:
   using AeadBaseEncrypter::AeadBaseEncrypter;
 
-  bool SetHeaderProtectionKey(QuicStringPiece key) override;
-  std::string GenerateHeaderProtectionMask(QuicStringPiece sample) override;
+  bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
+  std::string GenerateHeaderProtectionMask(
+      quiche::QuicheStringPiece sample) override;
 
  private:
   // The key used for packet number encryption.
diff --git a/quic/core/crypto/cert_compressor.cc b/quic/core/crypto/cert_compressor.cc
index 45d842d..a1ba748 100644
--- a/quic/core/crypto/cert_compressor.cc
+++ b/quic/core/crypto/cert_compressor.cc
@@ -10,6 +10,7 @@
 #include <utility>
 
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 #include "third_party/zlib/zlib.h"
 
 namespace quic {
@@ -174,10 +175,11 @@
 // efficiently represent |certs| to a peer who has the common sets identified
 // by |client_common_set_hashes| and who has cached the certificates with the
 // 64-bit, FNV-1a hashes in |client_cached_cert_hashes|.
-std::vector<CertEntry> MatchCerts(const std::vector<std::string>& certs,
-                                  QuicStringPiece client_common_set_hashes,
-                                  QuicStringPiece client_cached_cert_hashes,
-                                  const CommonCertSets* common_sets) {
+std::vector<CertEntry> MatchCerts(
+    const std::vector<std::string>& certs,
+    quiche::QuicheStringPiece client_common_set_hashes,
+    quiche::QuicheStringPiece client_cached_cert_hashes,
+    const CommonCertSets* common_sets) {
   std::vector<CertEntry> entries;
   entries.reserve(certs.size());
 
@@ -328,12 +330,12 @@
 // |in_out| and writes them to |out_entries|. CACHED and COMMON entries are
 // resolved using |cached_certs| and |common_sets| and written to |out_certs|.
 // |in_out| is updated to contain the trailing data.
-bool ParseEntries(QuicStringPiece* in_out,
+bool ParseEntries(quiche::QuicheStringPiece* in_out,
                   const std::vector<std::string>& cached_certs,
                   const CommonCertSets* common_sets,
                   std::vector<CertEntry>* out_entries,
                   std::vector<std::string>* out_certs) {
-  QuicStringPiece in = *in_out;
+  quiche::QuicheStringPiece in = *in_out;
   std::vector<uint64_t> cached_hashes;
 
   out_entries->clear();
@@ -392,7 +394,7 @@
         memcpy(&entry.index, in.data(), sizeof(uint32_t));
         in.remove_prefix(sizeof(uint32_t));
 
-        QuicStringPiece cert =
+        quiche::QuicheStringPiece cert =
             common_sets->GetCert(entry.set_hash, entry.index);
         if (cert.empty()) {
           return false;
@@ -450,8 +452,8 @@
 // static
 std::string CertCompressor::CompressChain(
     const std::vector<std::string>& certs,
-    QuicStringPiece client_common_set_hashes,
-    QuicStringPiece client_cached_cert_hashes,
+    quiche::QuicheStringPiece client_common_set_hashes,
+    quiche::QuicheStringPiece client_cached_cert_hashes,
     const CommonCertSets* common_sets) {
   const std::vector<CertEntry> entries = MatchCerts(
       certs, client_common_set_hashes, client_cached_cert_hashes, common_sets);
@@ -551,7 +553,7 @@
 
 // static
 bool CertCompressor::DecompressChain(
-    QuicStringPiece in,
+    quiche::QuicheStringPiece in,
     const std::vector<std::string>& cached_certs,
     const CommonCertSets* common_sets,
     std::vector<std::string>* out_certs) {
@@ -562,7 +564,7 @@
   DCHECK_EQ(entries.size(), out_certs->size());
 
   std::unique_ptr<uint8_t[]> uncompressed_data;
-  QuicStringPiece uncompressed;
+  quiche::QuicheStringPiece uncompressed;
 
   if (!in.empty()) {
     if (in.size() < sizeof(uint32_t)) {
@@ -607,7 +609,7 @@
       return false;
     }
 
-    uncompressed = QuicStringPiece(
+    uncompressed = quiche::QuicheStringPiece(
         reinterpret_cast<char*>(uncompressed_data.get()), uncompressed_size);
   }
 
diff --git a/quic/core/crypto/cert_compressor.h b/quic/core/crypto/cert_compressor.h
index ca696bd..dfb4d21 100644
--- a/quic/core/crypto/cert_compressor.h
+++ b/quic/core/crypto/cert_compressor.h
@@ -11,7 +11,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/common_cert_set.h"
 #include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -36,16 +36,17 @@
   // sets known locally and |client_common_set_hashes| contains the hashes of
   // the common sets known to the peer. |client_cached_cert_hashes| contains
   // 64-bit, FNV-1a hashes of certificates that the peer already possesses.
-  static std::string CompressChain(const std::vector<std::string>& certs,
-                                   QuicStringPiece client_common_set_hashes,
-                                   QuicStringPiece client_cached_cert_hashes,
-                                   const CommonCertSets* common_sets);
+  static std::string CompressChain(
+      const std::vector<std::string>& certs,
+      quiche::QuicheStringPiece client_common_set_hashes,
+      quiche::QuicheStringPiece client_cached_cert_hashes,
+      const CommonCertSets* common_sets);
 
   // DecompressChain decompresses the result of |CompressChain|, given in |in|,
   // into a series of certificates that are written to |out_certs|.
   // |cached_certs| contains certificates that the peer may have omitted and
   // |common_sets| contains the common certificate sets known locally.
-  static bool DecompressChain(QuicStringPiece in,
+  static bool DecompressChain(quiche::QuicheStringPiece in,
                               const std::vector<std::string>& cached_certs,
                               const CommonCertSets* common_sets,
                               std::vector<std::string>* out_certs);
diff --git a/quic/core/crypto/cert_compressor_test.cc b/quic/core/crypto/cert_compressor_test.cc
index 1341f79..a7517f4 100644
--- a/quic/core/crypto/cert_compressor_test.cc
+++ b/quic/core/crypto/cert_compressor_test.cc
@@ -9,8 +9,9 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 namespace test {
@@ -20,8 +21,8 @@
 TEST_F(CertCompressorTest, EmptyChain) {
   std::vector<std::string> chain;
   const std::string compressed = CertCompressor::CompressChain(
-      chain, QuicStringPiece(), QuicStringPiece(), nullptr);
-  EXPECT_EQ("00", QuicTextUtils::HexEncode(compressed));
+      chain, quiche::QuicheStringPiece(), quiche::QuicheStringPiece(), nullptr);
+  EXPECT_EQ("00", quiche::QuicheTextUtils::HexEncode(compressed));
 
   std::vector<std::string> chain2, cached_certs;
   ASSERT_TRUE(CertCompressor::DecompressChain(compressed, cached_certs, nullptr,
@@ -33,9 +34,10 @@
   std::vector<std::string> chain;
   chain.push_back("testcert");
   const std::string compressed = CertCompressor::CompressChain(
-      chain, QuicStringPiece(), QuicStringPiece(), nullptr);
+      chain, quiche::QuicheStringPiece(), quiche::QuicheStringPiece(), nullptr);
   ASSERT_GE(compressed.size(), 2u);
-  EXPECT_EQ("0100", QuicTextUtils::HexEncode(compressed.substr(0, 2)));
+  EXPECT_EQ("0100",
+            quiche::QuicheTextUtils::HexEncode(compressed.substr(0, 2)));
 
   std::vector<std::string> chain2, cached_certs;
   ASSERT_TRUE(CertCompressor::DecompressChain(compressed, cached_certs, nullptr,
@@ -52,15 +54,15 @@
       crypto_test_utils::MockCommonCertSets(chain[0], set_hash, 1));
   const std::string compressed = CertCompressor::CompressChain(
       chain,
-      QuicStringPiece(reinterpret_cast<const char*>(&set_hash),
-                      sizeof(set_hash)),
-      QuicStringPiece(), common_sets.get());
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(&set_hash),
+                                sizeof(set_hash)),
+      quiche::QuicheStringPiece(), common_sets.get());
   EXPECT_EQ(
       "03"               /* common */
       "2a00000000000000" /* set hash 42 */
       "01000000"         /* index 1 */
       "00" /* end of list */,
-      QuicTextUtils::HexEncode(compressed));
+      quiche::QuicheTextUtils::HexEncode(compressed));
 
   std::vector<std::string> chain2, cached_certs;
   ASSERT_TRUE(CertCompressor::DecompressChain(compressed, cached_certs,
@@ -73,13 +75,14 @@
   std::vector<std::string> chain;
   chain.push_back("testcert");
   uint64_t hash = QuicUtils::FNV1a_64_Hash(chain[0]);
-  QuicStringPiece hash_bytes(reinterpret_cast<char*>(&hash), sizeof(hash));
+  quiche::QuicheStringPiece hash_bytes(reinterpret_cast<char*>(&hash),
+                                       sizeof(hash));
   const std::string compressed = CertCompressor::CompressChain(
-      chain, QuicStringPiece(), hash_bytes, nullptr);
+      chain, quiche::QuicheStringPiece(), hash_bytes, nullptr);
 
-  EXPECT_EQ("02" /* cached */ + QuicTextUtils::HexEncode(hash_bytes) +
+  EXPECT_EQ("02" /* cached */ + quiche::QuicheTextUtils::HexEncode(hash_bytes) +
                 "00" /* end of list */,
-            QuicTextUtils::HexEncode(compressed));
+            quiche::QuicheTextUtils::HexEncode(compressed));
 
   std::vector<std::string> cached_certs, chain2;
   cached_certs.push_back(chain[0]);
@@ -93,26 +96,26 @@
   std::vector<std::string> cached_certs, chain;
 
   EXPECT_FALSE(CertCompressor::DecompressChain(
-      QuicTextUtils::HexEncode("04") /* bad entry type */, cached_certs,
-      nullptr, &chain));
+      quiche::QuicheTextUtils::HexEncode("04") /* bad entry type */,
+      cached_certs, nullptr, &chain));
 
   EXPECT_FALSE(CertCompressor::DecompressChain(
-      QuicTextUtils::HexEncode("01") /* no terminator */, cached_certs, nullptr,
-      &chain));
+      quiche::QuicheTextUtils::HexEncode("01") /* no terminator */,
+      cached_certs, nullptr, &chain));
 
   EXPECT_FALSE(CertCompressor::DecompressChain(
-      QuicTextUtils::HexEncode("0200") /* hash truncated */, cached_certs,
-      nullptr, &chain));
+      quiche::QuicheTextUtils::HexEncode("0200") /* hash truncated */,
+      cached_certs, nullptr, &chain));
 
   EXPECT_FALSE(CertCompressor::DecompressChain(
-      QuicTextUtils::HexEncode("0300") /* hash and index truncated */,
+      quiche::QuicheTextUtils::HexEncode("0300") /* hash and index truncated */,
       cached_certs, nullptr, &chain));
 
   /* without a CommonCertSets */
   EXPECT_FALSE(CertCompressor::DecompressChain(
-      QuicTextUtils::HexEncode("03"
-                               "0000000000000000"
-                               "00000000"),
+      quiche::QuicheTextUtils::HexEncode("03"
+                                         "0000000000000000"
+                                         "00000000"),
       cached_certs, nullptr, &chain));
 
   std::unique_ptr<CommonCertSets> common_sets(
@@ -120,9 +123,9 @@
 
   /* incorrect hash and index */
   EXPECT_FALSE(CertCompressor::DecompressChain(
-      QuicTextUtils::HexEncode("03"
-                               "a200000000000000"
-                               "00000000"),
+      quiche::QuicheTextUtils::HexEncode("03"
+                                         "a200000000000000"
+                                         "00000000"),
       cached_certs, nullptr, &chain));
 }
 
diff --git a/quic/core/crypto/chacha20_poly1305_decrypter_test.cc b/quic/core/crypto/chacha20_poly1305_decrypter_test.cc
index 930af24..7be2251 100644
--- a/quic/core/crypto/chacha20_poly1305_decrypter_test.cc
+++ b/quic/core/crypto/chacha20_poly1305_decrypter_test.cc
@@ -9,8 +9,9 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -113,12 +114,12 @@
 // DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the plaintext.
 QuicData* DecryptWithNonce(ChaCha20Poly1305Decrypter* decrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece ciphertext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece ciphertext) {
   uint64_t packet_number;
-  QuicStringPiece nonce_prefix(nonce.data(),
-                               nonce.size() - sizeof(packet_number));
+  quiche::QuicheStringPiece nonce_prefix(nonce.data(),
+                                         nonce.size() - sizeof(packet_number));
   decrypter->SetNoncePrefix(nonce_prefix);
   memcpy(&packet_number, nonce.data() + nonce_prefix.size(),
          sizeof(packet_number));
@@ -141,14 +142,15 @@
     bool has_pt = test_vectors[i].pt;
 
     // Decode the test vector.
-    std::string key = QuicTextUtils::HexDecode(test_vectors[i].key);
-    std::string iv = QuicTextUtils::HexDecode(test_vectors[i].iv);
-    std::string fixed = QuicTextUtils::HexDecode(test_vectors[i].fixed);
-    std::string aad = QuicTextUtils::HexDecode(test_vectors[i].aad);
-    std::string ct = QuicTextUtils::HexDecode(test_vectors[i].ct);
+    std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
+    std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
+    std::string fixed =
+        quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
+    std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
+    std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
     std::string pt;
     if (has_pt) {
-      pt = QuicTextUtils::HexDecode(test_vectors[i].pt);
+      pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
     }
 
     ChaCha20Poly1305Decrypter decrypter;
@@ -157,7 +159,8 @@
         &decrypter, fixed + iv,
         // This deliberately tests that the decrypter can handle an AAD that
         // is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
-        QuicStringPiece(aad.length() ? aad.data() : nullptr, aad.length()),
+        quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
+                                  aad.length()),
         ct));
     if (!decrypted) {
       EXPECT_FALSE(has_pt);
diff --git a/quic/core/crypto/chacha20_poly1305_encrypter_test.cc b/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
index 4584d96..edb81a4 100644
--- a/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
+++ b/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
@@ -11,8 +11,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -70,9 +71,9 @@
 // EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the ciphertext.
 QuicData* EncryptWithNonce(ChaCha20Poly1305Encrypter* encrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece plaintext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece plaintext) {
   size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
   std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
 
@@ -90,7 +91,7 @@
   ChaCha20Poly1305Encrypter encrypter;
   ChaCha20Poly1305Decrypter decrypter;
 
-  std::string key = QuicTextUtils::HexDecode(test_vectors[0].key);
+  std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[0].key);
   ASSERT_TRUE(encrypter.SetKey(key));
   ASSERT_TRUE(decrypter.SetKey(key));
   ASSERT_TRUE(encrypter.SetNoncePrefix("abcd"));
@@ -104,7 +105,7 @@
   ASSERT_TRUE(encrypter.EncryptPacket(packet_number, associated_data, plaintext,
                                       encrypted, &len,
                                       QUIC_ARRAYSIZE(encrypted)));
-  QuicStringPiece ciphertext(encrypted, len);
+  quiche::QuicheStringPiece ciphertext(encrypted, len);
   char decrypted[1024];
   ASSERT_TRUE(decrypter.DecryptPacket(packet_number, associated_data,
                                       ciphertext, decrypted, &len,
@@ -114,12 +115,13 @@
 TEST_F(ChaCha20Poly1305EncrypterTest, Encrypt) {
   for (size_t i = 0; test_vectors[i].key != nullptr; i++) {
     // Decode the test vector.
-    std::string key = QuicTextUtils::HexDecode(test_vectors[i].key);
-    std::string pt = QuicTextUtils::HexDecode(test_vectors[i].pt);
-    std::string iv = QuicTextUtils::HexDecode(test_vectors[i].iv);
-    std::string fixed = QuicTextUtils::HexDecode(test_vectors[i].fixed);
-    std::string aad = QuicTextUtils::HexDecode(test_vectors[i].aad);
-    std::string ct = QuicTextUtils::HexDecode(test_vectors[i].ct);
+    std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
+    std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
+    std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
+    std::string fixed =
+        quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
+    std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
+    std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
 
     ChaCha20Poly1305Encrypter encrypter;
     ASSERT_TRUE(encrypter.SetKey(key));
@@ -127,7 +129,8 @@
         &encrypter, fixed + iv,
         // This deliberately tests that the encrypter can handle an AAD that
         // is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
-        QuicStringPiece(aad.length() ? aad.data() : nullptr, aad.length()),
+        quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
+                                  aad.length()),
         pt));
     ASSERT_TRUE(encrypted.get());
     EXPECT_EQ(12u, ct.size() - pt.size());
diff --git a/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc b/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc
index 90052d6..d4fcd2b 100644
--- a/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc
+++ b/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc
@@ -9,8 +9,9 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -113,9 +114,9 @@
 // DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the plaintext.
 QuicData* DecryptWithNonce(ChaCha20Poly1305TlsDecrypter* decrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece ciphertext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece ciphertext) {
   decrypter->SetIV(nonce);
   std::unique_ptr<char[]> output(new char[ciphertext.length()]);
   size_t output_length = 0;
@@ -136,14 +137,15 @@
     bool has_pt = test_vectors[i].pt;
 
     // Decode the test vector.
-    std::string key = QuicTextUtils::HexDecode(test_vectors[i].key);
-    std::string iv = QuicTextUtils::HexDecode(test_vectors[i].iv);
-    std::string fixed = QuicTextUtils::HexDecode(test_vectors[i].fixed);
-    std::string aad = QuicTextUtils::HexDecode(test_vectors[i].aad);
-    std::string ct = QuicTextUtils::HexDecode(test_vectors[i].ct);
+    std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
+    std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
+    std::string fixed =
+        quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
+    std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
+    std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
     std::string pt;
     if (has_pt) {
-      pt = QuicTextUtils::HexDecode(test_vectors[i].pt);
+      pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
     }
 
     ChaCha20Poly1305TlsDecrypter decrypter;
@@ -152,7 +154,8 @@
         &decrypter, fixed + iv,
         // This deliberately tests that the decrypter can handle an AAD that
         // is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
-        QuicStringPiece(aad.length() ? aad.data() : nullptr, aad.length()),
+        quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
+                                  aad.length()),
         ct));
     if (!decrypted) {
       EXPECT_FALSE(has_pt);
@@ -169,14 +172,14 @@
 
 TEST_F(ChaCha20Poly1305TlsDecrypterTest, GenerateHeaderProtectionMask) {
   ChaCha20Poly1305TlsDecrypter decrypter;
-  std::string key = QuicTextUtils::HexDecode(
+  std::string key = quiche::QuicheTextUtils::HexDecode(
       "6a067f432787bd6034dd3f08f07fc9703a27e58c70e2d88d948b7f6489923cc7");
   std::string sample =
-      QuicTextUtils::HexDecode("1210d91cceb45c716b023f492c29e612");
+      quiche::QuicheTextUtils::HexDecode("1210d91cceb45c716b023f492c29e612");
   QuicDataReader sample_reader(sample.data(), sample.size());
   ASSERT_TRUE(decrypter.SetHeaderProtectionKey(key));
   std::string mask = decrypter.GenerateHeaderProtectionMask(&sample_reader);
-  std::string expected_mask = QuicTextUtils::HexDecode("1cc2cd98dc");
+  std::string expected_mask = quiche::QuicheTextUtils::HexDecode("1cc2cd98dc");
   test::CompareCharArraysWithHexError("header protection mask", mask.data(),
                                       mask.size(), expected_mask.data(),
                                       expected_mask.size());
diff --git a/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc b/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc
index ef4a8e8..a62c843 100644
--- a/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc
+++ b/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc
@@ -11,8 +11,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace {
 
@@ -70,9 +71,9 @@
 // EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
 // in an nonce and also to allocate the buffer needed for the ciphertext.
 QuicData* EncryptWithNonce(ChaCha20Poly1305TlsEncrypter* encrypter,
-                           QuicStringPiece nonce,
-                           QuicStringPiece associated_data,
-                           QuicStringPiece plaintext) {
+                           quiche::QuicheStringPiece nonce,
+                           quiche::QuicheStringPiece associated_data,
+                           quiche::QuicheStringPiece plaintext) {
   size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
   std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
 
@@ -90,7 +91,7 @@
   ChaCha20Poly1305TlsEncrypter encrypter;
   ChaCha20Poly1305TlsDecrypter decrypter;
 
-  std::string key = QuicTextUtils::HexDecode(test_vectors[0].key);
+  std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[0].key);
   ASSERT_TRUE(encrypter.SetKey(key));
   ASSERT_TRUE(decrypter.SetKey(key));
   ASSERT_TRUE(encrypter.SetIV("abcdefghijkl"));
@@ -104,7 +105,7 @@
   ASSERT_TRUE(encrypter.EncryptPacket(packet_number, associated_data, plaintext,
                                       encrypted, &len,
                                       QUIC_ARRAYSIZE(encrypted)));
-  QuicStringPiece ciphertext(encrypted, len);
+  quiche::QuicheStringPiece ciphertext(encrypted, len);
   char decrypted[1024];
   ASSERT_TRUE(decrypter.DecryptPacket(packet_number, associated_data,
                                       ciphertext, decrypted, &len,
@@ -114,12 +115,13 @@
 TEST_F(ChaCha20Poly1305TlsEncrypterTest, Encrypt) {
   for (size_t i = 0; test_vectors[i].key != nullptr; i++) {
     // Decode the test vector.
-    std::string key = QuicTextUtils::HexDecode(test_vectors[i].key);
-    std::string pt = QuicTextUtils::HexDecode(test_vectors[i].pt);
-    std::string iv = QuicTextUtils::HexDecode(test_vectors[i].iv);
-    std::string fixed = QuicTextUtils::HexDecode(test_vectors[i].fixed);
-    std::string aad = QuicTextUtils::HexDecode(test_vectors[i].aad);
-    std::string ct = QuicTextUtils::HexDecode(test_vectors[i].ct);
+    std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
+    std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
+    std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
+    std::string fixed =
+        quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
+    std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
+    std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
 
     ChaCha20Poly1305TlsEncrypter encrypter;
     ASSERT_TRUE(encrypter.SetKey(key));
@@ -127,7 +129,8 @@
         &encrypter, fixed + iv,
         // This deliberately tests that the encrypter can handle an AAD that
         // is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
-        QuicStringPiece(aad.length() ? aad.data() : nullptr, aad.length()),
+        quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
+                                  aad.length()),
         pt));
     ASSERT_TRUE(encrypted.get());
     EXPECT_EQ(16u, ct.size() - pt.size());
@@ -155,13 +158,13 @@
 
 TEST_F(ChaCha20Poly1305TlsEncrypterTest, GenerateHeaderProtectionMask) {
   ChaCha20Poly1305TlsEncrypter encrypter;
-  std::string key = QuicTextUtils::HexDecode(
+  std::string key = quiche::QuicheTextUtils::HexDecode(
       "6a067f432787bd6034dd3f08f07fc9703a27e58c70e2d88d948b7f6489923cc7");
   std::string sample =
-      QuicTextUtils::HexDecode("1210d91cceb45c716b023f492c29e612");
+      quiche::QuicheTextUtils::HexDecode("1210d91cceb45c716b023f492c29e612");
   ASSERT_TRUE(encrypter.SetHeaderProtectionKey(key));
   std::string mask = encrypter.GenerateHeaderProtectionMask(sample);
-  std::string expected_mask = QuicTextUtils::HexDecode("1cc2cd98dc");
+  std::string expected_mask = quiche::QuicheTextUtils::HexDecode("1cc2cd98dc");
   test::CompareCharArraysWithHexError("header protection mask", mask.data(),
                                       mask.size(), expected_mask.data(),
                                       expected_mask.size());
diff --git a/quic/core/crypto/chacha_base_decrypter.cc b/quic/core/crypto/chacha_base_decrypter.cc
index c67fd89..d7a4984 100644
--- a/quic/core/crypto/chacha_base_decrypter.cc
+++ b/quic/core/crypto/chacha_base_decrypter.cc
@@ -11,10 +11,12 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
-bool ChaChaBaseDecrypter::SetHeaderProtectionKey(QuicStringPiece key) {
+bool ChaChaBaseDecrypter::SetHeaderProtectionKey(
+    quiche::QuicheStringPiece key) {
   if (key.size() != GetKeySize()) {
     QUIC_BUG << "Invalid key size for header protection";
     return false;
@@ -25,7 +27,7 @@
 
 std::string ChaChaBaseDecrypter::GenerateHeaderProtectionMask(
     QuicDataReader* sample_reader) {
-  QuicStringPiece sample;
+  quiche::QuicheStringPiece sample;
   if (!sample_reader->ReadStringPiece(&sample, 16)) {
     return std::string();
   }
diff --git a/quic/core/crypto/chacha_base_decrypter.h b/quic/core/crypto/chacha_base_decrypter.h
index d7ad741..24ca820 100644
--- a/quic/core/crypto/chacha_base_decrypter.h
+++ b/quic/core/crypto/chacha_base_decrypter.h
@@ -9,7 +9,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -17,7 +17,7 @@
  public:
   using AeadBaseDecrypter::AeadBaseDecrypter;
 
-  bool SetHeaderProtectionKey(QuicStringPiece key) override;
+  bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
   std::string GenerateHeaderProtectionMask(
       QuicDataReader* sample_reader) override;
 
diff --git a/quic/core/crypto/chacha_base_encrypter.cc b/quic/core/crypto/chacha_base_encrypter.cc
index 9c465a9..1e0d80f 100644
--- a/quic/core/crypto/chacha_base_encrypter.cc
+++ b/quic/core/crypto/chacha_base_encrypter.cc
@@ -9,10 +9,12 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
-bool ChaChaBaseEncrypter::SetHeaderProtectionKey(QuicStringPiece key) {
+bool ChaChaBaseEncrypter::SetHeaderProtectionKey(
+    quiche::QuicheStringPiece key) {
   if (key.size() != GetKeySize()) {
     QUIC_BUG << "Invalid key size for header protection";
     return false;
@@ -22,7 +24,7 @@
 }
 
 std::string ChaChaBaseEncrypter::GenerateHeaderProtectionMask(
-    QuicStringPiece sample) {
+    quiche::QuicheStringPiece sample) {
   if (sample.size() != 16) {
     return std::string();
   }
diff --git a/quic/core/crypto/chacha_base_encrypter.h b/quic/core/crypto/chacha_base_encrypter.h
index 7c086ac..16d1df1 100644
--- a/quic/core/crypto/chacha_base_encrypter.h
+++ b/quic/core/crypto/chacha_base_encrypter.h
@@ -9,7 +9,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -17,8 +17,9 @@
  public:
   using AeadBaseEncrypter::AeadBaseEncrypter;
 
-  bool SetHeaderProtectionKey(QuicStringPiece key) override;
-  std::string GenerateHeaderProtectionMask(QuicStringPiece sample) override;
+  bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
+  std::string GenerateHeaderProtectionMask(
+      quiche::QuicheStringPiece sample) override;
 
  private:
   // The key used for packet number encryption.
diff --git a/quic/core/crypto/channel_id.cc b/quic/core/crypto/channel_id.cc
index 0c4a3e9..facd552 100644
--- a/quic/core/crypto/channel_id.cc
+++ b/quic/core/crypto/channel_id.cc
@@ -11,6 +11,7 @@
 #include "third_party/boringssl/src/include/openssl/ecdsa.h"
 #include "third_party/boringssl/src/include/openssl/nid.h"
 #include "third_party/boringssl/src/include/openssl/sha.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -20,16 +21,16 @@
 const char ChannelIDVerifier::kClientToServerStr[] = "client -> server";
 
 // static
-bool ChannelIDVerifier::Verify(QuicStringPiece key,
-                               QuicStringPiece signed_data,
-                               QuicStringPiece signature) {
+bool ChannelIDVerifier::Verify(quiche::QuicheStringPiece key,
+                               quiche::QuicheStringPiece signed_data,
+                               quiche::QuicheStringPiece signature) {
   return VerifyRaw(key, signed_data, signature, true);
 }
 
 // static
-bool ChannelIDVerifier::VerifyRaw(QuicStringPiece key,
-                                  QuicStringPiece signed_data,
-                                  QuicStringPiece signature,
+bool ChannelIDVerifier::VerifyRaw(quiche::QuicheStringPiece key,
+                                  quiche::QuicheStringPiece signed_data,
+                                  quiche::QuicheStringPiece signature,
                                   bool is_channel_id_signature) {
   if (key.size() != 32 * 2 || signature.size() != 32 * 2) {
     return false;
diff --git a/quic/core/crypto/channel_id.h b/quic/core/crypto/channel_id.h
index 8719394..c04aac3 100644
--- a/quic/core/crypto/channel_id.h
+++ b/quic/core/crypto/channel_id.h
@@ -10,7 +10,7 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -30,17 +30,17 @@
 
   // Verify returns true iff |signature| is a valid signature of |signed_data|
   // by |key|.
-  static bool Verify(QuicStringPiece key,
-                     QuicStringPiece signed_data,
-                     QuicStringPiece signature);
+  static bool Verify(quiche::QuicheStringPiece key,
+                     quiche::QuicheStringPiece signed_data,
+                     quiche::QuicheStringPiece signature);
 
   // FOR TESTING ONLY: VerifyRaw returns true iff |signature| is a valid
   // signature of |signed_data| by |key|. |is_channel_id_signature| indicates
   // whether |signature| is a ChannelID signature (with kContextStr prepended
   // to the data to be signed).
-  static bool VerifyRaw(QuicStringPiece key,
-                        QuicStringPiece signed_data,
-                        QuicStringPiece signature,
+  static bool VerifyRaw(quiche::QuicheStringPiece key,
+                        quiche::QuicheStringPiece signed_data,
+                        quiche::QuicheStringPiece signature,
                         bool is_channel_id_signature);
 };
 
diff --git a/quic/core/crypto/channel_id_test.cc b/quic/core/crypto/channel_id_test.cc
index c69e328..d4a14cd 100644
--- a/quic/core/crypto/channel_id_test.cc
+++ b/quic/core/crypto/channel_id_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/crypto_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -277,8 +278,9 @@
     EXPECT_EQ(
         test_vector[i].result,
         ChannelIDVerifier::VerifyRaw(
-            QuicStringPiece(key, sizeof(key)), QuicStringPiece(msg, msg_len),
-            QuicStringPiece(signature, sizeof(signature)), false));
+            quiche::QuicheStringPiece(key, sizeof(key)),
+            quiche::QuicheStringPiece(msg, msg_len),
+            quiche::QuicheStringPiece(signature, sizeof(signature)), false));
   }
 }
 
diff --git a/quic/core/crypto/common_cert_set.cc b/quic/core/crypto/common_cert_set.cc
index 2f337f4..be4883b 100644
--- a/quic/core/crypto/common_cert_set.cc
+++ b/quic/core/crypto/common_cert_set.cc
@@ -8,6 +8,7 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -55,7 +56,7 @@
 
 // Compare returns a value less than, equal to or greater than zero if |a| is
 // lexicographically less than, equal to or greater than |b|, respectively.
-int Compare(QuicStringPiece a, const unsigned char* b, size_t b_len) {
+int Compare(quiche::QuicheStringPiece a, const unsigned char* b, size_t b_len) {
   size_t len = a.size();
   if (len > b_len) {
     len = b_len;
@@ -78,16 +79,18 @@
 class CommonCertSetsQUIC : public CommonCertSets {
  public:
   // CommonCertSets interface.
-  QuicStringPiece GetCommonHashes() const override {
-    return QuicStringPiece(reinterpret_cast<const char*>(kSetHashes),
-                           sizeof(uint64_t) * QUIC_ARRAYSIZE(kSetHashes));
+  quiche::QuicheStringPiece GetCommonHashes() const override {
+    return quiche::QuicheStringPiece(
+        reinterpret_cast<const char*>(kSetHashes),
+        sizeof(uint64_t) * QUIC_ARRAYSIZE(kSetHashes));
   }
 
-  QuicStringPiece GetCert(uint64_t hash, uint32_t index) const override {
+  quiche::QuicheStringPiece GetCert(uint64_t hash,
+                                    uint32_t index) const override {
     for (size_t i = 0; i < QUIC_ARRAYSIZE(kSets); i++) {
       if (kSets[i].hash == hash) {
         if (index < kSets[i].num_certs) {
-          return QuicStringPiece(
+          return quiche::QuicheStringPiece(
               reinterpret_cast<const char*>(kSets[i].certs[index]),
               kSets[i].lens[index]);
         }
@@ -95,11 +98,11 @@
       }
     }
 
-    return QuicStringPiece();
+    return quiche::QuicheStringPiece();
   }
 
-  bool MatchCert(QuicStringPiece cert,
-                 QuicStringPiece common_set_hashes,
+  bool MatchCert(quiche::QuicheStringPiece cert,
+                 quiche::QuicheStringPiece common_set_hashes,
                  uint64_t* out_hash,
                  uint32_t* out_index) const override {
     if (common_set_hashes.size() % sizeof(uint64_t) != 0) {
diff --git a/quic/core/crypto/common_cert_set.h b/quic/core/crypto/common_cert_set.h
index 57c0fea..af211ad 100644
--- a/quic/core/crypto/common_cert_set.h
+++ b/quic/core/crypto/common_cert_set.h
@@ -9,7 +9,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -22,22 +22,23 @@
   // GetInstanceQUIC returns the standard QUIC common certificate sets.
   static const CommonCertSets* GetInstanceQUIC();
 
-  // GetCommonHashes returns a QuicStringPiece containing the hashes of common
-  // sets supported by this object. The 64-bit hashes are concatenated in the
-  // QuicStringPiece.
-  virtual QuicStringPiece GetCommonHashes() const = 0;
+  // GetCommonHashes returns a quiche::QuicheStringPiece containing the hashes
+  // of common sets supported by this object. The 64-bit hashes are concatenated
+  // in the quiche::QuicheStringPiece.
+  virtual quiche::QuicheStringPiece GetCommonHashes() const = 0;
 
   // GetCert returns a specific certificate (at index |index|) in the common
   // set identified by |hash|. If no such certificate is known, an empty
-  // QuicStringPiece is returned.
-  virtual QuicStringPiece GetCert(uint64_t hash, uint32_t index) const = 0;
+  // quiche::QuicheStringPiece is returned.
+  virtual quiche::QuicheStringPiece GetCert(uint64_t hash,
+                                            uint32_t index) const = 0;
 
   // MatchCert tries to find |cert| in one of the common certificate sets
   // identified by |common_set_hashes|. On success it puts the hash of the
   // set in |out_hash|, the index of |cert| in the set in |out_index| and
   // returns true. Otherwise it returns false.
-  virtual bool MatchCert(QuicStringPiece cert,
-                         QuicStringPiece common_set_hashes,
+  virtual bool MatchCert(quiche::QuicheStringPiece cert,
+                         quiche::QuicheStringPiece common_set_hashes,
                          uint64_t* out_hash,
                          uint32_t* out_index) const = 0;
 };
diff --git a/quic/core/crypto/common_cert_set_test.cc b/quic/core/crypto/common_cert_set_test.cc
index 04720e1..148914d 100644
--- a/quic/core/crypto/common_cert_set_test.cc
+++ b/quic/core/crypto/common_cert_set_test.cc
@@ -7,6 +7,7 @@
 #include <cstdint>
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -192,8 +193,8 @@
 class CommonCertSetsTest : public QuicTest {};
 
 TEST_F(CommonCertSetsTest, FindGIA_2) {
-  QuicStringPiece gia(reinterpret_cast<const char*>(kGIACertificate2),
-                      sizeof(kGIACertificate2));
+  quiche::QuicheStringPiece gia(reinterpret_cast<const char*>(kGIACertificate2),
+                                sizeof(kGIACertificate2));
 
   const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
   // Common Cert Set 2's hash.
@@ -202,19 +203,20 @@
   uint32_t index;
   ASSERT_TRUE(sets->MatchCert(
       gia,
-      QuicStringPiece(reinterpret_cast<const char*>(&in_hash), sizeof(in_hash)),
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(&in_hash),
+                                sizeof(in_hash)),
       &hash, &index));
   EXPECT_EQ(in_hash, hash);
 
-  QuicStringPiece gia_copy = sets->GetCert(hash, index);
+  quiche::QuicheStringPiece gia_copy = sets->GetCert(hash, index);
   EXPECT_FALSE(gia_copy.empty());
   ASSERT_EQ(gia.size(), gia_copy.size());
   EXPECT_EQ(0, memcmp(gia.data(), gia_copy.data(), gia.size()));
 }
 
 TEST_F(CommonCertSetsTest, FindGIA_3) {
-  QuicStringPiece gia(reinterpret_cast<const char*>(kGIACertificate3),
-                      sizeof(kGIACertificate3));
+  quiche::QuicheStringPiece gia(reinterpret_cast<const char*>(kGIACertificate3),
+                                sizeof(kGIACertificate3));
 
   const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
   // Common Cert Set 3's hash.
@@ -223,11 +225,12 @@
   uint32_t index;
   ASSERT_TRUE(sets->MatchCert(
       gia,
-      QuicStringPiece(reinterpret_cast<const char*>(&in_hash), sizeof(in_hash)),
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(&in_hash),
+                                sizeof(in_hash)),
       &hash, &index));
   EXPECT_EQ(in_hash, hash);
 
-  QuicStringPiece gia_copy = sets->GetCert(hash, index);
+  quiche::QuicheStringPiece gia_copy = sets->GetCert(hash, index);
   EXPECT_FALSE(gia_copy.empty());
   ASSERT_EQ(gia.size(), gia_copy.size());
   EXPECT_EQ(0, memcmp(gia.data(), gia_copy.data(), gia.size()));
@@ -235,13 +238,14 @@
 
 TEST_F(CommonCertSetsTest, NonMatch) {
   const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
-  QuicStringPiece not_a_cert("hello");
+  quiche::QuicheStringPiece not_a_cert("hello");
   const uint64_t in_hash = UINT64_C(0xc9fef74053f99f39);
   uint64_t hash;
   uint32_t index;
   EXPECT_FALSE(sets->MatchCert(
       not_a_cert,
-      QuicStringPiece(reinterpret_cast<const char*>(&in_hash), sizeof(in_hash)),
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(&in_hash),
+                                sizeof(in_hash)),
       &hash, &index));
 }
 
diff --git a/quic/core/crypto/crypto_framer.cc b/quic/core/crypto/crypto_framer.cc
index c3dd2aa..6a18884 100644
--- a/quic/core/crypto/crypto_framer.cc
+++ b/quic/core/crypto/crypto_framer.cc
@@ -13,9 +13,9 @@
 #include "net/third_party/quiche/src/quic/core/quic_packets.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_endian.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 {
 
@@ -60,7 +60,7 @@
 
 // static
 std::unique_ptr<CryptoHandshakeMessage> CryptoFramer::ParseMessage(
-    QuicStringPiece in) {
+    quiche::QuicheStringPiece in) {
   OneShotVisitor visitor;
   CryptoFramer framer;
 
@@ -81,12 +81,12 @@
   return error_detail_;
 }
 
-bool CryptoFramer::ProcessInput(QuicStringPiece input,
+bool CryptoFramer::ProcessInput(quiche::QuicheStringPiece input,
                                 EncryptionLevel /*level*/) {
   return ProcessInput(input);
 }
 
-bool CryptoFramer::ProcessInput(QuicStringPiece input) {
+bool CryptoFramer::ProcessInput(quiche::QuicheStringPiece input) {
   DCHECK_EQ(QUIC_NO_ERROR, error_);
   if (error_ != QUIC_NO_ERROR) {
     return false;
@@ -121,7 +121,7 @@
   QuicDataReader reader(buffer_.data(), buffer_.length(),
                         quiche::HOST_BYTE_ORDER);
   for (const std::pair<QuicTag, size_t>& item : tags_and_lengths_) {
-    QuicStringPiece value;
+    quiche::QuicheStringPiece value;
     if (reader.BytesRemaining() < item.second) {
       break;
     }
@@ -243,7 +243,7 @@
   state_ = STATE_READING_TAG;
 }
 
-QuicErrorCode CryptoFramer::Process(QuicStringPiece input) {
+QuicErrorCode CryptoFramer::Process(quiche::QuicheStringPiece input) {
   // Add this data to the buffer.
   buffer_.append(input.data(), input.length());
   QuicDataReader reader(buffer_.data(), buffer_.length(),
@@ -265,7 +265,7 @@
       }
       reader.ReadUInt16(&num_entries_);
       if (num_entries_ > kMaxEntries) {
-        error_detail_ = QuicStrCat(num_entries_, " entries");
+        error_detail_ = quiche::QuicheStrCat(num_entries_, " entries");
         return QUIC_CRYPTO_TOO_MANY_ENTRIES;
       }
       uint16_t padding;
@@ -287,10 +287,10 @@
         reader.ReadTag(&tag);
         if (i > 0 && tag <= tags_and_lengths_[i - 1].first) {
           if (tag == tags_and_lengths_[i - 1].first) {
-            error_detail_ = QuicStrCat("Duplicate tag:", tag);
+            error_detail_ = quiche::QuicheStrCat("Duplicate tag:", tag);
             return QUIC_CRYPTO_DUPLICATE_TAG;
           }
-          error_detail_ = QuicStrCat("Tag ", tag, " out of order");
+          error_detail_ = quiche::QuicheStrCat("Tag ", tag, " out of order");
           return QUIC_CRYPTO_TAGS_OUT_OF_ORDER;
         }
 
@@ -298,8 +298,8 @@
         reader.ReadUInt32(&end_offset);
 
         if (end_offset < last_end_offset) {
-          error_detail_ =
-              QuicStrCat("End offset: ", end_offset, " vs ", last_end_offset);
+          error_detail_ = quiche::QuicheStrCat("End offset: ", end_offset,
+                                               " vs ", last_end_offset);
           return QUIC_CRYPTO_TAGS_OUT_OF_ORDER;
         }
         tags_and_lengths_.push_back(std::make_pair(
@@ -319,7 +319,7 @@
                         << values_len_ - reader.BytesRemaining() << " bytes.";
       }
       for (const std::pair<QuicTag, size_t>& item : tags_and_lengths_) {
-        QuicStringPiece value;
+        quiche::QuicheStringPiece value;
         if (!reader.ReadStringPiece(&value, item.second)) {
           DCHECK(process_truncated_messages_);
           // Store an empty value.
diff --git a/quic/core/crypto/crypto_framer.h b/quic/core/crypto/crypto_framer.h
index 5dcc81a..8dc0d96 100644
--- a/quic/core/crypto/crypto_framer.h
+++ b/quic/core/crypto/crypto_framer.h
@@ -15,7 +15,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
 #include "net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -42,11 +42,11 @@
 
   ~CryptoFramer() override;
 
-  // ParseMessage parses exactly one message from the given QuicStringPiece. If
-  // there is an error, the message is truncated, or the message has trailing
-  // garbage then nullptr will be returned.
+  // ParseMessage parses exactly one message from the given
+  // quiche::QuicheStringPiece. If there is an error, the message is truncated,
+  // or the message has trailing garbage then nullptr will be returned.
   static std::unique_ptr<CryptoHandshakeMessage> ParseMessage(
-      QuicStringPiece in);
+      quiche::QuicheStringPiece in);
 
   // Set callbacks to be called from the framer.  A visitor must be set, or
   // else the framer will crash.  It is acceptable for the visitor to do
@@ -63,8 +63,9 @@
   // false if there was an error, and true otherwise. ProcessInput optionally
   // takes an EncryptionLevel, but it is ignored. The variant with the
   // EncryptionLevel is provided to match the CryptoMessageParser interface.
-  bool ProcessInput(QuicStringPiece input, EncryptionLevel level) override;
-  bool ProcessInput(QuicStringPiece input);
+  bool ProcessInput(quiche::QuicheStringPiece input,
+                    EncryptionLevel level) override;
+  bool ProcessInput(quiche::QuicheStringPiece input);
 
   // Returns the number of bytes of buffered input data remaining to be
   // parsed.
@@ -95,7 +96,7 @@
 
   // Process does does the work of |ProcessInput|, but returns an error code,
   // doesn't set error_ and doesn't call |visitor_->OnError()|.
-  QuicErrorCode Process(QuicStringPiece input);
+  QuicErrorCode Process(quiche::QuicheStringPiece input);
 
   static bool WritePadTag(QuicDataWriter* writer,
                           size_t pad_length,
diff --git a/quic/core/crypto/crypto_framer_test.cc b/quic/core/crypto/crypto_framer_test.cc
index d54de07..8a8787a 100644
--- a/quic/core/crypto/crypto_framer_test.cc
+++ b/quic/core/crypto/crypto_framer_test.cc
@@ -16,6 +16,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -262,7 +263,7 @@
   };
 
   EXPECT_TRUE(framer.ProcessInput(
-      QuicStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
+      quiche::QuicheStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
   EXPECT_EQ(0u, framer.InputBytesRemaining());
   EXPECT_EQ(0, visitor.error_count_);
   ASSERT_EQ(1u, visitor.messages_.size());
@@ -306,7 +307,7 @@
   };
 
   EXPECT_TRUE(framer.ProcessInput(
-      QuicStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
+      quiche::QuicheStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
   EXPECT_EQ(0u, framer.InputBytesRemaining());
   EXPECT_EQ(0, visitor.error_count_);
   ASSERT_EQ(1u, visitor.messages_.size());
@@ -345,7 +346,8 @@
   };
 
   for (size_t i = 0; i < QUIC_ARRAYSIZE(input); i++) {
-    EXPECT_TRUE(framer.ProcessInput(QuicStringPiece(AsChars(input) + i, 1)));
+    EXPECT_TRUE(
+        framer.ProcessInput(quiche::QuicheStringPiece(AsChars(input) + i, 1)));
   }
   EXPECT_EQ(0u, framer.InputBytesRemaining());
   ASSERT_EQ(1u, visitor.messages_.size());
@@ -379,7 +381,7 @@
   };
 
   EXPECT_FALSE(framer.ProcessInput(
-      QuicStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
+      quiche::QuicheStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
   EXPECT_THAT(framer.error(), IsError(QUIC_CRYPTO_TAGS_OUT_OF_ORDER));
   EXPECT_EQ(1, visitor.error_count_);
 }
@@ -407,7 +409,7 @@
   };
 
   EXPECT_FALSE(framer.ProcessInput(
-      QuicStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
+      quiche::QuicheStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
   EXPECT_THAT(framer.error(), IsError(QUIC_CRYPTO_TAGS_OUT_OF_ORDER));
   EXPECT_EQ(1, visitor.error_count_);
 }
@@ -427,7 +429,7 @@
   };
 
   EXPECT_FALSE(framer.ProcessInput(
-      QuicStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
+      quiche::QuicheStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
   EXPECT_THAT(framer.error(), IsError(QUIC_CRYPTO_TOO_MANY_ENTRIES));
   EXPECT_EQ(1, visitor.error_count_);
 }
@@ -455,7 +457,7 @@
   };
 
   EXPECT_TRUE(framer.ProcessInput(
-      QuicStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
+      quiche::QuicheStringPiece(AsChars(input), QUIC_ARRAYSIZE(input))));
   EXPECT_EQ(0, visitor.error_count_);
 }
 
diff --git a/quic/core/crypto/crypto_handshake_message.cc b/quic/core/crypto/crypto_handshake_message.cc
index 56f0bd6..d5b4635 100644
--- a/quic/core/crypto/crypto_handshake_message.cc
+++ b/quic/core/crypto/crypto_handshake_message.cc
@@ -13,9 +13,10 @@
 #include "net/third_party/quiche/src/quic/core/quic_socket_address_coder.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_endian.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"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 
@@ -85,7 +86,7 @@
 }
 
 void CryptoHandshakeMessage::SetStringPiece(QuicTag tag,
-                                            QuicStringPiece value) {
+                                            quiche::QuicheStringPiece value) {
   tag_value_map_[tag] = std::string(value);
 }
 
@@ -147,8 +148,9 @@
   return QUIC_NO_ERROR;
 }
 
-bool CryptoHandshakeMessage::GetStringPiece(QuicTag tag,
-                                            QuicStringPiece* out) const {
+bool CryptoHandshakeMessage::GetStringPiece(
+    QuicTag tag,
+    quiche::QuicheStringPiece* out) const {
   auto it = tag_value_map_.find(tag);
   if (it == tag_value_map_.end()) {
     return false;
@@ -164,8 +166,8 @@
 QuicErrorCode CryptoHandshakeMessage::GetNthValue24(
     QuicTag tag,
     unsigned index,
-    QuicStringPiece* out) const {
-  QuicStringPiece value;
+    quiche::QuicheStringPiece* out) const {
+  quiche::QuicheStringPiece value;
   if (!GetStringPiece(tag, &value)) {
     return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
   }
@@ -190,7 +192,7 @@
     }
 
     if (i == index) {
-      *out = QuicStringPiece(value.data(), size);
+      *out = quiche::QuicheStringPiece(value.data(), size);
       return QUIC_NO_ERROR;
     }
 
@@ -284,7 +286,7 @@
         if (it->second.size() == 4) {
           uint32_t value;
           memcpy(&value, it->second.data(), sizeof(value));
-          ret += QuicTextUtils::Uint64ToString(value);
+          ret += quiche::QuicheTextUtils::Uint64ToString(value);
           done = true;
         }
         break;
@@ -345,8 +347,8 @@
         }
         break;
       case kPAD:
-        ret += QuicStringPrintf("(%d bytes of padding)",
-                                static_cast<int>(it->second.size()));
+        ret += quiche::QuicheStringPrintf("(%d bytes of padding)",
+                                          static_cast<int>(it->second.size()));
         done = true;
         break;
       case kSNI:
@@ -359,7 +361,7 @@
     if (!done) {
       // If there's no specific format for this tag, or the value is invalid,
       // then just use hex.
-      ret += "0x" + QuicTextUtils::HexEncode(it->second);
+      ret += "0x" + quiche::QuicheTextUtils::HexEncode(it->second);
     }
     ret += "\n";
   }
diff --git a/quic/core/crypto/crypto_handshake_message.h b/quic/core/crypto/crypto_handshake_message.h
index 6819e36..409738a 100644
--- a/quic/core/crypto/crypto_handshake_message.h
+++ b/quic/core/crypto/crypto_handshake_message.h
@@ -13,8 +13,8 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_packets.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -75,7 +75,7 @@
 
   const QuicTagValueMap& tag_value_map() const { return tag_value_map_; }
 
-  void SetStringPiece(QuicTag tag, QuicStringPiece value);
+  void SetStringPiece(QuicTag tag, quiche::QuicheStringPiece value);
 
   // Erase removes a tag/value, if present, from the message.
   void Erase(QuicTag tag);
@@ -96,7 +96,7 @@
   // Otherwise it populates |out| with the label and returns QUIC_NO_ERROR.
   QuicErrorCode GetVersionLabel(QuicTag tag, QuicVersionLabel* out) const;
 
-  bool GetStringPiece(QuicTag tag, QuicStringPiece* out) const;
+  bool GetStringPiece(QuicTag tag, quiche::QuicheStringPiece* out) const;
   bool HasStringPiece(QuicTag tag) const;
 
   // GetNthValue24 interprets the value with the given tag to be a series of
@@ -104,7 +104,7 @@
   // index.
   QuicErrorCode GetNthValue24(QuicTag tag,
                               unsigned index,
-                              QuicStringPiece* out) const;
+                              quiche::QuicheStringPiece* out) const;
   QuicErrorCode GetUint32(QuicTag tag, uint32_t* out) const;
   QuicErrorCode GetUint64(QuicTag tag, uint64_t* out) const;
   QuicErrorCode GetUint128(QuicTag tag, QuicUint128* out) const;
diff --git a/quic/core/crypto/crypto_message_parser.h b/quic/core/crypto/crypto_message_parser.h
index 2638a19..8038664 100644
--- a/quic/core/crypto/crypto_message_parser.h
+++ b/quic/core/crypto/crypto_message_parser.h
@@ -9,7 +9,7 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.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 {
 
@@ -23,7 +23,8 @@
   // Processes input data, which must be delivered in order. The input data
   // being processed was received at encryption level |level|. Returns
   // false if there was an error, and true otherwise.
-  virtual bool ProcessInput(QuicStringPiece input, EncryptionLevel level) = 0;
+  virtual bool ProcessInput(quiche::QuicheStringPiece input,
+                            EncryptionLevel level) = 0;
 
   // Returns the number of bytes of buffered input data remaining to be
   // parsed.
diff --git a/quic/core/crypto/crypto_message_printer_bin.cc b/quic/core/crypto/crypto_message_printer_bin.cc
index 67cd531..f5584ad 100644
--- a/quic/core/crypto/crypto_message_printer_bin.cc
+++ b/quic/core/crypto/crypto_message_printer_bin.cc
@@ -12,7 +12,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 using std::cerr;
 using std::cout;
@@ -47,7 +47,7 @@
   quic::CryptoFramer framer;
   framer.set_visitor(&printer);
   framer.set_process_truncated_messages(true);
-  std::string input = quic::QuicTextUtils::HexDecode(messages[0]);
+  std::string input = quiche::QuicheTextUtils::HexDecode(messages[0]);
   if (!framer.ProcessInput(input)) {
     return 1;
   }
diff --git a/quic/core/crypto/crypto_secret_boxer.cc b/quic/core/crypto/crypto_secret_boxer.cc
index c44cbb9..78cf768 100644
--- a/quic/core/crypto/crypto_secret_boxer.cc
+++ b/quic/core/crypto/crypto_secret_boxer.cc
@@ -11,6 +11,7 @@
 #include "third_party/boringssl/src/include/openssl/err.h"
 #include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -67,7 +68,7 @@
 }
 
 std::string CryptoSecretBoxer::Box(QuicRandom* rand,
-                                   QuicStringPiece plaintext) const {
+                                   quiche::QuicheStringPiece plaintext) const {
   // The box is formatted as:
   //   12 bytes of random nonce
   //   n bytes of ciphertext
@@ -103,9 +104,9 @@
   return ret;
 }
 
-bool CryptoSecretBoxer::Unbox(QuicStringPiece in_ciphertext,
+bool CryptoSecretBoxer::Unbox(quiche::QuicheStringPiece in_ciphertext,
                               std::string* out_storage,
-                              QuicStringPiece* out) const {
+                              quiche::QuicheStringPiece* out) const {
   if (in_ciphertext.size() < kSIVNonceSize) {
     return false;
   }
@@ -129,7 +130,7 @@
                             kSIVNonceSize, ciphertext, ciphertext_len, nullptr,
                             0)) {
         ok = true;
-        *out = QuicStringPiece(out_storage->data(), bytes_written);
+        *out = quiche::QuicheStringPiece(out_storage->data(), bytes_written);
         break;
       }
 
diff --git a/quic/core/crypto/crypto_secret_boxer.h b/quic/core/crypto/crypto_secret_boxer.h
index eba7a57..dc4e0b1 100644
--- a/quic/core/crypto/crypto_secret_boxer.h
+++ b/quic/core/crypto/crypto_secret_boxer.h
@@ -12,7 +12,7 @@
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_mutex.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 {
 
@@ -41,16 +41,16 @@
   // returns the resulting ciphertext. Since an authenticator and nonce are
   // included, the result will be slightly larger than |plaintext|. The first
   // key in the vector supplied to |SetKeys| will be used.
-  std::string Box(QuicRandom* rand, QuicStringPiece plaintext) const;
+  std::string Box(QuicRandom* rand, quiche::QuicheStringPiece plaintext) const;
 
   // Unbox takes the result of a previous call to |Box| in |ciphertext| and
   // authenticates+decrypts it. If |ciphertext| cannot be decrypted with any of
   // the supplied keys, the function returns false. Otherwise, |out_storage| is
   // used to store the result and |out| is set to point into |out_storage| and
   // contains the original plaintext.
-  bool Unbox(QuicStringPiece ciphertext,
+  bool Unbox(quiche::QuicheStringPiece ciphertext,
              std::string* out_storage,
-             QuicStringPiece* out) const;
+             quiche::QuicheStringPiece* out) const;
 
  private:
   struct State;
diff --git a/quic/core/crypto/crypto_secret_boxer_test.cc b/quic/core/crypto/crypto_secret_boxer_test.cc
index 06505d9..57a5712 100644
--- a/quic/core/crypto/crypto_secret_boxer_test.cc
+++ b/quic/core/crypto/crypto_secret_boxer_test.cc
@@ -8,6 +8,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -15,7 +16,7 @@
 class CryptoSecretBoxerTest : public QuicTest {};
 
 TEST_F(CryptoSecretBoxerTest, BoxAndUnbox) {
-  QuicStringPiece message("hello world");
+  quiche::QuicheStringPiece message("hello world");
 
   CryptoSecretBoxer boxer;
   boxer.SetKeys({std::string(CryptoSecretBoxer::GetKeySize(), 0x11)});
@@ -23,7 +24,7 @@
   const std::string box = boxer.Box(QuicRandom::GetInstance(), message);
 
   std::string storage;
-  QuicStringPiece result;
+  quiche::QuicheStringPiece result;
   EXPECT_TRUE(boxer.Unbox(box, &storage, &result));
   EXPECT_EQ(result, message);
 
@@ -39,10 +40,10 @@
 // Helper function to test whether one boxer can decode the output of another.
 static bool CanDecode(const CryptoSecretBoxer& decoder,
                       const CryptoSecretBoxer& encoder) {
-  QuicStringPiece message("hello world");
+  quiche::QuicheStringPiece message("hello world");
   const std::string boxed = encoder.Box(QuicRandom::GetInstance(), message);
   std::string storage;
-  QuicStringPiece result;
+  quiche::QuicheStringPiece result;
   bool ok = decoder.Unbox(boxed, &storage, &result);
   if (ok) {
     EXPECT_EQ(result, message);
diff --git a/quic/core/crypto/crypto_server_test.cc b/quic/core/crypto/crypto_server_test.cc
index a3cbbf4..9c606a2 100644
--- a/quic/core/crypto/crypto_server_test.cc
+++ b/quic/core/crypto/crypto_server_test.cc
@@ -23,9 +23,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_flags.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_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/failing_proof_source.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
@@ -33,6 +31,8 @@
 #include "net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_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_endian.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 namespace test {
@@ -127,7 +127,7 @@
     std::unique_ptr<CryptoHandshakeMessage> msg(
         config_.AddConfig(primary_config, clock_.WallNow()));
 
-    QuicStringPiece orbit;
+    quiche::QuicheStringPiece orbit;
     CHECK(msg->GetStringPiece(kORBT, &orbit));
     CHECK_EQ(sizeof(orbit_), orbit.size());
     memcpy(orbit_, orbit.data(), orbit.size());
@@ -135,9 +135,9 @@
     char public_value[32];
     memset(public_value, 42, sizeof(public_value));
 
-    nonce_hex_ = "#" + QuicTextUtils::HexEncode(GenerateNonce());
-    pub_hex_ =
-        "#" + QuicTextUtils::HexEncode(public_value, sizeof(public_value));
+    nonce_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(GenerateNonce());
+    pub_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(public_value,
+                                                        sizeof(public_value));
 
     CryptoHandshakeMessage client_hello =
         crypto_test_utils::CreateCHLO({{"PDMD", "X509"},
@@ -156,17 +156,17 @@
         SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
     CheckRejectReasons(kRejectReasons, QUIC_ARRAYSIZE(kRejectReasons));
 
-    QuicStringPiece srct;
+    quiche::QuicheStringPiece srct;
     ASSERT_TRUE(out_.GetStringPiece(kSourceAddressTokenTag, &srct));
-    srct_hex_ = "#" + QuicTextUtils::HexEncode(srct);
+    srct_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(srct);
 
-    QuicStringPiece scfg;
+    quiche::QuicheStringPiece scfg;
     ASSERT_TRUE(out_.GetStringPiece(kSCFG, &scfg));
     server_config_ = CryptoFramer::ParseMessage(scfg);
 
-    QuicStringPiece scid;
+    quiche::QuicheStringPiece scid;
     ASSERT_TRUE(server_config_->GetStringPiece(kSCID, &scid));
-    scid_hex_ = "#" + QuicTextUtils::HexEncode(scid);
+    scid_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(scid);
 
     signed_config_ = QuicReferenceCountedPointer<QuicSignedServerConfig>(
         new QuicSignedServerConfig());
@@ -211,7 +211,7 @@
       EXPECT_EQ(CreateQuicVersionLabel(supported_versions_[i]), versions[i]);
     }
 
-    QuicStringPiece address;
+    quiche::QuicheStringPiece address;
     ASSERT_TRUE(server_hello.GetStringPiece(kCADR, &address));
     QuicSocketAddressCoder decoder;
     ASSERT_TRUE(decoder.Decode(address.data(), address.size()));
@@ -313,7 +313,8 @@
     std::string nonce;
     CryptoUtils::GenerateNonce(
         clock_.WallNow(), rand_,
-        QuicStringPiece(reinterpret_cast<const char*>(orbit_), sizeof(orbit_)),
+        quiche::QuicheStringPiece(reinterpret_cast<const char*>(orbit_),
+                                  sizeof(orbit_)),
         &nonce);
     return nonce;
   }
@@ -339,8 +340,8 @@
 
   std::string XlctHexString() {
     uint64_t xlct = crypto_test_utils::LeafCertHashForTesting();
-    return "#" + QuicTextUtils::HexEncode(reinterpret_cast<char*>(&xlct),
-                                          sizeof(xlct));
+    return "#" + quiche::QuicheTextUtils::HexEncode(
+                     reinterpret_cast<char*>(&xlct), sizeof(xlct));
   }
 
  protected:
@@ -412,7 +413,7 @@
                                     kClientHelloMinimumSize);
 
   ShouldSucceed(msg);
-  QuicStringPiece cert, proof, cert_sct;
+  quiche::QuicheStringPiece cert, proof, cert_sct;
   EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
   EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
   EXPECT_TRUE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
@@ -441,7 +442,7 @@
   config_.set_chlo_multiplier(1);
 
   ShouldSucceed(msg);
-  QuicStringPiece cert, proof, cert_sct;
+  quiche::QuicheStringPiece cert, proof, cert_sct;
   EXPECT_FALSE(out_.GetStringPiece(kCertificateTag, &cert));
   EXPECT_FALSE(out_.GetStringPiece(kPROF, &proof));
   EXPECT_FALSE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
@@ -468,7 +469,7 @@
   config_.set_chlo_multiplier(1);
 
   ShouldSucceed(msg);
-  QuicStringPiece cert, proof, cert_sct;
+  quiche::QuicheStringPiece cert, proof, cert_sct;
   EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
   EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
   EXPECT_TRUE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
@@ -495,7 +496,7 @@
   config_.set_chlo_multiplier(1);
 
   ShouldSucceed(msg);
-  QuicStringPiece cert, proof, cert_sct;
+  quiche::QuicheStringPiece cert, proof, cert_sct;
   EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
   EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
   EXPECT_TRUE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
@@ -789,13 +790,13 @@
       SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE};
   CheckRejectReasons(kRejectReasons, QUIC_ARRAYSIZE(kRejectReasons));
 
-  QuicStringPiece cert, proof, scfg_str;
+  quiche::QuicheStringPiece cert, proof, scfg_str;
   EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
   EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
   EXPECT_TRUE(out_.GetStringPiece(kSCFG, &scfg_str));
   std::unique_ptr<CryptoHandshakeMessage> scfg(
       CryptoFramer::ParseMessage(scfg_str));
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   EXPECT_TRUE(scfg->GetStringPiece(kSCID, &scid));
   EXPECT_NE(scid, kOldConfigId);
 
@@ -895,7 +896,7 @@
   ShouldSucceed(msg);
   EXPECT_EQ(kSHLO, out_.tag());
 
-  QuicStringPiece nonce;
+  quiche::QuicheStringPiece nonce;
   EXPECT_TRUE(out_.GetStringPiece(kServerNonceTag, &nonce));
 }
 
@@ -931,7 +932,7 @@
   ShouldSucceed(msg);
 
   // Decompress cert chain from server to individual certs.
-  QuicStringPiece certs_compressed;
+  quiche::QuicheStringPiece certs_compressed;
   ASSERT_TRUE(out_.GetStringPiece(kCertificateTag, &certs_compressed));
   ASSERT_NE(0u, certs_compressed.size());
   std::vector<std::string> certs;
@@ -951,7 +952,7 @@
   ShouldSucceed(msg);
 
   // Server responds with inchoate REJ containing valid source-address token.
-  QuicStringPiece srct;
+  quiche::QuicheStringPiece srct;
   ASSERT_TRUE(out_.GetStringPiece(kSourceAddressTokenTag, &srct));
 
   // Client now drops cached certs; sends CHLO with updated source-address
@@ -1012,7 +1013,7 @@
   std::unique_ptr<CryptoHandshakeMessage> scfg_b(
       b.AddDefaultConfig(&rand_b, &clock, options));
 
-  QuicStringPiece scid_a, scid_b;
+  quiche::QuicheStringPiece scid_a, scid_b;
   EXPECT_TRUE(scfg_a->GetStringPiece(kSCID, &scid_a));
   EXPECT_TRUE(scfg_b->GetStringPiece(kSCID, &scid_b));
 
@@ -1030,7 +1031,7 @@
   std::unique_ptr<CryptoHandshakeMessage> scfg(
       a.AddDefaultConfig(&rand_a, &clock, options));
 
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   EXPECT_TRUE(scfg->GetStringPiece(kSCID, &scid));
   // Need to take a copy of |scid| has we're about to call |Erase|.
   const std::string scid_str(scid);
diff --git a/quic/core/crypto/crypto_utils.cc b/quic/core/crypto/crypto_utils.cc
index 5650cec..47da4c1 100644
--- a/quic/core/crypto/crypto_utils.cc
+++ b/quic/core/crypto/crypto_utils.cc
@@ -29,8 +29,9 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_endian.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 {
 
@@ -100,12 +101,12 @@
       HkdfExpandLabel(prf, pp_secret, "quic iv", crypter->GetIVSize());
   std::vector<uint8_t> pn =
       HkdfExpandLabel(prf, pp_secret, "quic hp", crypter->GetKeySize());
-  crypter->SetKey(
-      QuicStringPiece(reinterpret_cast<char*>(key.data()), key.size()));
+  crypter->SetKey(quiche::QuicheStringPiece(reinterpret_cast<char*>(key.data()),
+                                            key.size()));
   crypter->SetIV(
-      QuicStringPiece(reinterpret_cast<char*>(iv.data()), iv.size()));
+      quiche::QuicheStringPiece(reinterpret_cast<char*>(iv.data()), iv.size()));
   crypter->SetHeaderProtectionKey(
-      QuicStringPiece(reinterpret_cast<char*>(pn.data()), pn.size()));
+      quiche::QuicheStringPiece(reinterpret_cast<char*>(pn.data()), pn.size()));
 }
 
 namespace {
@@ -240,7 +241,7 @@
 // static
 void CryptoUtils::GenerateNonce(QuicWallTime now,
                                 QuicRandom* random_generator,
-                                QuicStringPiece orbit,
+                                quiche::QuicheStringPiece orbit,
                                 std::string* nonce) {
   // a 4-byte timestamp + 28 random bytes.
   nonce->reserve(kNonceSize);
@@ -266,11 +267,11 @@
 
 // static
 bool CryptoUtils::DeriveKeys(const ParsedQuicVersion& version,
-                             QuicStringPiece premaster_secret,
+                             quiche::QuicheStringPiece premaster_secret,
                              QuicTag aead,
-                             QuicStringPiece client_nonce,
-                             QuicStringPiece server_nonce,
-                             QuicStringPiece pre_shared_key,
+                             quiche::QuicheStringPiece client_nonce,
+                             quiche::QuicheStringPiece server_nonce,
+                             quiche::QuicheStringPiece pre_shared_key,
                              const std::string& hkdf_input,
                              Perspective perspective,
                              Diversification diversification,
@@ -279,7 +280,7 @@
   // If the connection is using PSK, concatenate it with the pre-master secret.
   std::unique_ptr<char[]> psk_premaster_secret;
   if (!pre_shared_key.empty()) {
-    const QuicStringPiece label(kPreSharedKeyLabel);
+    const quiche::QuicheStringPiece label(kPreSharedKeyLabel);
     const size_t psk_premaster_secret_size = label.size() + 1 +
                                              pre_shared_key.size() + 8 +
                                              premaster_secret.size() + 8;
@@ -297,8 +298,8 @@
       return false;
     }
 
-    premaster_secret =
-        QuicStringPiece(psk_premaster_secret.get(), psk_premaster_secret_size);
+    premaster_secret = quiche::QuicheStringPiece(psk_premaster_secret.get(),
+                                                 psk_premaster_secret_size);
   }
 
   crypters->encrypter = QuicEncrypter::Create(version, aead);
@@ -312,7 +313,7 @@
   size_t subkey_secret_bytes =
       subkey_secret == nullptr ? 0 : premaster_secret.length();
 
-  QuicStringPiece nonce = client_nonce;
+  quiche::QuicheStringPiece nonce = client_nonce;
   std::string nonce_storage;
   if (!server_nonce.empty()) {
     nonce_storage = std::string(client_nonce) + std::string(server_nonce);
@@ -409,9 +410,9 @@
 }
 
 // static
-bool CryptoUtils::ExportKeyingMaterial(QuicStringPiece subkey_secret,
-                                       QuicStringPiece label,
-                                       QuicStringPiece context,
+bool CryptoUtils::ExportKeyingMaterial(quiche::QuicheStringPiece subkey_secret,
+                                       quiche::QuicheStringPiece label,
+                                       quiche::QuicheStringPiece context,
                                        size_t result_len,
                                        std::string* result) {
   for (size_t i = 0; i < label.length(); i++) {
@@ -431,14 +432,14 @@
   info.append(reinterpret_cast<char*>(&context_length), sizeof(context_length));
   info.append(context.data(), context.length());
 
-  QuicHKDF hkdf(subkey_secret, QuicStringPiece() /* no salt */, info,
+  QuicHKDF hkdf(subkey_secret, quiche::QuicheStringPiece() /* no salt */, info,
                 result_len, 0 /* no fixed IV */, 0 /* no subkey secret */);
   *result = std::string(hkdf.client_write_key());
   return true;
 }
 
 // static
-uint64_t CryptoUtils::ComputeLeafCertHash(QuicStringPiece cert) {
+uint64_t CryptoUtils::ComputeLeafCertHash(quiche::QuicheStringPiece cert) {
   return QuicUtils::FNV1a_64_Hash(cert);
 }
 
@@ -478,7 +479,7 @@
     // reports that there was a version negotiation during the handshake.
     // Ensure that these two lists are identical.
     if (mismatch) {
-      *error_details = QuicStrCat(
+      *error_details = quiche::QuicheStrCat(
           "Downgrade attack detected: ServerVersions(", server_versions.size(),
           ")[", QuicVersionLabelVectorToString(server_versions, ",", 30),
           "] NegotiatedVersions(", negotiated_versions.size(), ")[",
@@ -524,7 +525,7 @@
     // downgrade attack.
     for (size_t i = 0; i < supported_versions.size(); ++i) {
       if (client_version == CreateQuicVersionLabel(supported_versions[i])) {
-        *error_details = QuicStrCat(
+        *error_details = quiche::QuicheStrCat(
             "Downgrade attack detected: ClientVersion[",
             QuicVersionLabelToString(client_version), "] SupportedVersions(",
             supported_versions.size(), ")[",
diff --git a/quic/core/crypto/crypto_utils.h b/quic/core/crypto/crypto_utils.h
index da746e3..8cebf14 100644
--- a/quic/core/crypto/crypto_utils.h
+++ b/quic/core/crypto/crypto_utils.h
@@ -19,7 +19,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_packets.h"
 #include "net/third_party/quiche/src/quic/core/quic_time.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -101,7 +101,7 @@
   //   <20 bytes> random
   static void GenerateNonce(QuicWallTime now,
                             QuicRandom* random_generator,
-                            QuicStringPiece orbit,
+                            quiche::QuicheStringPiece orbit,
                             std::string* nonce);
 
   // DeriveKeys populates |crypters->encrypter|, |crypters->decrypter|, and
@@ -124,11 +124,11 @@
   // |SetDiversificationNonce| with a diversification nonce will be needed to
   // complete keying.
   static bool DeriveKeys(const ParsedQuicVersion& version,
-                         QuicStringPiece premaster_secret,
+                         quiche::QuicheStringPiece premaster_secret,
                          QuicTag aead,
-                         QuicStringPiece client_nonce,
-                         QuicStringPiece server_nonce,
-                         QuicStringPiece pre_shared_key,
+                         quiche::QuicheStringPiece client_nonce,
+                         quiche::QuicheStringPiece server_nonce,
+                         quiche::QuicheStringPiece pre_shared_key,
                          const std::string& hkdf_input,
                          Perspective perspective,
                          Diversification diversification,
@@ -139,15 +139,15 @@
   // dependent on |subkey_secret|, |label|, and |context|. Returns false if the
   // parameters are invalid (e.g. |label| contains null bytes); returns true on
   // success.
-  static bool ExportKeyingMaterial(QuicStringPiece subkey_secret,
-                                   QuicStringPiece label,
-                                   QuicStringPiece context,
+  static bool ExportKeyingMaterial(quiche::QuicheStringPiece subkey_secret,
+                                   quiche::QuicheStringPiece label,
+                                   quiche::QuicheStringPiece context,
                                    size_t result_len,
                                    std::string* result);
 
   // Computes the FNV-1a hash of the provided DER-encoded cert for use in the
   // XLCT tag.
-  static uint64_t ComputeLeafCertHash(QuicStringPiece cert);
+  static uint64_t ComputeLeafCertHash(quiche::QuicheStringPiece cert);
 
   // Validates that |server_hello| is actually an SHLO message and that it is
   // not part of a downgrade attack.
diff --git a/quic/core/crypto/crypto_utils_test.cc b/quic/core/crypto/crypto_utils_test.cc
index 25adff2..bba62e9 100644
--- a/quic/core/crypto/crypto_utils_test.cc
+++ b/quic/core/crypto/crypto_utils_test.cc
@@ -9,8 +9,8 @@
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 namespace test {
@@ -52,14 +52,16 @@
   for (size_t i = 0; i < QUIC_ARRAYSIZE(test_vector); i++) {
     // Decode the test vector.
     std::string subkey_secret =
-        QuicTextUtils::HexDecode(test_vector[i].subkey_secret);
-    std::string label = QuicTextUtils::HexDecode(test_vector[i].label);
-    std::string context = QuicTextUtils::HexDecode(test_vector[i].context);
+        quiche::QuicheTextUtils::HexDecode(test_vector[i].subkey_secret);
+    std::string label =
+        quiche::QuicheTextUtils::HexDecode(test_vector[i].label);
+    std::string context =
+        quiche::QuicheTextUtils::HexDecode(test_vector[i].context);
     size_t result_len = test_vector[i].result_len;
     bool expect_ok = test_vector[i].expected != nullptr;
     std::string expected;
     if (expect_ok) {
-      expected = QuicTextUtils::HexDecode(test_vector[i].expected);
+      expected = quiche::QuicheTextUtils::HexDecode(test_vector[i].expected);
     }
 
     std::string result;
diff --git a/quic/core/crypto/curve25519_key_exchange.cc b/quic/core/crypto/curve25519_key_exchange.cc
index 044693d..f4cc793 100644
--- a/quic/core/crypto/curve25519_key_exchange.cc
+++ b/quic/core/crypto/curve25519_key_exchange.cc
@@ -11,6 +11,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -29,7 +30,7 @@
 
 // static
 std::unique_ptr<Curve25519KeyExchange> Curve25519KeyExchange::New(
-    QuicStringPiece private_key) {
+    quiche::QuicheStringPiece private_key) {
   // We don't want to #include the BoringSSL headers in the public header file,
   // so we use literals for the sizes of private_key_ and public_key_. Here we
   // assert that those values are equal to the values from the BoringSSL
@@ -59,7 +60,7 @@
 }
 
 bool Curve25519KeyExchange::CalculateSharedKeySync(
-    QuicStringPiece peer_public_value,
+    quiche::QuicheStringPiece peer_public_value,
     std::string* shared_key) const {
   if (peer_public_value.size() != X25519_PUBLIC_VALUE_LEN) {
     return false;
@@ -75,9 +76,9 @@
   return true;
 }
 
-QuicStringPiece Curve25519KeyExchange::public_value() const {
-  return QuicStringPiece(reinterpret_cast<const char*>(public_key_),
-                         sizeof(public_key_));
+quiche::QuicheStringPiece Curve25519KeyExchange::public_value() const {
+  return quiche::QuicheStringPiece(reinterpret_cast<const char*>(public_key_),
+                                   sizeof(public_key_));
 }
 
 }  // namespace quic
diff --git a/quic/core/crypto/curve25519_key_exchange.h b/quic/core/crypto/curve25519_key_exchange.h
index 31c6c0e..76fd23f 100644
--- a/quic/core/crypto/curve25519_key_exchange.h
+++ b/quic/core/crypto/curve25519_key_exchange.h
@@ -10,7 +10,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/key_exchange.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -29,16 +29,16 @@
   // New creates a new key-exchange object from a private key. If |private_key|
   // is invalid, nullptr is returned.
   static std::unique_ptr<Curve25519KeyExchange> New(
-      QuicStringPiece private_key);
+      quiche::QuicheStringPiece private_key);
 
   // NewPrivateKey returns a private key, generated from |rand|, suitable for
   // passing to |New|.
   static std::string NewPrivateKey(QuicRandom* rand);
 
   // SynchronousKeyExchange interface.
-  bool CalculateSharedKeySync(QuicStringPiece peer_public_value,
+  bool CalculateSharedKeySync(quiche::QuicheStringPiece peer_public_value,
                               std::string* shared_key) const override;
-  QuicStringPiece public_value() const override;
+  quiche::QuicheStringPiece public_value() const override;
   QuicTag type() const override { return kC255; }
 
  private:
diff --git a/quic/core/crypto/curve25519_key_exchange_test.cc b/quic/core/crypto/curve25519_key_exchange_test.cc
index 5003668..2e5dfb4 100644
--- a/quic/core/crypto/curve25519_key_exchange_test.cc
+++ b/quic/core/crypto/curve25519_key_exchange_test.cc
@@ -10,6 +10,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -54,8 +55,8 @@
     std::unique_ptr<Curve25519KeyExchange> bob(
         Curve25519KeyExchange::New(bob_key));
 
-    const QuicStringPiece alice_public(alice->public_value());
-    const QuicStringPiece bob_public(bob->public_value());
+    const quiche::QuicheStringPiece alice_public(alice->public_value());
+    const quiche::QuicheStringPiece bob_public(bob->public_value());
 
     std::string alice_shared, bob_shared;
     ASSERT_TRUE(alice->CalculateSharedKeySync(bob_public, &alice_shared));
@@ -78,8 +79,8 @@
     std::unique_ptr<Curve25519KeyExchange> bob(
         Curve25519KeyExchange::New(bob_key));
 
-    const QuicStringPiece alice_public(alice->public_value());
-    const QuicStringPiece bob_public(bob->public_value());
+    const quiche::QuicheStringPiece alice_public(alice->public_value());
+    const quiche::QuicheStringPiece bob_public(bob->public_value());
 
     std::string alice_shared, bob_shared;
     TestCallbackResult alice_result;
diff --git a/quic/core/crypto/key_exchange.cc b/quic/core/crypto/key_exchange.cc
index 1969e75..84f9c86 100644
--- a/quic/core/crypto/key_exchange.cc
+++ b/quic/core/crypto/key_exchange.cc
@@ -6,12 +6,13 @@
 #include "net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h"
 #include "net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
 std::unique_ptr<SynchronousKeyExchange> CreateLocalSynchronousKeyExchange(
     QuicTag type,
-    QuicStringPiece private_key) {
+    quiche::QuicheStringPiece private_key) {
   switch (type) {
     case kC255:
       return Curve25519KeyExchange::New(private_key);
diff --git a/quic/core/crypto/key_exchange.h b/quic/core/crypto/key_exchange.h
index 127dc62..cb6fdbc 100644
--- a/quic/core/crypto/key_exchange.h
+++ b/quic/core/crypto/key_exchange.h
@@ -10,7 +10,7 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -48,7 +48,7 @@
   // that |callback| might be invoked synchronously.  Results will be written
   // into |*shared_key|.
   virtual void CalculateSharedKeyAsync(
-      QuicStringPiece peer_public_value,
+      quiche::QuicheStringPiece peer_public_value,
       std::string* shared_key,
       std::unique_ptr<Callback> callback) const = 0;
 
@@ -66,7 +66,7 @@
 
   // AyncKeyExchange API.  Note that this method is marked 'final.'  Subclasses
   // should implement CalculateSharedKeySync only.
-  void CalculateSharedKeyAsync(QuicStringPiece peer_public_value,
+  void CalculateSharedKeyAsync(quiche::QuicheStringPiece peer_public_value,
                                std::string* shared_key,
                                std::unique_ptr<Callback> callback) const final {
     const bool ok = CalculateSharedKeySync(peer_public_value, shared_key);
@@ -75,14 +75,15 @@
 
   // CalculateSharedKey computes the shared key between a local private key and
   // a public value from the peer.  Results will be written into |*shared_key|.
-  virtual bool CalculateSharedKeySync(QuicStringPiece peer_public_value,
-                                      std::string* shared_key) const = 0;
+  virtual bool CalculateSharedKeySync(
+      quiche::QuicheStringPiece peer_public_value,
+      std::string* shared_key) const = 0;
 
   // public_value returns the local public key which can be sent to a peer in
-  // order to complete a key exchange. The returned QuicStringPiece is a
-  // reference to a member of this object and is only valid for as long as it
+  // order to complete a key exchange. The returned quiche::QuicheStringPiece is
+  // a reference to a member of this object and is only valid for as long as it
   // exists.
-  virtual QuicStringPiece public_value() const = 0;
+  virtual quiche::QuicheStringPiece public_value() const = 0;
 };
 
 // Create a SynchronousKeyExchange object which will use a keypair generated
@@ -91,7 +92,7 @@
 // invalid.
 std::unique_ptr<SynchronousKeyExchange> CreateLocalSynchronousKeyExchange(
     QuicTag type,
-    QuicStringPiece private_key);
+    quiche::QuicheStringPiece private_key);
 
 // Create a SynchronousKeyExchange object which will use a keypair generated
 // from |rand|, and a key-exchange algorithm specified by |type|, which must be
diff --git a/quic/core/crypto/null_decrypter.cc b/quic/core/crypto/null_decrypter.cc
index 51d8b11..d453a35 100644
--- a/quic/core/crypto/null_decrypter.cc
+++ b/quic/core/crypto/null_decrypter.cc
@@ -11,29 +11,30 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
 #include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
 NullDecrypter::NullDecrypter(Perspective perspective)
     : perspective_(perspective) {}
 
-bool NullDecrypter::SetKey(QuicStringPiece key) {
+bool NullDecrypter::SetKey(quiche::QuicheStringPiece key) {
   return key.empty();
 }
 
-bool NullDecrypter::SetNoncePrefix(QuicStringPiece nonce_prefix) {
+bool NullDecrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
   return nonce_prefix.empty();
 }
 
-bool NullDecrypter::SetIV(QuicStringPiece iv) {
+bool NullDecrypter::SetIV(quiche::QuicheStringPiece iv) {
   return iv.empty();
 }
 
-bool NullDecrypter::SetHeaderProtectionKey(QuicStringPiece key) {
+bool NullDecrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
   return key.empty();
 }
 
-bool NullDecrypter::SetPreliminaryKey(QuicStringPiece /*key*/) {
+bool NullDecrypter::SetPreliminaryKey(quiche::QuicheStringPiece /*key*/) {
   QUIC_BUG << "Should not be called";
   return false;
 }
@@ -45,8 +46,8 @@
 }
 
 bool NullDecrypter::DecryptPacket(uint64_t /*packet_number*/,
-                                  QuicStringPiece associated_data,
-                                  QuicStringPiece ciphertext,
+                                  quiche::QuicheStringPiece associated_data,
+                                  quiche::QuicheStringPiece ciphertext,
                                   char* output,
                                   size_t* output_length,
                                   size_t max_output_length) {
@@ -58,7 +59,7 @@
     return false;
   }
 
-  QuicStringPiece plaintext = reader.ReadRemainingPayload();
+  quiche::QuicheStringPiece plaintext = reader.ReadRemainingPayload();
   if (plaintext.length() > max_output_length) {
     QUIC_BUG << "Output buffer must be larger than the plaintext.";
     return false;
@@ -89,12 +90,12 @@
   return 0;
 }
 
-QuicStringPiece NullDecrypter::GetKey() const {
-  return QuicStringPiece();
+quiche::QuicheStringPiece NullDecrypter::GetKey() const {
+  return quiche::QuicheStringPiece();
 }
 
-QuicStringPiece NullDecrypter::GetNoncePrefix() const {
-  return QuicStringPiece();
+quiche::QuicheStringPiece NullDecrypter::GetNoncePrefix() const {
+  return quiche::QuicheStringPiece();
 }
 
 uint32_t NullDecrypter::cipher_id() const {
@@ -111,8 +112,9 @@
   return true;
 }
 
-QuicUint128 NullDecrypter::ComputeHash(const QuicStringPiece data1,
-                                       const QuicStringPiece data2) const {
+QuicUint128 NullDecrypter::ComputeHash(
+    const quiche::QuicheStringPiece data1,
+    const quiche::QuicheStringPiece data2) const {
   QuicUint128 correct_hash;
   if (perspective_ == Perspective::IS_CLIENT) {
     // Peer is a server.
diff --git a/quic/core/crypto/null_decrypter.h b/quic/core/crypto/null_decrypter.h
index aac25bb..c3bd203 100644
--- a/quic/core/crypto/null_decrypter.h
+++ b/quic/core/crypto/null_decrypter.h
@@ -11,8 +11,8 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -29,15 +29,15 @@
   ~NullDecrypter() override {}
 
   // QuicDecrypter implementation
-  bool SetKey(QuicStringPiece key) override;
-  bool SetNoncePrefix(QuicStringPiece nonce_prefix) override;
-  bool SetIV(QuicStringPiece iv) override;
-  bool SetHeaderProtectionKey(QuicStringPiece key) override;
-  bool SetPreliminaryKey(QuicStringPiece key) override;
+  bool SetKey(quiche::QuicheStringPiece key) override;
+  bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
+  bool SetIV(quiche::QuicheStringPiece iv) override;
+  bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
+  bool SetPreliminaryKey(quiche::QuicheStringPiece key) override;
   bool SetDiversificationNonce(const DiversificationNonce& nonce) override;
   bool DecryptPacket(uint64_t packet_number,
-                     QuicStringPiece associated_data,
-                     QuicStringPiece ciphertext,
+                     quiche::QuicheStringPiece associated_data,
+                     quiche::QuicheStringPiece ciphertext,
                      char* output,
                      size_t* output_length,
                      size_t max_output_length) override;
@@ -46,14 +46,15 @@
   size_t GetKeySize() const override;
   size_t GetNoncePrefixSize() const override;
   size_t GetIVSize() const override;
-  QuicStringPiece GetKey() const override;
-  QuicStringPiece GetNoncePrefix() const override;
+  quiche::QuicheStringPiece GetKey() const override;
+  quiche::QuicheStringPiece GetNoncePrefix() const override;
 
   uint32_t cipher_id() const override;
 
  private:
   bool ReadHash(QuicDataReader* reader, QuicUint128* hash);
-  QuicUint128 ComputeHash(QuicStringPiece data1, QuicStringPiece data2) const;
+  QuicUint128 ComputeHash(quiche::QuicheStringPiece data1,
+                          quiche::QuicheStringPiece data2) const;
 
   Perspective perspective_;
 };
diff --git a/quic/core/crypto/null_decrypter_test.cc b/quic/core/crypto/null_decrypter_test.cc
index 09b1aaf..9f18cc2 100644
--- a/quic/core/crypto/null_decrypter_test.cc
+++ b/quic/core/crypto/null_decrypter_test.cc
@@ -42,10 +42,11 @@
   NullDecrypter decrypter(Perspective::IS_SERVER);
   char buffer[256];
   size_t length = 0;
-  ASSERT_TRUE(decrypter.DecryptPacket(
-      0, "hello world!", QuicStringPiece(data, len), buffer, &length, 256));
+  ASSERT_TRUE(decrypter.DecryptPacket(0, "hello world!",
+                                      quiche::QuicheStringPiece(data, len),
+                                      buffer, &length, 256));
   EXPECT_LT(0u, length);
-  EXPECT_EQ("goodbye!", QuicStringPiece(buffer, length));
+  EXPECT_EQ("goodbye!", quiche::QuicheStringPiece(buffer, length));
 }
 
 TEST_F(NullDecrypterTest, DecryptServer) {
@@ -78,10 +79,11 @@
   NullDecrypter decrypter(Perspective::IS_CLIENT);
   char buffer[256];
   size_t length = 0;
-  ASSERT_TRUE(decrypter.DecryptPacket(
-      0, "hello world!", QuicStringPiece(data, len), buffer, &length, 256));
+  ASSERT_TRUE(decrypter.DecryptPacket(0, "hello world!",
+                                      quiche::QuicheStringPiece(data, len),
+                                      buffer, &length, 256));
   EXPECT_LT(0u, length);
-  EXPECT_EQ("goodbye!", QuicStringPiece(buffer, length));
+  EXPECT_EQ("goodbye!", quiche::QuicheStringPiece(buffer, length));
 }
 
 TEST_F(NullDecrypterTest, BadHash) {
@@ -114,8 +116,9 @@
   NullDecrypter decrypter(Perspective::IS_CLIENT);
   char buffer[256];
   size_t length = 0;
-  ASSERT_FALSE(decrypter.DecryptPacket(
-      0, "hello world!", QuicStringPiece(data, len), buffer, &length, 256));
+  ASSERT_FALSE(decrypter.DecryptPacket(0, "hello world!",
+                                       quiche::QuicheStringPiece(data, len),
+                                       buffer, &length, 256));
 }
 
 TEST_F(NullDecrypterTest, ShortInput) {
@@ -128,8 +131,9 @@
   NullDecrypter decrypter(Perspective::IS_CLIENT);
   char buffer[256];
   size_t length = 0;
-  ASSERT_FALSE(decrypter.DecryptPacket(
-      0, "hello world!", QuicStringPiece(data, len), buffer, &length, 256));
+  ASSERT_FALSE(decrypter.DecryptPacket(0, "hello world!",
+                                       quiche::QuicheStringPiece(data, len),
+                                       buffer, &length, 256));
 }
 
 }  // namespace test
diff --git a/quic/core/crypto/null_encrypter.cc b/quic/core/crypto/null_encrypter.cc
index 1fe0fdf..4de1510 100644
--- a/quic/core/crypto/null_encrypter.cc
+++ b/quic/core/crypto/null_encrypter.cc
@@ -6,6 +6,7 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
 #include "net/third_party/quiche/src/quic/core/quic_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -14,25 +15,25 @@
 NullEncrypter::NullEncrypter(Perspective perspective)
     : perspective_(perspective) {}
 
-bool NullEncrypter::SetKey(QuicStringPiece key) {
+bool NullEncrypter::SetKey(quiche::QuicheStringPiece key) {
   return key.empty();
 }
 
-bool NullEncrypter::SetNoncePrefix(QuicStringPiece nonce_prefix) {
+bool NullEncrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
   return nonce_prefix.empty();
 }
 
-bool NullEncrypter::SetIV(QuicStringPiece iv) {
+bool NullEncrypter::SetIV(quiche::QuicheStringPiece iv) {
   return iv.empty();
 }
 
-bool NullEncrypter::SetHeaderProtectionKey(QuicStringPiece key) {
+bool NullEncrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
   return key.empty();
 }
 
 bool NullEncrypter::EncryptPacket(uint64_t /*packet_number*/,
-                                  QuicStringPiece associated_data,
-                                  QuicStringPiece plaintext,
+                                  quiche::QuicheStringPiece associated_data,
+                                  quiche::QuicheStringPiece plaintext,
                                   char* output,
                                   size_t* output_length,
                                   size_t max_output_length) {
@@ -58,7 +59,7 @@
 }
 
 std::string NullEncrypter::GenerateHeaderProtectionMask(
-    QuicStringPiece /*sample*/) {
+    quiche::QuicheStringPiece /*sample*/) {
   return std::string(5, 0);
 }
 
@@ -82,12 +83,12 @@
   return plaintext_size + GetHashLength();
 }
 
-QuicStringPiece NullEncrypter::GetKey() const {
-  return QuicStringPiece();
+quiche::QuicheStringPiece NullEncrypter::GetKey() const {
+  return quiche::QuicheStringPiece();
 }
 
-QuicStringPiece NullEncrypter::GetNoncePrefix() const {
-  return QuicStringPiece();
+quiche::QuicheStringPiece NullEncrypter::GetNoncePrefix() const {
+  return quiche::QuicheStringPiece();
 }
 
 size_t NullEncrypter::GetHashLength() const {
diff --git a/quic/core/crypto/null_encrypter.h b/quic/core/crypto/null_encrypter.h
index efd6e23..bda73dc 100644
--- a/quic/core/crypto/null_encrypter.h
+++ b/quic/core/crypto/null_encrypter.h
@@ -10,7 +10,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -25,24 +25,25 @@
   ~NullEncrypter() override {}
 
   // QuicEncrypter implementation
-  bool SetKey(QuicStringPiece key) override;
-  bool SetNoncePrefix(QuicStringPiece nonce_prefix) override;
-  bool SetIV(QuicStringPiece iv) override;
-  bool SetHeaderProtectionKey(QuicStringPiece key) override;
+  bool SetKey(quiche::QuicheStringPiece key) override;
+  bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
+  bool SetIV(quiche::QuicheStringPiece iv) override;
+  bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
   bool EncryptPacket(uint64_t packet_number,
-                     QuicStringPiece associated_data,
-                     QuicStringPiece plaintext,
+                     quiche::QuicheStringPiece associated_data,
+                     quiche::QuicheStringPiece plaintext,
                      char* output,
                      size_t* output_length,
                      size_t max_output_length) override;
-  std::string GenerateHeaderProtectionMask(QuicStringPiece sample) override;
+  std::string GenerateHeaderProtectionMask(
+      quiche::QuicheStringPiece sample) override;
   size_t GetKeySize() const override;
   size_t GetNoncePrefixSize() const override;
   size_t GetIVSize() const override;
   size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
   size_t GetCiphertextSize(size_t plaintext_size) const override;
-  QuicStringPiece GetKey() const override;
-  QuicStringPiece GetNoncePrefix() const override;
+  quiche::QuicheStringPiece GetKey() const override;
+  quiche::QuicheStringPiece GetNoncePrefix() const override;
 
  private:
   size_t GetHashLength() const;
diff --git a/quic/core/crypto/p256_key_exchange.cc b/quic/core/crypto/p256_key_exchange.cc
index 1cabc64..a1b45ba 100644
--- a/quic/core/crypto/p256_key_exchange.cc
+++ b/quic/core/crypto/p256_key_exchange.cc
@@ -15,6 +15,7 @@
 #include "third_party/boringssl/src/include/openssl/evp.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -32,7 +33,8 @@
 }
 
 // static
-std::unique_ptr<P256KeyExchange> P256KeyExchange::New(QuicStringPiece key) {
+std::unique_ptr<P256KeyExchange> P256KeyExchange::New(
+    quiche::QuicheStringPiece key) {
   if (key.empty()) {
     QUIC_DLOG(INFO) << "Private key is empty";
     return nullptr;
@@ -81,8 +83,9 @@
   return std::string(reinterpret_cast<char*>(private_key.get()), key_len);
 }
 
-bool P256KeyExchange::CalculateSharedKeySync(QuicStringPiece peer_public_value,
-                                             std::string* shared_key) const {
+bool P256KeyExchange::CalculateSharedKeySync(
+    quiche::QuicheStringPiece peer_public_value,
+    std::string* shared_key) const {
   if (peer_public_value.size() != kUncompressedP256PointBytes) {
     QUIC_DLOG(INFO) << "Peer public value is invalid";
     return false;
@@ -111,9 +114,9 @@
   return true;
 }
 
-QuicStringPiece P256KeyExchange::public_value() const {
-  return QuicStringPiece(reinterpret_cast<const char*>(public_key_),
-                         sizeof(public_key_));
+quiche::QuicheStringPiece P256KeyExchange::public_value() const {
+  return quiche::QuicheStringPiece(reinterpret_cast<const char*>(public_key_),
+                                   sizeof(public_key_));
 }
 
 }  // namespace quic
diff --git a/quic/core/crypto/p256_key_exchange.h b/quic/core/crypto/p256_key_exchange.h
index a4e5709..10cc542 100644
--- a/quic/core/crypto/p256_key_exchange.h
+++ b/quic/core/crypto/p256_key_exchange.h
@@ -11,7 +11,7 @@
 #include "third_party/boringssl/src/include/openssl/base.h"
 #include "net/third_party/quiche/src/quic/core/crypto/key_exchange.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -26,7 +26,8 @@
 
   // New creates a new key-exchange object from a private key. If |private_key|
   // is invalid, nullptr is returned.
-  static std::unique_ptr<P256KeyExchange> New(QuicStringPiece private_key);
+  static std::unique_ptr<P256KeyExchange> New(
+      quiche::QuicheStringPiece private_key);
 
   // NewPrivateKey returns a private key, suitable for passing to |New|.
   // If |NewPrivateKey| can't generate a private key, it returns an empty
@@ -34,9 +35,9 @@
   static std::string NewPrivateKey();
 
   // SynchronousKeyExchange interface.
-  bool CalculateSharedKeySync(QuicStringPiece peer_public_value,
+  bool CalculateSharedKeySync(quiche::QuicheStringPiece peer_public_value,
                               std::string* shared_key) const override;
-  QuicStringPiece public_value() const override;
+  quiche::QuicheStringPiece public_value() const override;
   QuicTag type() const override { return kP256; }
 
  private:
diff --git a/quic/core/crypto/p256_key_exchange_test.cc b/quic/core/crypto/p256_key_exchange_test.cc
index 5e81be4..7e7dcd7 100644
--- a/quic/core/crypto/p256_key_exchange_test.cc
+++ b/quic/core/crypto/p256_key_exchange_test.cc
@@ -9,6 +9,7 @@
 #include <utility>
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -56,8 +57,8 @@
     ASSERT_TRUE(alice != nullptr);
     ASSERT_TRUE(bob != nullptr);
 
-    const QuicStringPiece alice_public(alice->public_value());
-    const QuicStringPiece bob_public(bob->public_value());
+    const quiche::QuicheStringPiece alice_public(alice->public_value());
+    const quiche::QuicheStringPiece bob_public(bob->public_value());
 
     std::string alice_shared, bob_shared;
     ASSERT_TRUE(alice->CalculateSharedKeySync(bob_public, &alice_shared));
@@ -83,8 +84,8 @@
     ASSERT_TRUE(alice != nullptr);
     ASSERT_TRUE(bob != nullptr);
 
-    const QuicStringPiece alice_public(alice->public_value());
-    const QuicStringPiece bob_public(bob->public_value());
+    const quiche::QuicheStringPiece alice_public(alice->public_value());
+    const quiche::QuicheStringPiece bob_public(bob->public_value());
 
     std::string alice_shared, bob_shared;
     TestCallbackResult alice_result;
diff --git a/quic/core/crypto/proof_source.h b/quic/core/crypto/proof_source.h
index f774efc..da28612 100644
--- a/quic/core/crypto/proof_source.h
+++ b/quic/core/crypto/proof_source.h
@@ -14,7 +14,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -116,7 +116,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) = 0;
 
   // Returns the certificate chain for |hostname| in leaf-first order.
@@ -136,7 +136,7 @@
       const QuicSocketAddress& server_address,
       const std::string& hostname,
       uint16_t signature_algorithm,
-      QuicStringPiece in,
+      quiche::QuicheStringPiece in,
       std::unique_ptr<SignatureCallback> callback) = 0;
 };
 
diff --git a/quic/core/crypto/proof_verifier.h b/quic/core/crypto/proof_verifier.h
index 38e978a..12036d6 100644
--- a/quic/core/crypto/proof_verifier.h
+++ b/quic/core/crypto/proof_verifier.h
@@ -12,7 +12,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/core/quic_versions.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -79,7 +79,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,
diff --git a/quic/core/crypto/quic_compressed_certs_cache_test.cc b/quic/core/crypto/quic_compressed_certs_cache_test.cc
index f27ed0d..e8f7309 100644
--- a/quic/core/crypto/quic_compressed_certs_cache_test.cc
+++ b/quic/core/crypto/quic_compressed_certs_cache_test.cc
@@ -8,8 +8,8 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/cert_compressor.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 
@@ -17,7 +17,7 @@
 
 namespace {
 
-class QuicCompressedCertsCacheTest : public testing::Test {
+class QuicCompressedCertsCacheTest : public QuicTest {
  public:
   QuicCompressedCertsCacheTest()
       : certs_cache_(QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) {}
@@ -85,8 +85,8 @@
   for (unsigned int i = 0;
        i < QuicCompressedCertsCache::kQuicCompressedCertsCacheSize; i++) {
     EXPECT_EQ(certs_cache_.Size(), i + 1);
-    certs_cache_.Insert(chain, QuicTextUtils::Uint64ToString(i), "",
-                        QuicTextUtils::Uint64ToString(i));
+    certs_cache_.Insert(chain, quiche::QuicheTextUtils::Uint64ToString(i), "",
+                        quiche::QuicheTextUtils::Uint64ToString(i));
   }
   EXPECT_EQ(certs_cache_.MaxSize(), certs_cache_.Size());
 
diff --git a/quic/core/crypto/quic_crypter.cc b/quic/core/crypto/quic_crypter.cc
index dc5bfb3..d8e7f2d 100644
--- a/quic/core/crypto/quic_crypter.cc
+++ b/quic/core/crypto/quic_crypter.cc
@@ -3,11 +3,13 @@
 // found in the LICENSE file.
 
 #include "net/third_party/quiche/src/quic/core/crypto/quic_crypter.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
-bool QuicCrypter::SetNoncePrefixOrIV(const ParsedQuicVersion& version,
-                                     QuicStringPiece nonce_prefix_or_iv) {
+bool QuicCrypter::SetNoncePrefixOrIV(
+    const ParsedQuicVersion& version,
+    quiche::QuicheStringPiece nonce_prefix_or_iv) {
   if (version.UsesInitialObfuscators()) {
     return SetIV(nonce_prefix_or_iv);
   }
diff --git a/quic/core/crypto/quic_crypter.h b/quic/core/crypto/quic_crypter.h
index 25a91e4..a12cd6f 100644
--- a/quic/core/crypto/quic_crypter.h
+++ b/quic/core/crypto/quic_crypter.h
@@ -7,7 +7,7 @@
 
 #include "net/third_party/quiche/src/quic/core/quic_versions.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -24,7 +24,7 @@
   //
   // NOTE: The key is the client_write_key or server_write_key derived from
   // the master secret.
-  virtual bool SetKey(QuicStringPiece key) = 0;
+  virtual bool SetKey(quiche::QuicheStringPiece key) = 0;
 
   // Sets the fixed initial bytes of the nonce. Returns true on success,
   // false on failure. This method must only be used with Google QUIC crypters.
@@ -41,7 +41,7 @@
   //
   // The security of the nonce format requires that QUIC never reuse a
   // packet number, even when retransmitting a lost packet.
-  virtual bool SetNoncePrefix(QuicStringPiece nonce_prefix) = 0;
+  virtual bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) = 0;
 
   // Sets |iv| as the initialization vector to use when constructing the nonce.
   // Returns true on success, false on failure. This method must only be used
@@ -68,15 +68,15 @@
   //
   // The security of the nonce format requires that QUIC never reuse a
   // packet number, even when retransmitting a lost packet.
-  virtual bool SetIV(QuicStringPiece iv) = 0;
+  virtual bool SetIV(quiche::QuicheStringPiece iv) = 0;
 
   // Calls SetNoncePrefix or SetIV depending on whether |version| uses the
   // Google QUIC crypto or IETF QUIC nonce construction.
   virtual bool SetNoncePrefixOrIV(const ParsedQuicVersion& version,
-                                  QuicStringPiece nonce_prefix_or_iv);
+                                  quiche::QuicheStringPiece nonce_prefix_or_iv);
 
   // Sets the key to use for header protection.
-  virtual bool SetHeaderProtectionKey(QuicStringPiece key) = 0;
+  virtual bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) = 0;
 
   // GetKeySize, GetIVSize, and GetNoncePrefixSize are used to know how many
   // bytes of key material needs to be derived from the master secret.
diff --git a/quic/core/crypto/quic_crypto_client_config.cc b/quic/core/crypto/quic_crypto_client_config.cc
index d674126..330192b 100644
--- a/quic/core/crypto/quic_crypto_client_config.cc
+++ b/quic/core/crypto/quic_crypto_client_config.cc
@@ -32,8 +32,8 @@
 #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/quic/platform/api/quic_ptr_util.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 
@@ -153,7 +153,7 @@
 
 QuicCryptoClientConfig::CachedState::ServerConfigState
 QuicCryptoClientConfig::CachedState::SetServerConfig(
-    QuicStringPiece server_config,
+    quiche::QuicheStringPiece server_config,
     QuicWallTime now,
     QuicWallTime expiry_time,
     std::string* error_details) {
@@ -211,9 +211,9 @@
 
 void QuicCryptoClientConfig::CachedState::SetProof(
     const std::vector<std::string>& certs,
-    QuicStringPiece cert_sct,
-    QuicStringPiece chlo_hash,
-    QuicStringPiece signature) {
+    quiche::QuicheStringPiece cert_sct,
+    quiche::QuicheStringPiece chlo_hash,
+    quiche::QuicheStringPiece signature) {
   bool has_changed = signature != server_config_sig_ ||
                      chlo_hash != chlo_hash_ || certs_.size() != certs.size();
 
@@ -272,12 +272,12 @@
 }
 
 bool QuicCryptoClientConfig::CachedState::Initialize(
-    QuicStringPiece server_config,
-    QuicStringPiece source_address_token,
+    quiche::QuicheStringPiece server_config,
+    quiche::QuicheStringPiece source_address_token,
     const std::vector<std::string>& certs,
     const std::string& cert_sct,
-    QuicStringPiece chlo_hash,
-    QuicStringPiece signature,
+    quiche::QuicheStringPiece chlo_hash,
+    quiche::QuicheStringPiece signature,
     QuicWallTime now,
     QuicWallTime expiration_time) {
   DCHECK(server_config_.empty());
@@ -345,12 +345,12 @@
 }
 
 void QuicCryptoClientConfig::CachedState::set_source_address_token(
-    QuicStringPiece token) {
+    quiche::QuicheStringPiece token) {
   source_address_token_ = std::string(token);
 }
 
 void QuicCryptoClientConfig::CachedState::set_cert_sct(
-    QuicStringPiece cert_sct) {
+    quiche::QuicheStringPiece cert_sct) {
   cert_sct_ = std::string(cert_sct);
 }
 
@@ -472,7 +472,7 @@
   // the STK can be validated by the server.
   const CryptoHandshakeMessage* scfg = cached->GetServerConfig();
   if (scfg != nullptr) {
-    QuicStringPiece scid;
+    quiche::QuicheStringPiece scid;
     if (scfg->GetStringPiece(kSCID, &scid)) {
       out->SetStringPiece(kSCID, scid);
     }
@@ -488,8 +488,8 @@
 
   char proof_nonce[32];
   rand->RandBytes(proof_nonce, QUIC_ARRAYSIZE(proof_nonce));
-  out->SetStringPiece(
-      kNONP, QuicStringPiece(proof_nonce, QUIC_ARRAYSIZE(proof_nonce)));
+  out->SetStringPiece(kNONP, quiche::QuicheStringPiece(
+                                 proof_nonce, QUIC_ARRAYSIZE(proof_nonce)));
 
   out->SetVector(kPDMD, QuicTagVector{kX509});
 
@@ -550,7 +550,7 @@
     return QUIC_CRYPTO_INTERNAL_ERROR;
   }
 
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   if (!scfg->GetStringPiece(kSCID, &scid)) {
     *error_details = "SCFG missing SCID";
     return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -582,14 +582,14 @@
   out->SetVector(kAEAD, QuicTagVector{out_params->aead});
   out->SetVector(kKEXS, QuicTagVector{out_params->key_exchange});
 
-  QuicStringPiece public_value;
+  quiche::QuicheStringPiece public_value;
   if (scfg->GetNthValue24(kPUBS, key_exchange_index, &public_value) !=
       QUIC_NO_ERROR) {
     *error_details = "Missing public value";
     return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
   }
 
-  QuicStringPiece orbit;
+  quiche::QuicheStringPiece orbit;
   if (!scfg->GetStringPiece(kORBT, &orbit) || orbit.size() != kOrbitSize) {
     *error_details = "SCFG missing OBIT";
     return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
@@ -672,13 +672,13 @@
     const CryptoHandshakeMessage& message,
     QuicWallTime now,
     QuicTransportVersion /*version*/,
-    QuicStringPiece chlo_hash,
+    quiche::QuicheStringPiece chlo_hash,
     const std::vector<std::string>& cached_certs,
     CachedState* cached,
     std::string* error_details) {
   DCHECK(error_details != nullptr);
 
-  QuicStringPiece scfg;
+  quiche::QuicheStringPiece scfg;
   if (!message.GetStringPiece(kSCFG, &scfg)) {
     *error_details = "Missing SCFG";
     return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
@@ -703,12 +703,12 @@
     return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
   }
 
-  QuicStringPiece token;
+  quiche::QuicheStringPiece token;
   if (message.GetStringPiece(kSourceAddressTokenTag, &token)) {
     cached->set_source_address_token(token);
   }
 
-  QuicStringPiece proof, cert_bytes, cert_sct;
+  quiche::QuicheStringPiece proof, cert_bytes, cert_sct;
   bool has_proof = message.GetStringPiece(kPROF, &proof);
   bool has_cert = message.GetStringPiece(kCertificateTag, &cert_bytes);
   if (has_proof && has_cert) {
@@ -744,7 +744,7 @@
     const CryptoHandshakeMessage& rej,
     QuicWallTime now,
     const QuicTransportVersion version,
-    QuicStringPiece chlo_hash,
+    quiche::QuicheStringPiece chlo_hash,
     CachedState* cached,
     QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
     std::string* error_details) {
@@ -762,7 +762,7 @@
     return error;
   }
 
-  QuicStringPiece nonce;
+  quiche::QuicheStringPiece nonce;
   if (rej.GetStringPiece(kServerNonceTag, &nonce)) {
     out_params->server_nonce = std::string(nonce);
   }
@@ -787,12 +787,12 @@
   }
 
   // Learn about updated source address tokens.
-  QuicStringPiece token;
+  quiche::QuicheStringPiece token;
   if (server_hello.GetStringPiece(kSourceAddressTokenTag, &token)) {
     cached->set_source_address_token(token);
   }
 
-  QuicStringPiece shlo_nonce;
+  quiche::QuicheStringPiece shlo_nonce;
   if (!server_hello.GetStringPiece(kServerNonceTag, &shlo_nonce)) {
     *error_details = "server hello missing server nonce";
     return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -801,7 +801,7 @@
   // TODO(agl):
   //   learn about updated SCFGs.
 
-  QuicStringPiece public_value;
+  quiche::QuicheStringPiece public_value;
   if (!server_hello.GetStringPiece(kPUBS, &public_value)) {
     *error_details = "server hello missing forward secure public value";
     return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -837,7 +837,7 @@
     const CryptoHandshakeMessage& server_config_update,
     QuicWallTime now,
     const QuicTransportVersion version,
-    QuicStringPiece chlo_hash,
+    quiche::QuicheStringPiece chlo_hash,
     CachedState* cached,
     QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
     std::string* error_details) {
@@ -886,8 +886,8 @@
   DCHECK(server_state->IsEmpty());
   size_t i = 0;
   for (; i < canonical_suffixes_.size(); ++i) {
-    if (QuicTextUtils::EndsWithIgnoreCase(server_id.host(),
-                                          canonical_suffixes_[i])) {
+    if (quiche::QuicheTextUtils::EndsWithIgnoreCase(server_id.host(),
+                                                    canonical_suffixes_[i])) {
       break;
     }
   }
diff --git a/quic/core/crypto/quic_crypto_client_config.h b/quic/core/crypto/quic_crypto_client_config.h
index a3e1bcd..fa96902 100644
--- a/quic/core/crypto/quic_crypto_client_config.h
+++ b/quic/core/crypto/quic_crypto_client_config.h
@@ -20,7 +20,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_server_id.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -125,7 +125,7 @@
     // SetServerConfig checks that |server_config| parses correctly and stores
     // it in |server_config_|. |now| is used to judge whether |server_config|
     // has expired.
-    ServerConfigState SetServerConfig(QuicStringPiece server_config,
+    ServerConfigState SetServerConfig(quiche::QuicheStringPiece server_config,
                                       QuicWallTime now,
                                       QuicWallTime expiry_time,
                                       std::string* error_details);
@@ -135,9 +135,9 @@
 
     // SetProof stores a cert chain, cert signed timestamp and signature.
     void SetProof(const std::vector<std::string>& certs,
-                  QuicStringPiece cert_sct,
-                  QuicStringPiece chlo_hash,
-                  QuicStringPiece signature);
+                  quiche::QuicheStringPiece cert_sct,
+                  quiche::QuicheStringPiece chlo_hash,
+                  quiche::QuicheStringPiece signature);
 
     // Clears all the data.
     void Clear();
@@ -165,9 +165,9 @@
     uint64_t generation_counter() const;
     const ProofVerifyDetails* proof_verify_details() const;
 
-    void set_source_address_token(QuicStringPiece token);
+    void set_source_address_token(quiche::QuicheStringPiece token);
 
-    void set_cert_sct(QuicStringPiece cert_sct);
+    void set_cert_sct(quiche::QuicheStringPiece cert_sct);
 
     // Adds the connection ID to the queue of server-designated connection-ids.
     void add_server_designated_connection_id(QuicConnectionId connection_id);
@@ -206,12 +206,12 @@
 
     // Initializes this cached state based on the arguments provided.
     // Returns false if there is a problem parsing the server config.
-    bool Initialize(QuicStringPiece server_config,
-                    QuicStringPiece source_address_token,
+    bool Initialize(quiche::QuicheStringPiece server_config,
+                    quiche::QuicheStringPiece source_address_token,
                     const std::vector<std::string>& certs,
                     const std::string& cert_sct,
-                    QuicStringPiece chlo_hash,
-                    QuicStringPiece signature,
+                    quiche::QuicheStringPiece chlo_hash,
+                    quiche::QuicheStringPiece signature,
                     QuicWallTime now,
                     QuicWallTime expiration_time);
 
@@ -323,7 +323,7 @@
       const CryptoHandshakeMessage& rej,
       QuicWallTime now,
       QuicTransportVersion version,
-      QuicStringPiece chlo_hash,
+      quiche::QuicheStringPiece chlo_hash,
       CachedState* cached,
       QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
       std::string* error_details);
@@ -355,7 +355,7 @@
       const CryptoHandshakeMessage& server_update,
       QuicWallTime now,
       const QuicTransportVersion version,
-      QuicStringPiece chlo_hash,
+      quiche::QuicheStringPiece chlo_hash,
       CachedState* cached,
       QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
       std::string* error_details);
@@ -389,7 +389,7 @@
   // Saves the |alpn| that will be passed in QUIC's CHLO message.
   void set_alpn(const std::string& alpn) { alpn_ = alpn; }
 
-  void set_pre_shared_key(QuicStringPiece psk) {
+  void set_pre_shared_key(quiche::QuicheStringPiece psk) {
     pre_shared_key_ = std::string(psk);
   }
 
@@ -413,7 +413,7 @@
       const CryptoHandshakeMessage& message,
       QuicWallTime now,
       QuicTransportVersion version,
-      QuicStringPiece chlo_hash,
+      quiche::QuicheStringPiece chlo_hash,
       const std::vector<std::string>& cached_certs,
       CachedState* cached,
       std::string* error_details);
diff --git a/quic/core/crypto/quic_crypto_client_config_test.cc b/quic/core/crypto/quic_crypto_client_config_test.cc
index acf26d6..95f76c6 100644
--- a/quic/core/crypto/quic_crypto_client_config_test.cc
+++ b/quic/core/crypto/quic_crypto_client_config_test.cc
@@ -14,6 +14,7 @@
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 using testing::StartsWith;
 
@@ -188,13 +189,13 @@
   QuicVersionLabel cver;
   EXPECT_THAT(msg.GetVersionLabel(kVER, &cver), IsQuicNoError());
   EXPECT_EQ(CreateQuicVersionLabel(QuicVersionMax()), cver);
-  QuicStringPiece proof_nonce;
+  quiche::QuicheStringPiece proof_nonce;
   EXPECT_TRUE(msg.GetStringPiece(kNONP, &proof_nonce));
   EXPECT_EQ(std::string(32, 'r'), proof_nonce);
-  QuicStringPiece user_agent_id;
+  quiche::QuicheStringPiece user_agent_id;
   EXPECT_TRUE(msg.GetStringPiece(kUAID, &user_agent_id));
   EXPECT_EQ("quic-tester", user_agent_id);
-  QuicStringPiece alpn;
+  quiche::QuicheStringPiece alpn;
   EXPECT_TRUE(msg.GetStringPiece(kALPN, &alpn));
   EXPECT_EQ("hq", alpn);
 
@@ -243,7 +244,7 @@
   QuicTag pdmd;
   EXPECT_THAT(msg.GetUint32(kPDMD, &pdmd), IsQuicNoError());
   EXPECT_EQ(kX509, pdmd);
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   EXPECT_FALSE(msg.GetStringPiece(kSCID, &scid));
 }
 
@@ -269,7 +270,7 @@
   config.FillInchoateClientHello(server_id, QuicVersionMax(), &state, &rand,
                                  /* demand_x509_proof= */ true, params, &msg);
 
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   EXPECT_TRUE(msg.GetStringPiece(kSCID, &scid));
   EXPECT_EQ("12345678", scid);
 }
@@ -295,7 +296,7 @@
   config.FillInchoateClientHello(server_id, QuicVersionMax(), &state, &rand,
                                  /* demand_x509_proof= */ true, params, &msg);
 
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   EXPECT_TRUE(msg.GetStringPiece(kSCID, &scid));
   EXPECT_EQ("12345678", scid);
 }
diff --git a/quic/core/crypto/quic_crypto_server_config.cc b/quic/core/crypto/quic_crypto_server_config.cc
index d568986..9c40d8f 100644
--- a/quic/core/crypto/quic_crypto_server_config.cc
+++ b/quic/core/crypto/quic_crypto_server_config.cc
@@ -44,8 +44,8 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.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/quic/platform/api/quic_text_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 
@@ -60,11 +60,11 @@
 const int kMaxTokenAddresses = 4;
 
 std::string DeriveSourceAddressTokenKey(
-    QuicStringPiece source_address_token_secret) {
-  QuicHKDF hkdf(source_address_token_secret, QuicStringPiece() /* no salt */,
-                "QUIC source address token key",
-                CryptoSecretBoxer::GetKeySize(), 0 /* no fixed IV needed */,
-                0 /* no subkey secret */);
+    quiche::QuicheStringPiece source_address_token_secret) {
+  QuicHKDF hkdf(
+      source_address_token_secret, quiche::QuicheStringPiece() /* no salt */,
+      "QUIC source address token key", CryptoSecretBoxer::GetKeySize(),
+      0 /* no fixed IV needed */, 0 /* no subkey secret */);
   return std::string(hkdf.server_write_key());
 }
 
@@ -78,7 +78,7 @@
       std::string /*server_config_id*/,
       bool /* is_fallback */,
       QuicTag type,
-      QuicStringPiece private_key) override {
+      quiche::QuicheStringPiece private_key) override {
     if (private_key.empty()) {
       QUIC_LOG(WARNING) << "Server config contains key exchange method without "
                            "corresponding private key of type "
@@ -228,7 +228,7 @@
 }
 
 QuicCryptoServerConfig::QuicCryptoServerConfig(
-    QuicStringPiece source_address_token_secret,
+    quiche::QuicheStringPiece source_address_token_secret,
     QuicRandom* server_nonce_entropy,
     std::unique_ptr<ProofSource> proof_source,
     std::unique_ptr<KeyExchangeSource> key_exchange_source)
@@ -276,7 +276,8 @@
       Curve25519KeyExchange::NewPrivateKey(rand);
   std::unique_ptr<Curve25519KeyExchange> curve25519 =
       Curve25519KeyExchange::New(curve25519_private_key);
-  QuicStringPiece curve25519_public_value = curve25519->public_value();
+  quiche::QuicheStringPiece curve25519_public_value =
+      curve25519->public_value();
 
   std::string encoded_public_values;
   // First three bytes encode the length of the public value.
@@ -295,7 +296,7 @@
     p256_private_key = P256KeyExchange::NewPrivateKey();
     std::unique_ptr<P256KeyExchange> p256(
         P256KeyExchange::New(p256_private_key));
-    QuicStringPiece p256_public_value = p256->public_value();
+    quiche::QuicheStringPiece p256_public_value = p256->public_value();
 
     DCHECK_LT(p256_public_value.size(), (1U << 24));
     encoded_public_values.push_back(
@@ -334,7 +335,8 @@
     DCHECK(options.orbit.empty());
     rand->RandBytes(orbit_bytes, sizeof(orbit_bytes));
   }
-  msg.SetStringPiece(kORBT, QuicStringPiece(orbit_bytes, sizeof(orbit_bytes)));
+  msg.SetStringPiece(
+      kORBT, quiche::QuicheStringPiece(orbit_bytes, sizeof(orbit_bytes)));
 
   if (options.channel_id_enabled) {
     msg.SetVector(kPDMD, QuicTagVector{kCHID});
@@ -351,8 +353,9 @@
            serialized->length(), scid_bytes);
     // The SCID is a truncated SHA-256 digest.
     static_assert(16 <= SHA256_DIGEST_LENGTH, "SCID length too high.");
-    msg.SetStringPiece(
-        kSCID, QuicStringPiece(reinterpret_cast<const char*>(scid_bytes), 16));
+    msg.SetStringPiece(kSCID,
+                       quiche::QuicheStringPiece(
+                           reinterpret_cast<const char*>(scid_bytes), 16));
   } else {
     msg.SetStringPiece(kSCID, options.id);
   }
@@ -401,7 +404,7 @@
     if (configs_.find(config->id) != configs_.end()) {
       QUIC_LOG(WARNING) << "Failed to add config because another with the same "
                            "server config id already exists: "
-                        << QuicTextUtils::HexEncode(config->id);
+                        << quiche::QuicheTextUtils::HexEncode(config->id);
       return nullptr;
     }
 
@@ -447,7 +450,7 @@
       return false;
     }
     QUIC_LOG(INFO) << "Fallback config has scid "
-                   << QuicTextUtils::HexEncode(fallback_config->id);
+                   << quiche::QuicheTextUtils::HexEncode(fallback_config->id);
     parsed_configs.push_back(fallback_config);
   } else {
     QUIC_LOG(INFO) << "No fallback config provided";
@@ -467,25 +470,24 @@
   for (const QuicReferenceCountedPointer<Config>& config : parsed_configs) {
     auto it = configs_.find(config->id);
     if (it != configs_.end()) {
-      QUIC_LOG(INFO) << "Keeping scid: " << QuicTextUtils::HexEncode(config->id)
-                     << " orbit: "
-                     << QuicTextUtils::HexEncode(
-                            reinterpret_cast<const char*>(config->orbit),
-                            kOrbitSize)
-                     << " new primary_time "
-                     << config->primary_time.ToUNIXSeconds()
-                     << " old primary_time "
-                     << it->second->primary_time.ToUNIXSeconds()
-                     << " new priority " << config->priority << " old priority "
-                     << it->second->priority;
+      QUIC_LOG(INFO)
+          << "Keeping scid: " << quiche::QuicheTextUtils::HexEncode(config->id)
+          << " orbit: "
+          << quiche::QuicheTextUtils::HexEncode(
+                 reinterpret_cast<const char*>(config->orbit), kOrbitSize)
+          << " new primary_time " << config->primary_time.ToUNIXSeconds()
+          << " old primary_time " << it->second->primary_time.ToUNIXSeconds()
+          << " new priority " << config->priority << " old priority "
+          << it->second->priority;
       // Update primary_time and priority.
       it->second->primary_time = config->primary_time;
       it->second->priority = config->priority;
       new_configs.insert(*it);
     } else {
-      QUIC_LOG(INFO) << "Adding scid: " << QuicTextUtils::HexEncode(config->id)
+      QUIC_LOG(INFO) << "Adding scid: "
+                     << quiche::QuicheTextUtils::HexEncode(config->id)
                      << " orbit: "
-                     << QuicTextUtils::HexEncode(
+                     << quiche::QuicheTextUtils::HexEncode(
                             reinterpret_cast<const char*>(config->orbit),
                             kOrbitSize)
                      << " primary_time " << config->primary_time.ToUNIXSeconds()
@@ -531,7 +533,7 @@
       new ValidateClientHelloResultCallback::Result(client_hello, client_ip,
                                                     now));
 
-  QuicStringPiece requested_scid;
+  quiche::QuicheStringPiece requested_scid;
   client_hello.GetStringPiece(kSCID, &requested_scid);
   Configs configs;
   if (!GetCurrentConfigs(now, requested_scid,
@@ -587,7 +589,7 @@
       std::unique_ptr<ProofSource::Details> proof_source_details,
       QuicTag key_exchange_type,
       std::unique_ptr<CryptoHandshakeMessage> out,
-      QuicStringPiece public_value,
+      quiche::QuicheStringPiece public_value,
       std::unique_ptr<ProcessClientHelloContext> context,
       const Configs& configs)
       : config_(config),
@@ -680,7 +682,7 @@
     return;
   }
 
-  QuicStringPiece requested_scid;
+  quiche::QuicheStringPiece requested_scid;
   context->client_hello().GetStringPiece(kSCID, &requested_scid);
   Configs configs;
   if (!GetCurrentConfigs(context->clock()->WallNow(), requested_scid,
@@ -740,7 +742,7 @@
 
   auto out_diversification_nonce = std::make_unique<DiversificationNonce>();
 
-  QuicStringPiece cert_sct;
+  quiche::QuicheStringPiece cert_sct;
   if (context->client_hello().GetStringPiece(kCertificateSCTTag, &cert_sct) &&
       cert_sct.empty()) {
     context->params()->sct_supported_by_client = true;
@@ -783,7 +785,7 @@
     return;
   }
 
-  QuicStringPiece public_value;
+  quiche::QuicheStringPiece public_value;
   if (!context->client_hello().GetStringPiece(kPUBS, &public_value)) {
     context->Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
                   "Missing public value");
@@ -806,7 +808,7 @@
     std::unique_ptr<ProofSource::Details> proof_source_details,
     QuicTag key_exchange_type,
     std::unique_ptr<CryptoHandshakeMessage> out,
-    QuicStringPiece public_value,
+    quiche::QuicheStringPiece public_value,
     std::unique_ptr<ProcessClientHelloContext> context,
     const Configs& configs) const {
   QUIC_BUG_IF(!QuicUtils::IsConnectionIdValidForVersion(
@@ -853,7 +855,7 @@
   }
   hkdf_suffix.append(context->signed_config()->chain->certs.at(0));
 
-  QuicStringPiece cetv_ciphertext;
+  quiche::QuicheStringPiece cetv_ciphertext;
   if (configs.requested->channel_id_enabled &&
       context->client_hello().GetStringPiece(kCETV, &cetv_ciphertext)) {
     CryptoHandshakeMessage client_hello_copy(context->client_hello());
@@ -886,21 +888,22 @@
     char plaintext[kMaxOutgoingPacketSize];
     size_t plaintext_length = 0;
     const bool success = crypters.decrypter->DecryptPacket(
-        0 /* packet number */, QuicStringPiece() /* associated data */,
-        cetv_ciphertext, plaintext, &plaintext_length, kMaxOutgoingPacketSize);
+        0 /* packet number */,
+        quiche::QuicheStringPiece() /* associated data */, cetv_ciphertext,
+        plaintext, &plaintext_length, kMaxOutgoingPacketSize);
     if (!success) {
       context->Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
                     "CETV decryption failure");
       return;
     }
     std::unique_ptr<CryptoHandshakeMessage> cetv(CryptoFramer::ParseMessage(
-        QuicStringPiece(plaintext, plaintext_length)));
+        quiche::QuicheStringPiece(plaintext, plaintext_length)));
     if (!cetv) {
       context->Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER, "CETV parse error");
       return;
     }
 
-    QuicStringPiece key, signature;
+    quiche::QuicheStringPiece key, signature;
     if (cetv->GetStringPiece(kCIDK, &key) &&
         cetv->GetStringPiece(kCIDS, &signature)) {
       if (!ChannelIDVerifier::Verify(key, hkdf_input, signature)) {
@@ -1037,7 +1040,7 @@
 
 QuicReferenceCountedPointer<QuicCryptoServerConfig::Config>
 QuicCryptoServerConfig::GetConfigWithScid(
-    QuicStringPiece requested_scid) const {
+    quiche::QuicheStringPiece requested_scid) const {
   configs_lock_.AssertReaderHeld();
 
   if (!requested_scid.empty()) {
@@ -1054,7 +1057,7 @@
 
 bool QuicCryptoServerConfig::GetCurrentConfigs(
     const QuicWallTime& now,
-    QuicStringPiece requested_scid,
+    quiche::QuicheStringPiece requested_scid,
     QuicReferenceCountedPointer<Config> old_primary_config,
     Configs* configs) const {
   QuicReaderMutexLock locked(&configs_lock_);
@@ -1157,9 +1160,10 @@
     primary_config_ = new_primary;
     new_primary->is_primary = true;
     QUIC_DLOG(INFO) << "New primary config.  orbit: "
-                    << QuicTextUtils::HexEncode(reinterpret_cast<const char*>(
-                                                    primary_config_->orbit),
-                                                kOrbitSize);
+                    << quiche::QuicheTextUtils::HexEncode(
+                           reinterpret_cast<const char*>(
+                               primary_config_->orbit),
+                           kOrbitSize);
     if (primary_config_changed_cb_ != nullptr) {
       primary_config_changed_cb_->Run(primary_config_->id);
     }
@@ -1176,10 +1180,11 @@
   primary_config_ = new_primary;
   new_primary->is_primary = true;
   QUIC_DLOG(INFO) << "New primary config.  orbit: "
-                  << QuicTextUtils::HexEncode(
+                  << quiche::QuicheTextUtils::HexEncode(
                          reinterpret_cast<const char*>(primary_config_->orbit),
                          kOrbitSize)
-                  << " scid: " << QuicTextUtils::HexEncode(primary_config_->id);
+                  << " scid: "
+                  << quiche::QuicheTextUtils::HexEncode(primary_config_->id);
   next_config_promotion_time_ = QuicWallTime::Zero();
   if (primary_config_changed_cb_ != nullptr) {
     primary_config_changed_cb_->Run(primary_config_->id);
@@ -1215,7 +1220,7 @@
 
   HandshakeFailureReason source_address_token_error = MAX_FAILURE_REASON;
   if (validate_source_address_token_) {
-    QuicStringPiece srct;
+    quiche::QuicheStringPiece srct;
     if (client_hello.GetStringPiece(kSourceAddressTokenTag, &srct)) {
       Config& config =
           configs.requested != nullptr ? *configs.requested : *configs.primary;
@@ -1238,7 +1243,7 @@
   }
 
   if (!configs.requested) {
-    QuicStringPiece requested_scid;
+    quiche::QuicheStringPiece requested_scid;
     if (client_hello.GetStringPiece(kSCID, &requested_scid)) {
       info->reject_reasons.push_back(SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE);
     } else {
@@ -1292,7 +1297,7 @@
 
 void QuicCryptoServerConfig::BuildServerConfigUpdateMessage(
     QuicTransportVersion version,
-    QuicStringPiece chlo_hash,
+    quiche::QuicheStringPiece chlo_hash,
     const SourceAddressTokens& previous_source_address_tokens,
     const QuicSocketAddress& server_address,
     const QuicIpAddress& client_ip,
@@ -1440,13 +1445,13 @@
     return;
   }
 
-  QuicStringPiece client_common_set_hashes;
+  quiche::QuicheStringPiece client_common_set_hashes;
   if (context.client_hello().GetStringPiece(kCCS, &client_common_set_hashes)) {
     context.params()->client_common_set_hashes =
         std::string(client_common_set_hashes);
   }
 
-  QuicStringPiece client_cached_cert_hashes;
+  quiche::QuicheStringPiece client_cached_cert_hashes;
   if (context.client_hello().GetStringPiece(kCCRT,
                                             &client_cached_cert_hashes)) {
     context.params()->client_cached_cert_hashes =
@@ -1494,7 +1499,7 @@
         // This is for debugging b/28342827.
         const std::vector<std::string>& certs =
             context.signed_config()->chain->certs;
-        QuicStringPiece ca_subject;
+        quiche::QuicheStringPiece ca_subject;
         if (!certs.empty()) {
           QuicCertUtils::ExtractSubjectNameFromDERCert(certs[0], &ca_subject);
         }
@@ -1561,7 +1566,7 @@
 
   config->priority = protobuf.priority();
 
-  QuicStringPiece scid;
+  quiche::QuicheStringPiece scid;
   if (!msg->GetStringPiece(kSCID, &scid)) {
     QUIC_LOG(WARNING) << "Server config message is missing SCID";
     return nullptr;
@@ -1579,7 +1584,7 @@
     return nullptr;
   }
 
-  QuicStringPiece orbit;
+  quiche::QuicheStringPiece orbit;
   if (!msg->GetStringPiece(kORBT, &orbit)) {
     QUIC_LOG(WARNING) << "Server config message is missing ORBT";
     return nullptr;
@@ -1733,10 +1738,10 @@
 
 HandshakeFailureReason QuicCryptoServerConfig::ParseSourceAddressToken(
     const Config& config,
-    QuicStringPiece token,
+    quiche::QuicheStringPiece token,
     SourceAddressTokens* tokens) const {
   std::string storage;
-  QuicStringPiece plaintext;
+  quiche::QuicheStringPiece plaintext;
   if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) {
     return SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE;
   }
@@ -1826,8 +1831,8 @@
                   sizeof(server_nonce) - sizeof(timestamp));
 
   return server_nonce_boxer_.Box(
-      rand, QuicStringPiece(reinterpret_cast<char*>(server_nonce),
-                            sizeof(server_nonce)));
+      rand, quiche::QuicheStringPiece(reinterpret_cast<char*>(server_nonce),
+                                      sizeof(server_nonce)));
 }
 
 bool QuicCryptoServerConfig::ValidateExpectedLeafCertificate(
diff --git a/quic/core/crypto/quic_crypto_server_config.h b/quic/core/crypto/quic_crypto_server_config.h
index 809ebae..20aaa6f 100644
--- a/quic/core/crypto/quic_crypto_server_config.h
+++ b/quic/core/crypto/quic_crypto_server_config.h
@@ -28,7 +28,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_mutex.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 {
 
@@ -52,10 +52,10 @@
 
   // Outputs from EvaluateClientHello.
   bool valid_source_address_token;
-  QuicStringPiece sni;
-  QuicStringPiece client_nonce;
-  QuicStringPiece server_nonce;
-  QuicStringPiece user_agent_id;
+  quiche::QuicheStringPiece sni;
+  quiche::QuicheStringPiece client_nonce;
+  quiche::QuicheStringPiece server_nonce;
+  quiche::QuicheStringPiece user_agent_id;
   SourceAddressTokens source_address_tokens;
 
   // Errors from EvaluateClientHello.
@@ -169,7 +169,7 @@
       std::string server_config_id,
       bool is_fallback,
       QuicTag type,
-      QuicStringPiece private_key) = 0;
+      quiche::QuicheStringPiece private_key) = 0;
 };
 
 // QuicCryptoServerConfig contains the crypto configuration of a QUIC server.
@@ -213,7 +213,7 @@
   // |proof_source|: provides certificate chains and signatures.
   // |key_exchange_source|: provides key-exchange functionality.
   QuicCryptoServerConfig(
-      QuicStringPiece source_address_token_secret,
+      quiche::QuicheStringPiece source_address_token_secret,
       QuicRandom* server_nonce_entropy,
       std::unique_ptr<ProofSource> proof_source,
       std::unique_ptr<KeyExchangeSource> key_exchange_source);
@@ -355,7 +355,7 @@
   // |cached_network_params| is optional, and can be nullptr.
   void BuildServerConfigUpdateMessage(
       QuicTransportVersion version,
-      QuicStringPiece chlo_hash,
+      quiche::QuicheStringPiece chlo_hash,
       const SourceAddressTokens& previous_source_address_tokens,
       const QuicSocketAddress& server_address,
       const QuicIpAddress& client_ip,
@@ -425,7 +425,7 @@
 
   SSL_CTX* ssl_ctx() const;
 
-  void set_pre_shared_key(QuicStringPiece psk) {
+  void set_pre_shared_key(quiche::QuicheStringPiece psk) {
     pre_shared_key_ = std::string(psk);
   }
 
@@ -507,7 +507,7 @@
 
   // Get a ref to the config with a given server config id.
   QuicReferenceCountedPointer<Config> GetConfigWithScid(
-      QuicStringPiece requested_scid) const
+      quiche::QuicheStringPiece requested_scid) const
       QUIC_SHARED_LOCKS_REQUIRED(configs_lock_);
 
   // A snapshot of the configs associated with an in-progress handshake.
@@ -524,7 +524,7 @@
   // Returns true if any configs are loaded.  If false is returned, |configs| is
   // not modified.
   bool GetCurrentConfigs(const QuicWallTime& now,
-                         QuicStringPiece requested_scid,
+                         quiche::QuicheStringPiece requested_scid,
                          QuicReferenceCountedPointer<Config> old_primary_config,
                          Configs* configs) const;
 
@@ -677,7 +677,7 @@
       std::unique_ptr<ProofSource::Details> proof_source_details,
       QuicTag key_exchange_type,
       std::unique_ptr<CryptoHandshakeMessage> out,
-      QuicStringPiece public_value,
+      quiche::QuicheStringPiece public_value,
       std::unique_ptr<ProcessClientHelloContext> context,
       const Configs& configs) const;
 
@@ -751,7 +751,7 @@
   // failure.
   HandshakeFailureReason ParseSourceAddressToken(
       const Config& config,
-      QuicStringPiece token,
+      quiche::QuicheStringPiece token,
       SourceAddressTokens* tokens) const;
 
   // ValidateSourceAddressTokens returns HANDSHAKE_OK if the source address
diff --git a/quic/core/crypto/quic_crypto_server_config_test.cc b/quic/core/crypto/quic_crypto_server_config_test.cc
index ce47d24..df9b904 100644
--- a/quic/core/crypto/quic_crypto_server_config_test.cc
+++ b/quic/core/crypto/quic_crypto_server_config_test.cc
@@ -18,11 +18,12 @@
 #include "net/third_party/quiche/src/quic/core/quic_time.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
 #include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
 #include "net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_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_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 namespace test {
@@ -140,7 +141,7 @@
   static const uint64_t set_hash = 42;
   std::unique_ptr<CommonCertSets> common_sets(
       crypto_test_utils::MockCommonCertSets(certs[0], set_hash, 1));
-  QuicStringPiece different_common_certs(
+  quiche::QuicheStringPiece different_common_certs(
       reinterpret_cast<const char*>(&set_hash), sizeof(set_hash));
   std::string compressed3 = QuicCryptoServerConfigPeer::CompressChain(
       &compressed_certs_cache, chain, std::string(different_common_certs),
@@ -191,15 +192,16 @@
                                        clock_.WallNow(), cached_network_params);
   }
 
-  HandshakeFailureReason ValidateSourceAddressTokens(std::string config_id,
-                                                     QuicStringPiece srct,
-                                                     const QuicIpAddress& ip) {
+  HandshakeFailureReason ValidateSourceAddressTokens(
+      std::string config_id,
+      quiche::QuicheStringPiece srct,
+      const QuicIpAddress& ip) {
     return ValidateSourceAddressTokens(config_id, srct, ip, nullptr);
   }
 
   HandshakeFailureReason ValidateSourceAddressTokens(
       std::string config_id,
-      QuicStringPiece srct,
+      quiche::QuicheStringPiece srct,
       const QuicIpAddress& ip,
       CachedNetworkParameters* cached_network_params) {
     return peer_.ValidateSourceAddressTokens(
@@ -353,7 +355,8 @@
           QuicCryptoServerConfig::GenerateConfig(rand_, &clock_, options);
       protobuf.set_primary_time(primary_time);
       protobuf.set_priority(priority);
-      if (QuicTextUtils::StartsWith(std::string(server_config_id), "INVALID")) {
+      if (quiche::QuicheTextUtils::StartsWith(std::string(server_config_id),
+                                              "INVALID")) {
         protobuf.clear_key();
         has_invalid = true;
       }
diff --git a/quic/core/crypto/quic_decrypter.cc b/quic/core/crypto/quic_decrypter.cc
index 33c563f..c424901 100644
--- a/quic/core/crypto/quic_decrypter.cc
+++ b/quic/core/crypto/quic_decrypter.cc
@@ -18,6 +18,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -61,15 +62,16 @@
 }
 
 // static
-void QuicDecrypter::DiversifyPreliminaryKey(QuicStringPiece preliminary_key,
-                                            QuicStringPiece nonce_prefix,
-                                            const DiversificationNonce& nonce,
-                                            size_t key_size,
-                                            size_t nonce_prefix_size,
-                                            std::string* out_key,
-                                            std::string* out_nonce_prefix) {
+void QuicDecrypter::DiversifyPreliminaryKey(
+    quiche::QuicheStringPiece preliminary_key,
+    quiche::QuicheStringPiece nonce_prefix,
+    const DiversificationNonce& nonce,
+    size_t key_size,
+    size_t nonce_prefix_size,
+    std::string* out_key,
+    std::string* out_nonce_prefix) {
   QuicHKDF hkdf((std::string(preliminary_key)) + (std::string(nonce_prefix)),
-                QuicStringPiece(nonce.data(), nonce.size()),
+                quiche::QuicheStringPiece(nonce.data(), nonce.size()),
                 "QUIC key diversification", 0, key_size, 0, nonce_prefix_size,
                 0);
   *out_key = std::string(hkdf.server_write_key());
diff --git a/quic/core/crypto/quic_decrypter.h b/quic/core/crypto/quic_decrypter.h
index aed18e4..7f4d93d 100644
--- a/quic/core/crypto/quic_decrypter.h
+++ b/quic/core/crypto/quic_decrypter.h
@@ -14,7 +14,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
 #include "net/third_party/quiche/src/quic/core/quic_packets.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -38,7 +38,7 @@
   //
   // If this function is called, neither |SetKey| nor |SetNoncePrefix| may be
   // called.
-  virtual bool SetPreliminaryKey(QuicStringPiece key) = 0;
+  virtual bool SetPreliminaryKey(quiche::QuicheStringPiece key) = 0;
 
   // SetDiversificationNonce uses |nonce| to derive final keys based on the
   // input keying material given by calling |SetPreliminaryKey|.
@@ -56,8 +56,8 @@
   // TODO(wtc): add a way for DecryptPacket to report decryption failure due
   // to non-authentic inputs, as opposed to other reasons for failure.
   virtual bool DecryptPacket(uint64_t packet_number,
-                             QuicStringPiece associated_data,
-                             QuicStringPiece ciphertext,
+                             quiche::QuicheStringPiece associated_data,
+                             quiche::QuicheStringPiece ciphertext,
                              char* output,
                              size_t* output_length,
                              size_t max_output_length) = 0;
@@ -74,11 +74,11 @@
   virtual uint32_t cipher_id() const = 0;
 
   // For use by unit tests only.
-  virtual QuicStringPiece GetKey() const = 0;
-  virtual QuicStringPiece GetNoncePrefix() const = 0;
+  virtual quiche::QuicheStringPiece GetKey() const = 0;
+  virtual quiche::QuicheStringPiece GetNoncePrefix() const = 0;
 
-  static void DiversifyPreliminaryKey(QuicStringPiece preliminary_key,
-                                      QuicStringPiece nonce_prefix,
+  static void DiversifyPreliminaryKey(quiche::QuicheStringPiece preliminary_key,
+                                      quiche::QuicheStringPiece nonce_prefix,
                                       const DiversificationNonce& nonce,
                                       size_t key_size,
                                       size_t nonce_prefix_size,
diff --git a/quic/core/crypto/quic_encrypter.h b/quic/core/crypto/quic_encrypter.h
index d318329..6fe552d 100644
--- a/quic/core/crypto/quic_encrypter.h
+++ b/quic/core/crypto/quic_encrypter.h
@@ -11,7 +11,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/quic_crypter.h"
 #include "net/third_party/quiche/src/quic/core/quic_packets.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -36,8 +36,8 @@
   // |associated_data|. If |output| overlaps with |plaintext| then
   // |plaintext| must be <= |output|.
   virtual bool EncryptPacket(uint64_t packet_number,
-                             QuicStringPiece associated_data,
-                             QuicStringPiece plaintext,
+                             quiche::QuicheStringPiece associated_data,
+                             quiche::QuicheStringPiece plaintext,
                              char* output,
                              size_t* output_length,
                              size_t max_output_length) = 0;
@@ -46,7 +46,8 @@
   // generate a mask to use for header protection, and returns that mask. On
   // success, the mask will be at least 5 bytes long; on failure the string will
   // be empty.
-  virtual std::string GenerateHeaderProtectionMask(QuicStringPiece sample) = 0;
+  virtual std::string GenerateHeaderProtectionMask(
+      quiche::QuicheStringPiece sample) = 0;
 
   // Returns the maximum length of plaintext that can be encrypted
   // to ciphertext no larger than |ciphertext_size|.
@@ -57,8 +58,8 @@
   virtual size_t GetCiphertextSize(size_t plaintext_size) const = 0;
 
   // For use by unit tests only.
-  virtual QuicStringPiece GetKey() const = 0;
-  virtual QuicStringPiece GetNoncePrefix() const = 0;
+  virtual quiche::QuicheStringPiece GetKey() const = 0;
+  virtual quiche::QuicheStringPiece GetNoncePrefix() const = 0;
 };
 
 }  // namespace quic
diff --git a/quic/core/crypto/quic_hkdf.cc b/quic/core/crypto/quic_hkdf.cc
index 1bd9ad5..28cf4a9 100644
--- a/quic/core/crypto/quic_hkdf.cc
+++ b/quic/core/crypto/quic_hkdf.cc
@@ -9,15 +9,16 @@
 #include "third_party/boringssl/src/include/openssl/digest.h"
 #include "third_party/boringssl/src/include/openssl/hkdf.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
 const size_t kSHA256HashLength = 32;
 const size_t kMaxKeyMaterialSize = kSHA256HashLength * 256;
 
-QuicHKDF::QuicHKDF(QuicStringPiece secret,
-                   QuicStringPiece salt,
-                   QuicStringPiece info,
+QuicHKDF::QuicHKDF(quiche::QuicheStringPiece secret,
+                   quiche::QuicheStringPiece salt,
+                   quiche::QuicheStringPiece info,
                    size_t key_bytes_to_generate,
                    size_t iv_bytes_to_generate,
                    size_t subkey_secret_bytes_to_generate)
@@ -30,9 +31,9 @@
                iv_bytes_to_generate,
                subkey_secret_bytes_to_generate) {}
 
-QuicHKDF::QuicHKDF(QuicStringPiece secret,
-                   QuicStringPiece salt,
-                   QuicStringPiece info,
+QuicHKDF::QuicHKDF(quiche::QuicheStringPiece secret,
+                   quiche::QuicheStringPiece salt,
+                   quiche::QuicheStringPiece info,
                    size_t client_key_bytes_to_generate,
                    size_t server_key_bytes_to_generate,
                    size_t client_iv_bytes_to_generate,
@@ -59,44 +60,44 @@
 
   size_t j = 0;
   if (client_key_bytes_to_generate) {
-    client_write_key_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                        client_key_bytes_to_generate);
+    client_write_key_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), client_key_bytes_to_generate);
     j += client_key_bytes_to_generate;
   }
 
   if (server_key_bytes_to_generate) {
-    server_write_key_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                        server_key_bytes_to_generate);
+    server_write_key_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), server_key_bytes_to_generate);
     j += server_key_bytes_to_generate;
   }
 
   if (client_iv_bytes_to_generate) {
-    client_write_iv_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                       client_iv_bytes_to_generate);
+    client_write_iv_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), client_iv_bytes_to_generate);
     j += client_iv_bytes_to_generate;
   }
 
   if (server_iv_bytes_to_generate) {
-    server_write_iv_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                       server_iv_bytes_to_generate);
+    server_write_iv_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), server_iv_bytes_to_generate);
     j += server_iv_bytes_to_generate;
   }
 
   if (subkey_secret_bytes_to_generate) {
-    subkey_secret_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                     subkey_secret_bytes_to_generate);
+    subkey_secret_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), subkey_secret_bytes_to_generate);
     j += subkey_secret_bytes_to_generate;
   }
   // Repeat client and server key bytes for header protection keys.
   if (client_key_bytes_to_generate) {
-    client_hp_key_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                     client_key_bytes_to_generate);
+    client_hp_key_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), client_key_bytes_to_generate);
     j += client_key_bytes_to_generate;
   }
 
   if (server_key_bytes_to_generate) {
-    server_hp_key_ = QuicStringPiece(reinterpret_cast<char*>(&output_[j]),
-                                     server_key_bytes_to_generate);
+    server_hp_key_ = quiche::QuicheStringPiece(
+        reinterpret_cast<char*>(&output_[j]), server_key_bytes_to_generate);
     j += server_key_bytes_to_generate;
   }
 }
diff --git a/quic/core/crypto/quic_hkdf.h b/quic/core/crypto/quic_hkdf.h
index 94d45bc..2945173 100644
--- a/quic/core/crypto/quic_hkdf.h
+++ b/quic/core/crypto/quic_hkdf.h
@@ -8,7 +8,7 @@
 #include <vector>
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_export.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 {
 
@@ -31,18 +31,18 @@
   // client and server.
   // |subkey_secret_bytes_to_generate|: the number of bytes of subkey secret to
   // generate, shared between client and server.
-  QuicHKDF(QuicStringPiece secret,
-           QuicStringPiece salt,
-           QuicStringPiece info,
+  QuicHKDF(quiche::QuicheStringPiece secret,
+           quiche::QuicheStringPiece salt,
+           quiche::QuicheStringPiece info,
            size_t key_bytes_to_generate,
            size_t iv_bytes_to_generate,
            size_t subkey_secret_bytes_to_generate);
 
   // An alternative constructor that allows the client and server key/IV
   // lengths to be different.
-  QuicHKDF(QuicStringPiece secret,
-           QuicStringPiece salt,
-           QuicStringPiece info,
+  QuicHKDF(quiche::QuicheStringPiece secret,
+           quiche::QuicheStringPiece salt,
+           quiche::QuicheStringPiece info,
            size_t client_key_bytes_to_generate,
            size_t server_key_bytes_to_generate,
            size_t client_iv_bytes_to_generate,
@@ -51,24 +51,28 @@
 
   ~QuicHKDF();
 
-  QuicStringPiece client_write_key() const { return client_write_key_; }
-  QuicStringPiece client_write_iv() const { return client_write_iv_; }
-  QuicStringPiece server_write_key() const { return server_write_key_; }
-  QuicStringPiece server_write_iv() const { return server_write_iv_; }
-  QuicStringPiece subkey_secret() const { return subkey_secret_; }
-  QuicStringPiece client_hp_key() const { return client_hp_key_; }
-  QuicStringPiece server_hp_key() const { return server_hp_key_; }
+  quiche::QuicheStringPiece client_write_key() const {
+    return client_write_key_;
+  }
+  quiche::QuicheStringPiece client_write_iv() const { return client_write_iv_; }
+  quiche::QuicheStringPiece server_write_key() const {
+    return server_write_key_;
+  }
+  quiche::QuicheStringPiece server_write_iv() const { return server_write_iv_; }
+  quiche::QuicheStringPiece subkey_secret() const { return subkey_secret_; }
+  quiche::QuicheStringPiece client_hp_key() const { return client_hp_key_; }
+  quiche::QuicheStringPiece server_hp_key() const { return server_hp_key_; }
 
  private:
   std::vector<uint8_t> output_;
 
-  QuicStringPiece client_write_key_;
-  QuicStringPiece server_write_key_;
-  QuicStringPiece client_write_iv_;
-  QuicStringPiece server_write_iv_;
-  QuicStringPiece subkey_secret_;
-  QuicStringPiece client_hp_key_;
-  QuicStringPiece server_hp_key_;
+  quiche::QuicheStringPiece client_write_key_;
+  quiche::QuicheStringPiece server_write_key_;
+  quiche::QuicheStringPiece client_write_iv_;
+  quiche::QuicheStringPiece server_write_iv_;
+  quiche::QuicheStringPiece subkey_secret_;
+  quiche::QuicheStringPiece client_hp_key_;
+  quiche::QuicheStringPiece server_hp_key_;
 };
 
 }  // namespace quic
diff --git a/quic/core/crypto/quic_hkdf_test.cc b/quic/core/crypto/quic_hkdf_test.cc
index e40bebf..92dc085 100644
--- a/quic/core/crypto/quic_hkdf_test.cc
+++ b/quic/core/crypto/quic_hkdf_test.cc
@@ -8,7 +8,7 @@
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_arraysize.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 namespace test {
@@ -71,10 +71,11 @@
     const HKDFInput& test(kHKDFInputs[i]);
     SCOPED_TRACE(i);
 
-    const std::string key = QuicTextUtils::HexDecode(test.key_hex);
-    const std::string salt = QuicTextUtils::HexDecode(test.salt_hex);
-    const std::string info = QuicTextUtils::HexDecode(test.info_hex);
-    const std::string expected = QuicTextUtils::HexDecode(test.output_hex);
+    const std::string key = quiche::QuicheTextUtils::HexDecode(test.key_hex);
+    const std::string salt = quiche::QuicheTextUtils::HexDecode(test.salt_hex);
+    const std::string info = quiche::QuicheTextUtils::HexDecode(test.info_hex);
+    const std::string expected =
+        quiche::QuicheTextUtils::HexDecode(test.output_hex);
 
     // We set the key_length to the length of the expected output and then take
     // the result from the first key, which is the client write key.
diff --git a/quic/core/crypto/tls_connection.cc b/quic/core/crypto/tls_connection.cc
index d28db22..4c59d3e 100644
--- a/quic/core/crypto/tls_connection.cc
+++ b/quic/core/crypto/tls_connection.cc
@@ -5,6 +5,7 @@
 #include "net/third_party/quiche/src/quic/core/crypto/tls_connection.h"
 
 #include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -136,7 +137,7 @@
                                         size_t len) {
   ConnectionFromSsl(ssl)->delegate_->WriteMessage(
       QuicEncryptionLevel(level),
-      QuicStringPiece(reinterpret_cast<const char*>(data), len));
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(data), len));
   return 1;
 }
 
diff --git a/quic/core/crypto/tls_connection.h b/quic/core/crypto/tls_connection.h
index fd4f64b..cd9cec0 100644
--- a/quic/core/crypto/tls_connection.h
+++ b/quic/core/crypto/tls_connection.h
@@ -9,7 +9,7 @@
 
 #include "third_party/boringssl/src/include/openssl/ssl.h"
 #include "net/third_party/quiche/src/quic/core/quic_types.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 {
 
@@ -45,7 +45,8 @@
     // WriteMessage is called when there is |data| from the TLS stack ready for
     // the QUIC stack to write in a crypto frame. The data must be transmitted
     // at encryption level |level|.
-    virtual void WriteMessage(EncryptionLevel level, QuicStringPiece data) = 0;
+    virtual void WriteMessage(EncryptionLevel level,
+                              quiche::QuicheStringPiece data) = 0;
 
     // FlushFlight is called to signal that the current flight of messages have
     // all been written (via calls to WriteMessage) and can be flushed to the
diff --git a/quic/core/crypto/tls_server_connection.cc b/quic/core/crypto/tls_server_connection.cc
index f539a08..bdc941a 100644
--- a/quic/core/crypto/tls_server_connection.cc
+++ b/quic/core/crypto/tls_server_connection.cc
@@ -4,6 +4,8 @@
 
 #include "net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h"
 
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+
 namespace quic {
 
 TlsServerConnection::TlsServerConnection(SSL_CTX* ssl_ctx, Delegate* delegate)
@@ -66,7 +68,7 @@
                                                              size_t in_len) {
   return ConnectionFromSsl(ssl)->delegate_->PrivateKeySign(
       out, out_len, max_out, sig_alg,
-      QuicStringPiece(reinterpret_cast<const char*>(in), in_len));
+      quiche::QuicheStringPiece(reinterpret_cast<const char*>(in), in_len));
 }
 
 // static
diff --git a/quic/core/crypto/tls_server_connection.h b/quic/core/crypto/tls_server_connection.h
index 96d71e2..85ce7e7 100644
--- a/quic/core/crypto/tls_server_connection.h
+++ b/quic/core/crypto/tls_server_connection.h
@@ -6,6 +6,7 @@
 #define QUICHE_QUIC_CORE_CRYPTO_TLS_SERVER_CONNECTION_H_
 
 #include "net/third_party/quiche/src/quic/core/crypto/tls_connection.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
@@ -41,11 +42,12 @@
     // ssl_private_key_failure is returned. Otherwise, ssl_private_key_success
     // is returned with the signature put in |*out| and the length in
     // |*out_len|.
-    virtual ssl_private_key_result_t PrivateKeySign(uint8_t* out,
-                                                    size_t* out_len,
-                                                    size_t max_out,
-                                                    uint16_t sig_alg,
-                                                    QuicStringPiece in) = 0;
+    virtual ssl_private_key_result_t PrivateKeySign(
+        uint8_t* out,
+        size_t* out_len,
+        size_t max_out,
+        uint16_t sig_alg,
+        quiche::QuicheStringPiece in) = 0;
 
     // When PrivateKeySign returns ssl_private_key_retry, PrivateKeyComplete
     // will be called after the async sign operation has completed.
diff --git a/quic/core/crypto/transport_parameters.cc b/quic/core/crypto/transport_parameters.cc
index a870017..7e1cf44 100644
--- a/quic/core/crypto/transport_parameters.cc
+++ b/quic/core/crypto/transport_parameters.cc
@@ -18,7 +18,8 @@
 #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/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_text_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
 
 namespace quic {
 
@@ -104,7 +105,7 @@
     case TransportParameters::kGoogleQuicVersion:
       return "google-version";
   }
-  return "Unknown(" + QuicTextUtils::Uint64ToString(param_id) + ")";
+  return "Unknown(" + quiche::QuicheTextUtils::Uint64ToString(param_id) + ")";
 }
 
 }  // namespace
@@ -198,7 +199,7 @@
   }
   std::string rv = for_use_in_list ? " " : "";
   rv += TransportParameterIdToString(param_id_) + " ";
-  rv += QuicTextUtils::Uint64ToString(value_);
+  rv += quiche::QuicheTextUtils::Uint64ToString(value_);
   if (!IsValid()) {
     rv += " (Invalid)";
   }
@@ -230,7 +231,7 @@
   return "[" + ipv4_socket_address.ToString() + " " +
          ipv6_socket_address.ToString() + " connection_id " +
          connection_id.ToString() + " stateless_reset_token " +
-         QuicTextUtils::HexEncode(
+         quiche::QuicheTextUtils::HexEncode(
              reinterpret_cast<const char*>(stateless_reset_token.data()),
              stateless_reset_token.size()) +
          "]";
@@ -262,7 +263,7 @@
   rv += idle_timeout_milliseconds.ToString(/*for_use_in_list=*/true);
   if (!stateless_reset_token.empty()) {
     rv += " " + TransportParameterIdToString(kStatelessResetToken) + " " +
-          QuicTextUtils::HexEncode(
+          quiche::QuicheTextUtils::HexEncode(
               reinterpret_cast<const char*>(stateless_reset_token.data()),
               stateless_reset_token.size());
   }
@@ -289,8 +290,8 @@
   }
   rv += "]";
   for (const auto& kv : custom_parameters) {
-    rv += " 0x" + QuicTextUtils::Hex(static_cast<uint32_t>(kv.first));
-    rv += "=" + QuicTextUtils::HexEncode(kv.second);
+    rv += " 0x" + quiche::QuicheTextUtils::Hex(static_cast<uint32_t>(kv.first));
+    rv += "=" + quiche::QuicheTextUtils::HexEncode(kv.second);
   }
   return rv;
 }
@@ -749,7 +750,7 @@
           QUIC_DLOG(ERROR) << "Received a second Google parameter";
           return false;
         }
-        QuicStringPiece serialized_params(
+        quiche::QuicheStringPiece serialized_params(
             reinterpret_cast<const char*>(CBS_data(&value)), CBS_len(&value));
         out->google_quic_params = CryptoFramer::ParseMessage(serialized_params);
       } break;
diff --git a/quic/core/crypto/transport_parameters.h b/quic/core/crypto/transport_parameters.h
index c5ec1a4..07b0132 100644
--- a/quic/core/crypto/transport_parameters.h
+++ b/quic/core/crypto/transport_parameters.h
@@ -15,6 +15,7 @@
 #include "net/third_party/quiche/src/quic/core/quic_types.h"
 #include "net/third_party/quiche/src/quic/core/quic_versions.h"
 #include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
 
 namespace quic {
 
diff --git a/quic/core/crypto/transport_parameters_test.cc b/quic/core/crypto/transport_parameters_test.cc
index 8fa7a0b..77638e2 100644
--- a/quic/core/crypto/transport_parameters_test.cc
+++ b/quic/core/crypto/transport_parameters_test.cc
@@ -13,6 +13,7 @@
 #include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.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_string_piece.h"
 
 namespace quic {
 namespace test {
@@ -644,7 +645,7 @@
   ASSERT_NE(new_params.google_quic_params.get(), nullptr);
   EXPECT_EQ(new_params.google_quic_params->tag(),
             orig_params.google_quic_params->tag());
-  QuicStringPiece test_string;
+  quiche::QuicheStringPiece test_string;
   EXPECT_TRUE(new_params.google_quic_params->GetStringPiece(42, &test_string));
   EXPECT_EQ(test_string, kTestString);
   uint32_t test_value;
