Remove Http2String wrapper for std::string.
gfe-relnote: n/a, no functional change.
PiperOrigin-RevId: 263816460
Change-Id: I4f365540414e6a3d78fd00ce6b39a4cdd4c14140
diff --git a/http2/hpack/decoder/hpack_block_collector.cc b/http2/hpack/decoder/hpack_block_collector.cc
index 1137be5..3490ca7 100644
--- a/http2/hpack/decoder/hpack_block_collector.cc
+++ b/http2/hpack/decoder/hpack_block_collector.cc
@@ -77,14 +77,14 @@
HpackEntryType type,
size_t index,
bool value_huffman,
- const Http2String& value) {
+ const std::string& value) {
entries_.push_back(HpackEntryCollector(type, index, value_huffman, value));
}
void HpackBlockCollector::ExpectLiteralNameAndValue(HpackEntryType type,
bool name_huffman,
- const Http2String& name,
+ const std::string& name,
bool value_huffman,
- const Http2String& value) {
+ const std::string& value) {
entries_.push_back(
HpackEntryCollector(type, name_huffman, name, value_huffman, value));
}
diff --git a/http2/hpack/decoder/hpack_block_collector.h b/http2/hpack/decoder/hpack_block_collector.h
index 6ad1405..0d8f811 100644
--- a/http2/hpack/decoder/hpack_block_collector.h
+++ b/http2/hpack/decoder/hpack_block_collector.h
@@ -15,6 +15,7 @@
#include <stddef.h>
+#include <string>
#include <vector>
#include "testing/gtest/include/gtest/gtest.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.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"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
@@ -66,14 +66,14 @@
void ExpectNameIndexAndLiteralValue(HpackEntryType type,
size_t index,
bool value_huffman,
- const Http2String& value);
+ const std::string& value);
// Add an HPACK entry for a header entry with a literal name and value.
void ExpectLiteralNameAndValue(HpackEntryType type,
bool name_huffman,
- const Http2String& name,
+ const std::string& name,
bool value_huffman,
- const Http2String& value);
+ const std::string& value);
// Shuffle the entries, in support of generating an HPACK block of entries
// in some random order.
diff --git a/http2/hpack/decoder/hpack_block_decoder.cc b/http2/hpack/decoder/hpack_block_decoder.cc
index 656f8e9..bb86597 100644
--- a/http2/hpack/decoder/hpack_block_decoder.cc
+++ b/http2/hpack/decoder/hpack_block_decoder.cc
@@ -48,7 +48,7 @@
return DecodeStatus::kDecodeDone;
}
-Http2String HpackBlockDecoder::DebugString() const {
+std::string HpackBlockDecoder::DebugString() const {
return Http2StrCat("HpackBlockDecoder(", entry_decoder_.DebugString(),
", listener@",
Http2Hex(reinterpret_cast<intptr_t>(listener_)),
diff --git a/http2/hpack/decoder/hpack_block_decoder.h b/http2/hpack/decoder/hpack_block_decoder.h
index a17664f..fb44c3f 100644
--- a/http2/hpack/decoder/hpack_block_decoder.h
+++ b/http2/hpack/decoder/hpack_block_decoder.h
@@ -10,13 +10,14 @@
// or dynamic table support, so table indices remain indices at this level.
// Reports the entries to an HpackEntryDecoderListener.
+#include <string>
+
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -48,7 +49,7 @@
// first byte of a new HPACK entry)?
bool before_entry() const { return before_entry_; }
- Http2String DebugString() const;
+ std::string DebugString() const;
private:
HpackEntryDecoder entry_decoder_;
diff --git a/http2/hpack/decoder/hpack_block_decoder_test.cc b/http2/hpack/decoder/hpack_block_decoder_test.cc
index fce45b2..4988b5c 100644
--- a/http2/hpack/decoder/hpack_block_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_block_decoder_test.cc
@@ -7,6 +7,7 @@
// Tests of HpackBlockDecoder.
#include <cstdint>
+#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
@@ -67,14 +68,14 @@
AssertionResult DecodeHpackExampleAndValidateSeveralWays(
Http2StringPiece hpack_example,
Validator validator) {
- Http2String input = HpackExampleToStringOrDie(hpack_example);
+ std::string input = HpackExampleToStringOrDie(hpack_example);
DecodeBuffer db(input);
return DecodeAndValidateSeveralWays(&db, validator);
}
uint8_t Rand8() { return Random().Rand8(); }
- Http2String Rand8String() { return Random().RandString(Rand8()); }
+ std::string Rand8String() { return Random().RandString(Rand8()); }
HpackBlockCollector collector_;
HpackEntryDecoderVLoggingListener listener_;
@@ -157,7 +158,7 @@
}
// http://httpwg.org/specs/rfc7541.html#rfc.section.C.3.1
TEST_F(HpackBlockDecoderTest, SpecExample_C_3_1) {
- Http2String example = R"(
+ std::string example = R"(
82 | == Indexed - Add ==
| idx = 2
| -> :method: GET
@@ -191,7 +192,7 @@
// http://httpwg.org/specs/rfc7541.html#rfc.section.C.5.1
TEST_F(HpackBlockDecoderTest, SpecExample_C_5_1) {
- Http2String example = R"(
+ std::string example = R"(
48 | == Literal indexed ==
| Indexed name (idx = 8)
| :status
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
index 76431a6..6a20008 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -9,7 +9,6 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_estimate_memory_usage.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -168,7 +167,7 @@
<< state_ << ", backing=" << backing_;
if (state_ != State::RESET && backing_ == Backing::UNBUFFERED) {
HTTP2_DVLOG(2)
- << "HpackDecoderStringBuffer buffering Http2String of length "
+ << "HpackDecoderStringBuffer buffering std::string of length "
<< value_.size();
buffer_.assign(value_.data(), value_.size());
if (state_ == State::COMPLETE) {
@@ -194,7 +193,7 @@
return value_;
}
-Http2String HpackDecoderStringBuffer::ReleaseString() {
+std::string HpackDecoderStringBuffer::ReleaseString() {
HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::ReleaseString";
DCHECK_EQ(state_, State::COMPLETE);
DCHECK_EQ(backing_, Backing::BUFFERED);
@@ -203,7 +202,7 @@
if (backing_ == Backing::BUFFERED) {
return std::move(buffer_);
} else {
- return Http2String(value_);
+ return std::string(value_);
}
}
return "";
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.h b/http2/hpack/decoder/hpack_decoder_string_buffer.h
index 8a810b2..d8dce6c 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.h
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.h
@@ -12,10 +12,10 @@
#include <stddef.h>
#include <ostream>
+#include <string>
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.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 {
@@ -58,7 +58,7 @@
// unless the string has been buffered (to avoid forcing a potentially
// unnecessary copy). ReleaseString() also resets the instance so that it can
// be used to collect another string.
- Http2String ReleaseString();
+ std::string ReleaseString();
State state_for_testing() const { return state_; }
Backing backing_for_testing() const { return backing_; }
@@ -70,7 +70,7 @@
private:
// Storage for the string being buffered, if buffering is necessary
// (e.g. if Huffman encoded, buffer_ is storage for the decoded string).
- Http2String buffer_;
+ std::string buffer_;
// The Http2StringPiece to be returned by HpackDecoderStringBuffer::str(). If
// a string has been collected, but not buffered, value_ points to that
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
index 11b0d97..ec807c8 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -11,7 +11,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
@@ -33,11 +32,11 @@
// We want to know that HTTP2_LOG(x) << buf_ will work in production should
// that be needed, so we test that it outputs the expected values.
- AssertionResult VerifyLogHasSubstrs(std::initializer_list<Http2String> strs) {
+ AssertionResult VerifyLogHasSubstrs(std::initializer_list<std::string> strs) {
HTTP2_VLOG(1) << buf_;
std::ostringstream ss;
buf_.OutputDebugStringTo(ss);
- Http2String dbg_str(ss.str());
+ std::string dbg_str(ss.str());
for (const auto& expected : strs) {
VERIFY_THAT(dbg_str, HasSubstr(expected));
}
@@ -153,7 +152,7 @@
}
TEST_F(HpackDecoderStringBufferTest, HuffmanWhole) {
- Http2String encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
+ std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
Http2StringPiece decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
@@ -172,15 +171,15 @@
EXPECT_TRUE(VerifyLogHasSubstrs(
{"{state=COMPLETE", "backing=BUFFERED", "buffer: www.example.com}"}));
- Http2String s = buf_.ReleaseString();
+ std::string s = buf_.ReleaseString();
EXPECT_EQ(s, decoded);
EXPECT_EQ(state(), State::RESET);
}
TEST_F(HpackDecoderStringBufferTest, HuffmanSplit) {
- Http2String encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
- Http2String part1 = encoded.substr(0, 5);
- Http2String part2 = encoded.substr(5);
+ std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
+ std::string part1 = encoded.substr(0, 5);
+ std::string part2 = encoded.substr(5);
Http2StringPiece decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
@@ -217,7 +216,7 @@
TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnData) {
// Explicitly encode the End-of-String symbol, a no-no.
- Http2String encoded = Http2HexDecode("ffffffff");
+ std::string encoded = Http2HexDecode("ffffffff");
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
EXPECT_EQ(state(), State::COLLECTING);
@@ -231,7 +230,7 @@
TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnEnd) {
// Last byte of string doesn't end with prefix of End-of-String symbol.
- Http2String encoded = Http2HexDecode("00");
+ std::string encoded = Http2HexDecode("00");
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
EXPECT_EQ(state(), State::COLLECTING);
diff --git a/http2/hpack/decoder/hpack_decoder_tables_test.cc b/http2/hpack/decoder/hpack_decoder_tables_test.cc
index 592ce56..db4ada1 100644
--- a/http2/hpack/decoder/hpack_decoder_tables_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_tables_test.cc
@@ -5,6 +5,7 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
#include <algorithm>
+#include <string>
#include <tuple>
#include <vector>
@@ -12,7 +13,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_util.h"
@@ -96,7 +96,7 @@
EXPECT_TRUE(VerifyStaticTableContents());
}
-size_t Size(const Http2String& name, const Http2String& value) {
+size_t Size(const std::string& name, const std::string& value) {
return name.size() + value.size() + 32;
}
@@ -105,11 +105,11 @@
// dynamic table containing FakeHpackEntry instances. We can thus compare the
// contents of the actual table with those in fake_dynamic_table_.
-typedef std::tuple<Http2String, Http2String, size_t> FakeHpackEntry;
-const Http2String& Name(const FakeHpackEntry& entry) {
+typedef std::tuple<std::string, std::string, size_t> FakeHpackEntry;
+const std::string& Name(const FakeHpackEntry& entry) {
return std::get<0>(entry);
}
-const Http2String& Value(const FakeHpackEntry& entry) {
+const std::string& Value(const FakeHpackEntry& entry) {
return std::get<1>(entry);
}
size_t Size(const FakeHpackEntry& entry) {
@@ -133,7 +133,7 @@
}
// Insert the name and value into fake_dynamic_table_.
- void FakeInsert(const Http2String& name, const Http2String& value) {
+ void FakeInsert(const std::string& name, const std::string& value) {
FakeHpackEntry entry(name, value, Size(name, value));
fake_dynamic_table_.insert(fake_dynamic_table_.begin(), entry);
}
@@ -204,7 +204,7 @@
// Insert an entry into the dynamic table, confirming that trimming of entries
// occurs if the total size is greater than the limit, and that older entries
// move up by 1 index.
- AssertionResult Insert(const Http2String& name, const Http2String& value) {
+ AssertionResult Insert(const std::string& name, const std::string& value) {
size_t old_count = num_dynamic_entries();
if (tables_.Insert(HpackString(name), HpackString(value))) {
VERIFY_GT(current_dynamic_size(), 0u);
@@ -251,9 +251,9 @@
for (size_t limit : table_sizes) {
ASSERT_TRUE(DynamicTableSizeUpdate(limit));
for (int insert_count = 0; insert_count < 100; ++insert_count) {
- Http2String name =
+ std::string name =
GenerateHttp2HeaderName(random_.UniformInRange(2, 40), RandomPtr());
- Http2String value =
+ std::string value =
GenerateWebSafeString(random_.UniformInRange(2, 600), RandomPtr());
ASSERT_TRUE(Insert(name, value));
}
diff --git a/http2/hpack/decoder/hpack_decoder_test.cc b/http2/hpack/decoder/hpack_decoder_test.cc
index bf2cee5..9734bdd 100644
--- a/http2/hpack/decoder/hpack_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_test.cc
@@ -6,6 +6,7 @@
// Tests of HpackDecoder.
+#include <string>
#include <tuple>
#include <utility>
#include <vector>
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_example.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_util.h"
@@ -57,7 +57,7 @@
namespace {
-typedef std::tuple<HpackEntryType, Http2String, Http2String> HpackHeaderEntry;
+typedef std::tuple<HpackEntryType, std::string, std::string> HpackHeaderEntry;
typedef std::vector<HpackHeaderEntry> HpackHeaderEntries;
// TODO(jamessynge): Create a ...test_utils.h file with the mock listener
@@ -121,7 +121,7 @@
// error_message may be used in a GOAWAY frame as the Opaque Data.
void OnHeaderErrorDetected(Http2StringPiece error_message) override {
ASSERT_TRUE(saw_start_);
- error_messages_.push_back(Http2String(error_message));
+ error_messages_.push_back(std::string(error_message));
// No further callbacks should be made at this point, so replace 'this' as
// the listener with mock_listener_, which is a strict mock, so will
// generate an error for any calls.
@@ -219,7 +219,7 @@
HpackDecoder decoder_;
testing::StrictMock<MockHpackDecoderListener> mock_listener_;
HpackHeaderEntries header_entries_;
- std::vector<Http2String> error_messages_;
+ std::vector<std::string> error_messages_;
bool fragment_the_hpack_block_;
bool saw_start_ = false;
bool saw_end_ = false;
@@ -232,7 +232,7 @@
// http://httpwg.org/specs/rfc7541.html#rfc.section.C.3
TEST_P(HpackDecoderTest, C3_RequestExamples) {
// C.3.1 First Request
- Http2String hpack_block = HpackExampleToStringOrDie(R"(
+ std::string hpack_block = HpackExampleToStringOrDie(R"(
82 | == Indexed - Add ==
| idx = 2
| -> :method: GET
@@ -367,7 +367,7 @@
// http://httpwg.org/specs/rfc7541.html#rfc.section.C.4
TEST_P(HpackDecoderTest, C4_RequestExamplesWithHuffmanEncoding) {
// C.4.1 First Request
- Http2String hpack_block = HpackExampleToStringOrDie(R"(
+ std::string hpack_block = HpackExampleToStringOrDie(R"(
82 | == Indexed - Add ==
| idx = 2
| -> :method: GET
@@ -526,7 +526,7 @@
// date: Mon, 21 Oct 2013 20:13:21 GMT
// location: https://www.example.com
- Http2String hpack_block = HpackExampleToStringOrDie(R"(
+ std::string hpack_block = HpackExampleToStringOrDie(R"(
48 | == Literal indexed ==
| Indexed name (idx = 8)
| :status
@@ -751,7 +751,7 @@
// cache-control: private
// date: Mon, 21 Oct 2013 20:13:21 GMT
// location: https://www.example.com
- Http2String hpack_block = HpackExampleToStringOrDie(R"(
+ std::string hpack_block = HpackExampleToStringOrDie(R"(
48 | == Literal indexed ==
| Indexed name (idx = 8)
| :status
diff --git a/http2/hpack/decoder/hpack_entry_collector.cc b/http2/hpack/decoder/hpack_entry_collector.cc
index 327075d..7706bd6 100644
--- a/http2/hpack/decoder/hpack_entry_collector.cc
+++ b/http2/hpack/decoder/hpack_entry_collector.cc
@@ -35,7 +35,7 @@
HpackEntryCollector::HpackEntryCollector(HpackEntryType type,
size_t index,
bool value_huffman,
- const Http2String& value)
+ const std::string& value)
: header_type_(type),
index_(index),
value_(value, value_huffman),
@@ -43,9 +43,9 @@
ended_(true) {}
HpackEntryCollector::HpackEntryCollector(HpackEntryType type,
bool name_huffman,
- const Http2String& name,
+ const std::string& name,
bool value_huffman,
- const Http2String& value)
+ const std::string& value)
: header_type_(type),
index_(0),
name_(name, name_huffman),
@@ -232,8 +232,8 @@
}
}
-Http2String HpackEntryCollector::ToString() const {
- Http2String result("Type=");
+std::string HpackEntryCollector::ToString() const {
+ std::string result("Type=");
switch (header_type_) {
case HpackEntryType::kIndexedHeader:
result += "IndexedHeader";
diff --git a/http2/hpack/decoder/hpack_entry_collector.h b/http2/hpack/decoder/hpack_entry_collector.h
index c2c5fe5..6b27b7b 100644
--- a/http2/hpack/decoder/hpack_entry_collector.h
+++ b/http2/hpack/decoder/hpack_entry_collector.h
@@ -13,13 +13,13 @@
#include <stddef.h>
#include <iosfwd>
+#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.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 {
@@ -37,12 +37,12 @@
HpackEntryCollector(HpackEntryType type,
size_t index,
bool value_huffman,
- const Http2String& value);
+ const std::string& value);
HpackEntryCollector(HpackEntryType type,
bool name_huffman,
- const Http2String& name,
+ const std::string& name,
bool value_huffman,
- const Http2String& value);
+ const std::string& value);
~HpackEntryCollector() override;
@@ -122,7 +122,7 @@
void AppendToHpackBlockBuilder(HpackBlockBuilder* hbb) const;
// Returns a debug string.
- Http2String ToString() const;
+ std::string ToString() const;
private:
void Init(HpackEntryType type, size_t maybe_index);
diff --git a/http2/hpack/decoder/hpack_entry_decoder.cc b/http2/hpack/decoder/hpack_entry_decoder.cc
index 5e1bd8c..97af6f9 100644
--- a/http2/hpack/decoder/hpack_entry_decoder.cc
+++ b/http2/hpack/decoder/hpack_entry_decoder.cc
@@ -237,7 +237,7 @@
<< ", " << string_decoder_ << ")";
}
-Http2String HpackEntryDecoder::DebugString() const {
+std::string HpackEntryDecoder::DebugString() const {
std::stringstream s;
s << *this;
return s.str();
diff --git a/http2/hpack/decoder/hpack_entry_decoder.h b/http2/hpack/decoder/hpack_entry_decoder.h
index 5858c1e..1848fb6 100644
--- a/http2/hpack/decoder/hpack_entry_decoder.h
+++ b/http2/hpack/decoder/hpack_entry_decoder.h
@@ -10,6 +10,8 @@
// must provide a non-empty decode buffer. Continue with calls to Resume() if
// Start, and any subsequent calls to Resume, returns kDecodeInProgress.
+#include <string>
+
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
@@ -18,7 +20,6 @@
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -62,7 +63,7 @@
// in decoding the entry type and its varint.
DecodeStatus Resume(DecodeBuffer* db, HpackEntryDecoderListener* listener);
- Http2String DebugString() const;
+ std::string DebugString() const;
void OutputDebugString(std::ostream& out) const;
private:
diff --git a/http2/hpack/decoder/hpack_entry_decoder_test.cc b/http2/hpack/decoder/hpack_entry_decoder_test.cc
index b447e82..d4113f8 100644
--- a/http2/hpack/decoder/hpack_entry_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_entry_decoder_test.cc
@@ -167,7 +167,7 @@
for (int n = 0; n < 10; n++) {
const uint32_t ndx = 1 + Random().Rand8();
const bool value_is_huffman_encoded = (n % 2) == 0;
- const Http2String value = Random().RandString(Random().Rand8());
+ const std::string value = Random().RandString(Random().Rand8());
HpackBlockBuilder hbb;
hbb.AppendNameIndexAndLiteralValue(entry_type_, ndx,
value_is_huffman_encoded, value);
@@ -186,10 +186,10 @@
for (int n = 0; n < 10; n++) {
const bool name_is_huffman_encoded = (n & 1) == 0;
const int name_len = 1 + Random().Rand8();
- const Http2String name = Random().RandString(name_len);
+ const std::string name = Random().RandString(name_len);
const bool value_is_huffman_encoded = (n & 2) == 0;
const int value_len = Random().Skewed(10);
- const Http2String value = Random().RandString(value_len);
+ const std::string value = Random().RandString(value_len);
HpackBlockBuilder hbb;
hbb.AppendLiteralNameAndValue(entry_type_, name_is_huffman_encoded, name,
value_is_huffman_encoded, value);
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder.cc b/http2/hpack/decoder/hpack_entry_type_decoder.cc
index 7519f5a..ce91978 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder.cc
+++ b/http2/hpack/decoder/hpack_entry_type_decoder.cc
@@ -10,7 +10,7 @@
namespace http2 {
-Http2String HpackEntryTypeDecoder::DebugString() const {
+std::string HpackEntryTypeDecoder::DebugString() const {
return Http2StrCat(
"HpackEntryTypeDecoder(varint_decoder=", varint_decoder_.DebugString(),
", entry_type=", entry_type_, ")");
diff --git a/http2/hpack/decoder/hpack_entry_type_decoder.h b/http2/hpack/decoder/hpack_entry_type_decoder.h
index 092a844..bf13cf9 100644
--- a/http2/hpack/decoder/hpack_entry_type_decoder.h
+++ b/http2/hpack/decoder/hpack_entry_type_decoder.h
@@ -11,6 +11,7 @@
// zero, or is the new size limit of the dynamic table.
#include <cstdint>
+#include <string>
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
@@ -18,7 +19,6 @@
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -40,7 +40,7 @@
// preceding call to Start or Resume returned kDecodeDone.
uint64_t varint() const { return varint_decoder_.value(); }
- Http2String DebugString() const;
+ std::string DebugString() const;
private:
HpackVarintDecoder varint_decoder_;
diff --git a/http2/hpack/decoder/hpack_string_collector.cc b/http2/hpack/decoder/hpack_string_collector.cc
index 247ce9c..e903755 100644
--- a/http2/hpack/decoder/hpack_string_collector.cc
+++ b/http2/hpack/decoder/hpack_string_collector.cc
@@ -36,7 +36,7 @@
Clear();
}
-HpackStringCollector::HpackStringCollector(const Http2String& str, bool huffman)
+HpackStringCollector::HpackStringCollector(const std::string& str, bool huffman)
: s(str), len(str.size()), huffman_encoded(huffman), state(kEnded) {}
void HpackStringCollector::Clear() {
@@ -89,7 +89,7 @@
return ::testing::AssertionSuccess();
}
-Http2String HpackStringCollector::ToString() const {
+std::string HpackStringCollector::ToString() const {
std::stringstream ss;
ss << *this;
return ss.str();
diff --git a/http2/hpack/decoder/hpack_string_collector.h b/http2/hpack/decoder/hpack_string_collector.h
index 76be13b..d56abee 100644
--- a/http2/hpack/decoder/hpack_string_collector.h
+++ b/http2/hpack/decoder/hpack_string_collector.h
@@ -10,10 +10,10 @@
#include <stddef.h>
#include <iosfwd>
+#include <string>
#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_listener.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 {
@@ -29,7 +29,7 @@
};
HpackStringCollector();
- HpackStringCollector(const Http2String& str, bool huffman);
+ HpackStringCollector(const std::string& str, bool huffman);
void Clear();
bool IsClear() const;
@@ -43,9 +43,9 @@
::testing::AssertionResult Collected(Http2StringPiece str,
bool is_huffman_encoded) const;
- Http2String ToString() const;
+ std::string ToString() const;
- Http2String s;
+ std::string s;
size_t len;
bool huffman_encoded;
CollectorState state;
diff --git a/http2/hpack/decoder/hpack_string_decoder.cc b/http2/hpack/decoder/hpack_string_decoder.cc
index 0b9eb59..f74e536 100644
--- a/http2/hpack/decoder/hpack_string_decoder.cc
+++ b/http2/hpack/decoder/hpack_string_decoder.cc
@@ -8,7 +8,7 @@
namespace http2 {
-Http2String HpackStringDecoder::DebugString() const {
+std::string HpackStringDecoder::DebugString() const {
return Http2StrCat("HpackStringDecoder(state=", StateToString(state_),
", length=", length_decoder_.DebugString(),
", remaining=", remaining_,
@@ -16,7 +16,7 @@
}
// static
-Http2String HpackStringDecoder::StateToString(StringDecoderState v) {
+std::string HpackStringDecoder::StateToString(StringDecoderState v) {
switch (v) {
case kStartDecodingLength:
return "kStartDecodingLength";
diff --git a/http2/hpack/decoder/hpack_string_decoder.h b/http2/hpack/decoder/hpack_string_decoder.h
index e30b36d..0cd1742 100644
--- a/http2/hpack/decoder/hpack_string_decoder.h
+++ b/http2/hpack/decoder/hpack_string_decoder.h
@@ -13,6 +13,7 @@
#include <algorithm>
#include <cstdint>
+#include <string>
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
@@ -20,7 +21,6 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string.h"
namespace http2 {
@@ -113,10 +113,10 @@
}
}
- Http2String DebugString() const;
+ std::string DebugString() const;
private:
- static Http2String StateToString(StringDecoderState v);
+ static std::string StateToString(StringDecoderState v);
// Returns true if the length is fully decoded and the listener wants the
// decoding to continue, false otherwise; status is set to the status from
diff --git a/http2/hpack/decoder/hpack_string_decoder_test.cc b/http2/hpack/decoder/hpack_string_decoder_test.cc
index 5346999..ceeebca 100644
--- a/http2/hpack/decoder/hpack_string_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_string_decoder_test.cc
@@ -48,10 +48,10 @@
return collector_.Collected(s, huffman_encoded);
}
- // expected_str is a Http2String rather than a const Http2String& or
+ // expected_str is a std::string rather than a const std::string& or
// Http2StringPiece so that the lambda makes a copy of the string, and thus
// the string to be passed to Collected outlives the call to MakeValidator.
- Validator MakeValidator(const Http2String& expected_str,
+ Validator MakeValidator(const std::string& expected_str,
bool expected_huffman) {
return
[expected_str, expected_huffman, this](
@@ -119,8 +119,8 @@
}
TEST_F(HpackStringDecoderTest, DecodeLongStrings) {
- Http2String name = Random().RandString(1024);
- Http2String value = Random().RandString(65536);
+ std::string name = Random().RandString(1024);
+ std::string value = Random().RandString(65536);
HpackBlockBuilder hbb;
hbb.AppendString(false, name);