Replace QuicString with std::string, pass 1
This replaces QuicString with std::string in all of the "QUIC proper". I will
delete QuicString once all code using it is gone.
gfe-relnote: n/a (no functional change)
PiperOrigin-RevId: 237872023
Change-Id: I82de62c9855516b15039734d05155917e68ff4ee
diff --git a/quic/core/crypto/curve25519_key_exchange.cc b/quic/core/crypto/curve25519_key_exchange.cc
index 368b453..9c8e5ed 100644
--- a/quic/core/crypto/curve25519_key_exchange.cc
+++ b/quic/core/crypto/curve25519_key_exchange.cc
@@ -20,7 +20,8 @@
~Curve25519KeyExchangeFactory() override = default;
std::unique_ptr<KeyExchange> Create(QuicRandom* rand) const override {
- const QuicString private_value = Curve25519KeyExchange::NewPrivateKey(rand);
+ const std::string private_value =
+ Curve25519KeyExchange::NewPrivateKey(rand);
return Curve25519KeyExchange::New(private_value);
}
@@ -58,10 +59,10 @@
}
// static
-QuicString Curve25519KeyExchange::NewPrivateKey(QuicRandom* rand) {
+std::string Curve25519KeyExchange::NewPrivateKey(QuicRandom* rand) {
uint8_t private_key[X25519_PRIVATE_KEY_LEN];
rand->RandBytes(private_key, sizeof(private_key));
- return QuicString(reinterpret_cast<char*>(private_key), sizeof(private_key));
+ return std::string(reinterpret_cast<char*>(private_key), sizeof(private_key));
}
const Curve25519KeyExchange::Factory& Curve25519KeyExchange::GetFactory()
@@ -72,7 +73,7 @@
bool Curve25519KeyExchange::CalculateSharedKey(
QuicStringPiece peer_public_value,
- QuicString* out_result) const {
+ std::string* out_result) const {
if (peer_public_value.size() != X25519_PUBLIC_VALUE_LEN) {
return false;
}
@@ -89,7 +90,7 @@
void Curve25519KeyExchange::CalculateSharedKey(
QuicStringPiece peer_public_value,
- QuicString* shared_key,
+ std::string* shared_key,
std::unique_ptr<Callback> callback) const {
callback->Run(CalculateSharedKey(peer_public_value, shared_key));
}