Remove Http2String wrapper for std::string.
gfe-relnote: n/a, no functional change.
PiperOrigin-RevId: 263816460
Change-Id: I4f365540414e6a3d78fd00ce6b39a4cdd4c14140
diff --git a/http2/test_tools/frame_parts.cc b/http2/test_tools/frame_parts.cc
index d550788..d9dffa1 100644
--- a/http2/test_tools/frame_parts.cc
+++ b/http2/test_tools/frame_parts.cc
@@ -507,7 +507,7 @@
}
AssertionResult FrameParts::AppendString(Http2StringPiece source,
- Http2String* target,
+ std::string* target,
Http2Optional<size_t>* opt_length) {
target->append(source.data(), source.size());
if (opt_length != nullptr) {
diff --git a/http2/test_tools/frame_parts.h b/http2/test_tools/frame_parts.h
index 5a7d872..598a687 100644
--- a/http2/test_tools/frame_parts.h
+++ b/http2/test_tools/frame_parts.h
@@ -13,6 +13,7 @@
#include <stddef.h>
#include <cstdint>
+#include <string>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
@@ -21,7 +22,6 @@
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_optional.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
namespace http2 {
@@ -208,15 +208,15 @@
// the optional has a value (i.e. that the necessary On*Start method has been
// called), and that target is not longer than opt_length->value().
::testing::AssertionResult AppendString(Http2StringPiece source,
- Http2String* target,
+ std::string* target,
Http2Optional<size_t>* opt_length);
const Http2FrameHeader frame_header_;
- Http2String payload_;
- Http2String padding_;
- Http2String altsvc_origin_;
- Http2String altsvc_value_;
+ std::string payload_;
+ std::string padding_;
+ std::string altsvc_origin_;
+ std::string altsvc_value_;
Http2Optional<Http2PriorityFields> opt_priority_;
Http2Optional<Http2ErrorCode> opt_rst_stream_error_code_;
diff --git a/http2/test_tools/http2_random.cc b/http2/test_tools/http2_random.cc
index 81c0366..6b61a58 100644
--- a/http2/test_tools/http2_random.cc
+++ b/http2/test_tools/http2_random.cc
@@ -17,12 +17,12 @@
}
Http2Random::Http2Random(Http2StringPiece key) {
- Http2String decoded_key = Http2HexDecode(key);
+ std::string decoded_key = Http2HexDecode(key);
CHECK_EQ(sizeof(key_), decoded_key.size());
memcpy(key_, decoded_key.data(), sizeof(key_));
}
-Http2String Http2Random::Key() const {
+std::string Http2Random::Key() const {
return Http2HexEncode(key_, sizeof(key_));
}
@@ -33,8 +33,8 @@
counter_++);
}
-Http2String Http2Random::RandString(int length) {
- Http2String result;
+std::string Http2Random::RandString(int length) {
+ std::string result;
result.resize(length);
FillRandom(&result[0], length);
return result;
@@ -58,9 +58,9 @@
return value.f - 1.0;
}
-Http2String Http2Random::RandStringWithAlphabet(int length,
+std::string Http2Random::RandStringWithAlphabet(int length,
Http2StringPiece alphabet) {
- Http2String result;
+ std::string result;
result.resize(length);
for (int i = 0; i < length; i++) {
result[i] = alphabet[Uniform(alphabet.size())];
diff --git a/http2/test_tools/http2_random.h b/http2/test_tools/http2_random.h
index def60f8..774212c 100644
--- a/http2/test_tools/http2_random.h
+++ b/http2/test_tools/http2_random.h
@@ -9,8 +9,8 @@
#include <cstdint>
#include <limits>
#include <random>
+#include <string>
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
namespace http2 {
@@ -29,10 +29,10 @@
// Reproducible random number generation: by using the same key, the same
// sequence of results is obtained.
explicit Http2Random(Http2StringPiece key);
- Http2String Key() const;
+ std::string Key() const;
void FillRandom(void* buffer, size_t buffer_size);
- Http2String RandString(int length);
+ std::string RandString(int length);
// Returns a random 64-bit value.
uint64_t Rand64();
@@ -67,7 +67,7 @@
// Return a random string consisting of the characters from the specified
// alphabet.
- Http2String RandStringWithAlphabet(int length, Http2StringPiece alphabet);
+ std::string RandStringWithAlphabet(int length, Http2StringPiece alphabet);
// STL UniformRandomNumberGenerator implementation.
using result_type = uint64_t;
diff --git a/http2/test_tools/http2_random_test.cc b/http2/test_tools/http2_random_test.cc
index a1b74f6..c9490bd 100644
--- a/http2/test_tools/http2_random_test.cc
+++ b/http2/test_tools/http2_random_test.cc
@@ -43,9 +43,9 @@
TEST(Http2RandomTest, STLShuffle) {
Http2Random random;
- const Http2String original = "abcdefghijklmonpqrsuvwxyz";
+ const std::string original = "abcdefghijklmonpqrsuvwxyz";
- Http2String shuffled = original;
+ std::string shuffled = original;
std::shuffle(shuffled.begin(), shuffled.end(), random);
EXPECT_NE(original, shuffled);
}
@@ -61,7 +61,7 @@
TEST(Http2RandomTest, RandStringWithAlphabet) {
Http2Random random;
- Http2String str = random.RandStringWithAlphabet(1000, "xyz");
+ std::string str = random.RandStringWithAlphabet(1000, "xyz");
EXPECT_EQ(1000u, str.size());
std::set<char> characters(str.begin(), str.end());