Remove Http2StringPiece; use QuicheStringPiece instead.
gfe-relnote: n/a, no functional change.
PiperOrigin-RevId: 285412823
Change-Id: I907a65813e890ce153b93fe5f07721efb3ecc195
diff --git a/http2/hpack/decoder/hpack_block_collector.cc b/http2/hpack/decoder/hpack_block_collector.cc
index 3490ca7..325a60c 100644
--- a/http2/hpack/decoder/hpack_block_collector.cc
+++ b/http2/hpack/decoder/hpack_block_collector.cc
@@ -112,7 +112,7 @@
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- Http2StringPiece expected_value) const {
+ quiche::QuicheStringPiece expected_value) const {
VERIFY_TRUE(pending_entry_.IsClear());
VERIFY_EQ(1u, entries_.size());
VERIFY_TRUE(entries_.front().ValidateLiteralValueHeader(
@@ -122,9 +122,9 @@
AssertionResult HpackBlockCollector::ValidateSoleLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- Http2StringPiece expected_name,
+ quiche::QuicheStringPiece expected_name,
bool expected_value_huffman,
- Http2StringPiece expected_value) const {
+ quiche::QuicheStringPiece expected_value) const {
VERIFY_TRUE(pending_entry_.IsClear());
VERIFY_EQ(1u, entries_.size());
VERIFY_TRUE(entries_.front().ValidateLiteralNameValueHeader(
diff --git a/http2/hpack/decoder/hpack_block_collector.h b/http2/hpack/decoder/hpack_block_collector.h
index 0d8f811..8246de4 100644
--- a/http2/hpack/decoder/hpack_block_collector.h
+++ b/http2/hpack/decoder/hpack_block_collector.h
@@ -23,8 +23,8 @@
#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_piece.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -97,16 +97,16 @@
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- Http2StringPiece expected_value) const;
+ quiche::QuicheStringPiece expected_value) const;
// Return AssertionSuccess if there is just one entry, and it is a Header
// with a literal name and literal value.
::testing::AssertionResult ValidateSoleLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- Http2StringPiece expected_name,
+ quiche::QuicheStringPiece expected_name,
bool expected_value_huffman,
- Http2StringPiece expected_value) const;
+ quiche::QuicheStringPiece expected_value) const;
bool IsNotPending() const { return pending_entry_.IsClear(); }
bool IsClear() const { return IsNotPending() && entries_.empty(); }
diff --git a/http2/hpack/decoder/hpack_block_decoder_test.cc b/http2/hpack/decoder/hpack_block_decoder_test.cc
index 4988b5c..aeb6c48 100644
--- a/http2/hpack/decoder/hpack_block_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_block_decoder_test.cc
@@ -15,10 +15,10 @@
#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/hpack/tools/hpack_example.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.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_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using ::testing::AssertionSuccess;
@@ -66,7 +66,7 @@
}
AssertionResult DecodeHpackExampleAndValidateSeveralWays(
- Http2StringPiece hpack_example,
+ quiche::QuicheStringPiece hpack_example,
Validator validator) {
std::string input = HpackExampleToStringOrDie(hpack_example);
DecodeBuffer db(input);
diff --git a/http2/hpack/decoder/hpack_decoder.cc b/http2/hpack/decoder/hpack_decoder.cc
index f2f8584..1421c7c 100644
--- a/http2/hpack/decoder/hpack_decoder.cc
+++ b/http2/hpack/decoder/hpack_decoder.cc
@@ -109,7 +109,7 @@
return Http2EstimateMemoryUsage(entry_buffer_);
}
-void HpackDecoder::ReportError(Http2StringPiece error_message) {
+void HpackDecoder::ReportError(quiche::QuicheStringPiece error_message) {
HTTP2_DVLOG(3) << "HpackDecoder::ReportError is new="
<< (!error_detected_ ? "true" : "false")
<< ", error_message: " << error_message;
diff --git a/http2/hpack/decoder/hpack_decoder.h b/http2/hpack/decoder/hpack_decoder.h
index e173bc6..663fef6 100644
--- a/http2/hpack/decoder/hpack_decoder.h
+++ b/http2/hpack/decoder/hpack_decoder.h
@@ -30,7 +30,7 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_export.h"
-#include "net/third_party/quiche/src/http2/platform/api/http2_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -102,7 +102,7 @@
friend class test::HpackDecoderPeer;
// Reports an error to the listener IF this is the first error detected.
- void ReportError(Http2StringPiece error_message);
+ void ReportError(quiche::QuicheStringPiece error_message);
// The decompressor state, as defined by HPACK (i.e. the static and dynamic
// tables).
diff --git a/http2/hpack/decoder/hpack_decoder_listener.cc b/http2/hpack/decoder/hpack_decoder_listener.cc
index 8afa8aa..60341a0 100644
--- a/http2/hpack/decoder/hpack_decoder_listener.cc
+++ b/http2/hpack/decoder/hpack_decoder_listener.cc
@@ -18,7 +18,7 @@
const HpackString& value) {}
void HpackDecoderNoOpListener::OnHeaderListEnd() {}
void HpackDecoderNoOpListener::OnHeaderErrorDetected(
- Http2StringPiece error_message) {}
+ quiche::QuicheStringPiece error_message) {}
// static
HpackDecoderNoOpListener* HpackDecoderNoOpListener::NoOpListener() {
diff --git a/http2/hpack/decoder/hpack_decoder_listener.h b/http2/hpack/decoder/hpack_decoder_listener.h
index fa68591..2db8157 100644
--- a/http2/hpack/decoder/hpack_decoder_listener.h
+++ b/http2/hpack/decoder/hpack_decoder_listener.h
@@ -11,7 +11,7 @@
#include "net/third_party/quiche/src/http2/hpack/hpack_string.h"
#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_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -39,7 +39,8 @@
// OnHeaderErrorDetected is called if an error is detected while decoding.
// error_message may be used in a GOAWAY frame as the Opaque Data.
- virtual void OnHeaderErrorDetected(Http2StringPiece error_message) = 0;
+ virtual void OnHeaderErrorDetected(
+ quiche::QuicheStringPiece error_message) = 0;
};
// A no-op implementation of HpackDecoderListener, useful for ignoring
@@ -55,7 +56,7 @@
const HpackString& name,
const HpackString& value) override;
void OnHeaderListEnd() override;
- void OnHeaderErrorDetected(Http2StringPiece error_message) override;
+ void OnHeaderErrorDetected(quiche::QuicheStringPiece error_message) override;
// Returns a listener that ignores all the calls.
static HpackDecoderNoOpListener* NoOpListener();
diff --git a/http2/hpack/decoder/hpack_decoder_state.cc b/http2/hpack/decoder/hpack_decoder_state.cc
index 921d48c..c01ae74 100644
--- a/http2/hpack/decoder/hpack_decoder_state.cc
+++ b/http2/hpack/decoder/hpack_decoder_state.cc
@@ -185,7 +185,8 @@
lowest_header_table_size_ = final_header_table_size_;
}
-void HpackDecoderState::OnHpackDecodeError(Http2StringPiece error_message) {
+void HpackDecoderState::OnHpackDecodeError(
+ quiche::QuicheStringPiece error_message) {
HTTP2_DVLOG(2) << "HpackDecoderState::OnHpackDecodeError " << error_message;
if (!error_detected_) {
ReportError(error_message);
@@ -206,7 +207,7 @@
}
}
-void HpackDecoderState::ReportError(Http2StringPiece error_message) {
+void HpackDecoderState::ReportError(quiche::QuicheStringPiece error_message) {
HTTP2_DVLOG(2) << "HpackDecoderState::ReportError is new="
<< (!error_detected_ ? "true" : "false")
<< ", error_message: " << error_message;
diff --git a/http2/hpack/decoder/hpack_decoder_state.h b/http2/hpack/decoder/hpack_decoder_state.h
index fd34179..0139b31 100644
--- a/http2/hpack/decoder/hpack_decoder_state.h
+++ b/http2/hpack/decoder/hpack_decoder_state.h
@@ -22,7 +22,7 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h"
#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_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -76,7 +76,7 @@
HpackDecoderStringBuffer* name_buffer,
HpackDecoderStringBuffer* value_buffer) override;
void OnDynamicTableSizeUpdate(size_t size) override;
- void OnHpackDecodeError(Http2StringPiece error_message) override;
+ void OnHpackDecodeError(quiche::QuicheStringPiece error_message) override;
// OnHeaderBlockEnd notifies this object that an entire HPACK block has been
// decoded, which might have extended into CONTINUATION blocks.
@@ -94,7 +94,7 @@
friend class test::HpackDecoderStatePeer;
// Reports an error to the listener IF this is the first error detected.
- void ReportError(Http2StringPiece error_message);
+ void ReportError(quiche::QuicheStringPiece error_message);
// The static and dynamic HPACK tables.
HpackDecoderTables decoder_tables_;
diff --git a/http2/hpack/decoder/hpack_decoder_state_test.cc b/http2/hpack/decoder/hpack_decoder_state_test.cc
index cbc4224..743d0d9 100644
--- a/http2/hpack/decoder/hpack_decoder_state_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_state_test.cc
@@ -15,8 +15,8 @@
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.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_piece.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -44,7 +44,8 @@
const HpackString& name,
const HpackString& value));
MOCK_METHOD0(OnHeaderListEnd, void());
- MOCK_METHOD1(OnHeaderErrorDetected, void(Http2StringPiece error_message));
+ MOCK_METHOD1(OnHeaderErrorDetected,
+ void(quiche::QuicheStringPiece error_message));
};
enum StringBacking { STATIC, UNBUFFERED, BUFFERED };
@@ -517,8 +518,8 @@
TEST_F(HpackDecoderStateTest, ErrorsSuppressCallbacks) {
SendStartAndVerifyCallback();
- EXPECT_CALL(listener_,
- OnHeaderErrorDetected(Http2StringPiece("Huffman decode error.")));
+ EXPECT_CALL(listener_, OnHeaderErrorDetected(quiche::QuicheStringPiece(
+ "Huffman decode error.")));
decoder_state_.OnHpackDecodeError("Huffman decode error.");
// Further decoded entries are ignored.
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
index 6a20008..d38ea9f 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -60,7 +60,8 @@
state_ = State::RESET;
}
-void HpackDecoderStringBuffer::Set(Http2StringPiece value, bool is_static) {
+void HpackDecoderStringBuffer::Set(quiche::QuicheStringPiece value,
+ bool is_static) {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::Set";
DCHECK_EQ(state_, State::RESET);
value_ = value;
@@ -100,7 +101,7 @@
backing_ = Backing::RESET;
// OnData is not called for empty (zero length) strings, so make sure that
// value_ is cleared.
- value_ = Http2StringPiece();
+ value_ = quiche::QuicheStringPiece();
}
}
@@ -113,7 +114,7 @@
if (is_huffman_encoded_) {
DCHECK_EQ(backing_, Backing::BUFFERED);
- return decoder_.Decode(Http2StringPiece(data, len), &buffer_);
+ return decoder_.Decode(quiche::QuicheStringPiece(data, len), &buffer_);
}
if (backing_ == Backing::RESET) {
@@ -121,7 +122,7 @@
// don't copy the string. If we later find that the HPACK entry is split
// across input buffers, then we'll copy the string into buffer_.
if (remaining_len_ == 0) {
- value_ = Http2StringPiece(data, len);
+ value_ = quiche::QuicheStringPiece(data, len);
backing_ = Backing::UNBUFFERED;
return true;
}
@@ -187,7 +188,7 @@
return IsBuffered() ? buffer_.size() : 0;
}
-Http2StringPiece HpackDecoderStringBuffer::str() const {
+quiche::QuicheStringPiece HpackDecoderStringBuffer::str() const {
HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::str";
DCHECK_EQ(state_, State::COMPLETE);
return value_;
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.h b/http2/hpack/decoder/hpack_decoder_string_buffer.h
index d8dce6c..94c46d5 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.h
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.h
@@ -16,7 +16,7 @@
#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_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -32,7 +32,7 @@
HpackDecoderStringBuffer& operator=(const HpackDecoderStringBuffer&) = delete;
void Reset();
- void Set(Http2StringPiece value, bool is_static);
+ void Set(quiche::QuicheStringPiece value, bool is_static);
// Note that for Huffman encoded strings the length of the string after
// decoding may be larger (expected), the same or even smaller; the latter
@@ -47,11 +47,11 @@
// Accessors for the completely collected string (i.e. Set or OnEnd has just
// been called, and no reset of the state has occurred).
- // Returns a Http2StringPiece pointing to the backing store for the string,
+ // Returns a QuicheStringPiece pointing to the backing store for the string,
// either the internal buffer or the original transport buffer (e.g. for a
// literal value that wasn't Huffman encoded, and that wasn't split across
// transport buffers).
- Http2StringPiece str() const;
+ quiche::QuicheStringPiece str() const;
// Returns the completely collected string by value, using std::move in an
// effort to avoid unnecessary copies. ReleaseString() must not be called
@@ -72,10 +72,10 @@
// (e.g. if Huffman encoded, buffer_ is storage for the decoded string).
std::string buffer_;
- // The Http2StringPiece to be returned by HpackDecoderStringBuffer::str(). If
+ // The QuicheStringPiece to be returned by HpackDecoderStringBuffer::str(). If
// a string has been collected, but not buffered, value_ points to that
// string.
- Http2StringPiece value_;
+ quiche::QuicheStringPiece value_;
// The decoder to use if the string is Huffman encoded.
HpackHuffmanDecoder decoder_;
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
index ec807c8..9c30db7 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -47,7 +47,7 @@
};
TEST_F(HpackDecoderStringBufferTest, SetStatic) {
- Http2StringPiece data("static string");
+ quiche::QuicheStringPiece data("static string");
EXPECT_EQ(state(), State::RESET);
EXPECT_TRUE(VerifyLogHasSubstrs({"state=RESET"}));
@@ -72,7 +72,7 @@
}
TEST_F(HpackDecoderStringBufferTest, PlainWhole) {
- Http2StringPiece data("some text.");
+ quiche::QuicheStringPiece data("some text.");
HTTP2_LOG(INFO) << buf_;
EXPECT_EQ(state(), State::RESET);
@@ -93,8 +93,8 @@
EXPECT_TRUE(VerifyLogHasSubstrs(
{"state=COMPLETE", "backing=UNBUFFERED", "value: some text."}));
- // We expect that the string buffer points to the passed in Http2StringPiece's
- // backing store.
+ // We expect that the string buffer points to the passed in
+ // QuicheStringPiece's backing store.
EXPECT_EQ(data.data(), buf_.str().data());
// Now force it to buffer the string, after which it will still have the same
@@ -110,9 +110,9 @@
}
TEST_F(HpackDecoderStringBufferTest, PlainSplit) {
- Http2StringPiece data("some text.");
- Http2StringPiece part1 = data.substr(0, 1);
- Http2StringPiece part2 = data.substr(1);
+ quiche::QuicheStringPiece data("some text.");
+ quiche::QuicheStringPiece part1 = data.substr(0, 1);
+ quiche::QuicheStringPiece part2 = data.substr(1);
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ false, data.size());
@@ -138,7 +138,7 @@
EXPECT_EQ(buf_.BufferedLength(), data.size());
HTTP2_LOG(INFO) << buf_;
- Http2StringPiece buffered = buf_.str();
+ quiche::QuicheStringPiece buffered = buf_.str();
EXPECT_EQ(data, buffered);
EXPECT_NE(data.data(), buffered.data());
@@ -153,7 +153,7 @@
TEST_F(HpackDecoderStringBufferTest, HuffmanWhole) {
std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
- Http2StringPiece decoded("www.example.com");
+ quiche::QuicheStringPiece decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
@@ -180,7 +180,7 @@
std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
std::string part1 = encoded.substr(0, 5);
std::string part2 = encoded.substr(5);
- Http2StringPiece decoded("www.example.com");
+ quiche::QuicheStringPiece decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
diff --git a/http2/hpack/decoder/hpack_decoder_test.cc b/http2/hpack/decoder/hpack_decoder_test.cc
index 9734bdd..f2ff8c2 100644
--- a/http2/hpack/decoder/hpack_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_test.cc
@@ -70,7 +70,8 @@
const HpackString& name,
const HpackString& value));
MOCK_METHOD0(OnHeaderListEnd, void());
- MOCK_METHOD1(OnHeaderErrorDetected, void(Http2StringPiece error_message));
+ MOCK_METHOD1(OnHeaderErrorDetected,
+ void(quiche::QuicheStringPiece error_message));
};
class HpackDecoderTest : public ::testing::TestWithParam<bool>,
@@ -119,7 +120,7 @@
// OnHeaderErrorDetected is called if an error is detected while decoding.
// error_message may be used in a GOAWAY frame as the Opaque Data.
- void OnHeaderErrorDetected(Http2StringPiece error_message) override {
+ void OnHeaderErrorDetected(quiche::QuicheStringPiece error_message) override {
ASSERT_TRUE(saw_start_);
error_messages_.push_back(std::string(error_message));
// No further callbacks should be made at this point, so replace 'this' as
@@ -129,7 +130,7 @@
HpackDecoderPeer::GetDecoderState(&decoder_), &mock_listener_);
}
- AssertionResult DecodeBlock(Http2StringPiece block) {
+ AssertionResult DecodeBlock(quiche::QuicheStringPiece block) {
HTTP2_VLOG(1) << "HpackDecoderTest::DecodeBlock";
VERIFY_FALSE(decoder_.error_detected());
diff --git a/http2/hpack/decoder/hpack_entry_collector.cc b/http2/hpack/decoder/hpack_entry_collector.cc
index 7706bd6..80d4f92 100644
--- a/http2/hpack/decoder/hpack_entry_collector.cc
+++ b/http2/hpack/decoder/hpack_entry_collector.cc
@@ -166,7 +166,7 @@
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- Http2StringPiece expected_value) const {
+ quiche::QuicheStringPiece expected_value) const {
VERIFY_TRUE(started_);
VERIFY_TRUE(ended_);
VERIFY_EQ(expected_type, header_type_);
@@ -179,9 +179,9 @@
AssertionResult HpackEntryCollector::ValidateLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- Http2StringPiece expected_name,
+ quiche::QuicheStringPiece expected_name,
bool expected_value_huffman,
- Http2StringPiece expected_value) const {
+ quiche::QuicheStringPiece expected_value) const {
VERIFY_TRUE(started_);
VERIFY_TRUE(ended_);
VERIFY_EQ(expected_type, header_type_);
diff --git a/http2/hpack/decoder/hpack_entry_collector.h b/http2/hpack/decoder/hpack_entry_collector.h
index 6b27b7b..abf9d97 100644
--- a/http2/hpack/decoder/hpack_entry_collector.h
+++ b/http2/hpack/decoder/hpack_entry_collector.h
@@ -20,7 +20,7 @@
#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_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -85,16 +85,16 @@
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- Http2StringPiece expected_value) const;
+ quiche::QuicheStringPiece expected_value) const;
// Returns success if collected a Header with an literal name and literal
// value.
::testing::AssertionResult ValidateLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- Http2StringPiece expected_name,
+ quiche::QuicheStringPiece expected_name,
bool expected_value_huffman,
- Http2StringPiece expected_value) const;
+ quiche::QuicheStringPiece expected_value) const;
// Returns success if collected a Dynamic Table Size Update,
// with the specified size.
diff --git a/http2/hpack/decoder/hpack_string_collector.cc b/http2/hpack/decoder/hpack_string_collector.cc
index e903755..0b18178 100644
--- a/http2/hpack/decoder/hpack_string_collector.cc
+++ b/http2/hpack/decoder/hpack_string_collector.cc
@@ -66,7 +66,7 @@
}
void HpackStringCollector::OnStringData(const char* data, size_t length) {
- Http2StringPiece sp(data, length);
+ quiche::QuicheStringPiece sp(data, length);
EXPECT_TRUE(IsInProgress()) << ToString();
EXPECT_LE(sp.size(), len) << ToString();
Http2StrAppend(&s, sp);
@@ -80,7 +80,7 @@
}
::testing::AssertionResult HpackStringCollector::Collected(
- Http2StringPiece str,
+ quiche::QuicheStringPiece str,
bool is_huffman_encoded) const {
VERIFY_TRUE(HasEnded());
VERIFY_EQ(str.size(), len);
diff --git a/http2/hpack/decoder/hpack_string_collector.h b/http2/hpack/decoder/hpack_string_collector.h
index d56abee..8326a57 100644
--- a/http2/hpack/decoder/hpack_string_collector.h
+++ b/http2/hpack/decoder/hpack_string_collector.h
@@ -14,7 +14,7 @@
#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_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -40,7 +40,7 @@
void OnStringData(const char* data, size_t length) override;
void OnStringEnd() override;
- ::testing::AssertionResult Collected(Http2StringPiece str,
+ ::testing::AssertionResult Collected(quiche::QuicheStringPiece str,
bool is_huffman_encoded) const;
std::string ToString() const;
diff --git a/http2/hpack/decoder/hpack_string_decoder_test.cc b/http2/hpack/decoder/hpack_string_decoder_test.cc
index ceeebca..6c81b57 100644
--- a/http2/hpack/decoder/hpack_string_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_string_decoder_test.cc
@@ -10,10 +10,10 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_listener.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_piece.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_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using ::testing::AssertionResult;
@@ -43,13 +43,13 @@
return decoder_.Resume(b, &listener_);
}
- AssertionResult Collected(Http2StringPiece s, bool huffman_encoded) {
+ AssertionResult Collected(quiche::QuicheStringPiece s, bool huffman_encoded) {
HTTP2_VLOG(1) << collector_;
return collector_.Collected(s, huffman_encoded);
}
// 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
+ // QuicheStringPiece 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 std::string& expected_str,
bool expected_huffman) {
@@ -111,7 +111,7 @@
{
Validator validator =
ValidateDoneAndOffset(11, MakeValidator("start end.", kUncompressed));
- Http2StringPiece data("\x0astart end.");
+ quiche::QuicheStringPiece data("\x0astart end.");
DecodeBuffer b(data);
EXPECT_TRUE(
DecodeAndValidateSeveralWays(&b, kMayReturnZeroOnFirst, validator));
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
index dea6698..1f1f4f0 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -67,7 +67,7 @@
void HpackWholeEntryBuffer::OnNameData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameData: len=" << len
<< " data:\n"
- << Http2HexDump(Http2StringPiece(data, len));
+ << Http2HexDump(quiche::QuicheStringPiece(data, len));
DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnData(data, len)) {
ReportError("Error decoding HPACK entry name.");
@@ -100,7 +100,7 @@
void HpackWholeEntryBuffer::OnValueData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnValueData: len=" << len
<< " data:\n"
- << Http2HexDump(Http2StringPiece(data, len));
+ << Http2HexDump(quiche::QuicheStringPiece(data, len));
if (!error_detected_ && !value_.OnData(data, len)) {
ReportError("Error decoding HPACK entry value.");
}
@@ -131,7 +131,8 @@
listener_->OnDynamicTableSizeUpdate(size);
}
-void HpackWholeEntryBuffer::ReportError(Http2StringPiece error_message) {
+void HpackWholeEntryBuffer::ReportError(
+ quiche::QuicheStringPiece error_message) {
if (!error_detected_) {
HTTP2_DVLOG(1) << "HpackWholeEntryBuffer::ReportError: " << error_message;
error_detected_ = true;
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.h b/http2/hpack/decoder/hpack_whole_entry_buffer.h
index 61bf583..814c1b4 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.h
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.h
@@ -17,7 +17,7 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h"
#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_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -79,7 +79,7 @@
void OnDynamicTableSizeUpdate(size_t size) override;
private:
- void ReportError(Http2StringPiece error_message);
+ void ReportError(quiche::QuicheStringPiece error_message);
HpackWholeEntryListener* listener_;
HpackDecoderStringBuffer name_, value_;
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc b/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
index 0265e9c..4ac82ea 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
@@ -37,7 +37,8 @@
HpackDecoderStringBuffer* name_buffer,
HpackDecoderStringBuffer* value_buffer));
MOCK_METHOD1(OnDynamicTableSizeUpdate, void(size_t size));
- MOCK_METHOD1(OnHpackDecodeError, void(Http2StringPiece error_message));
+ MOCK_METHOD1(OnHpackDecodeError,
+ void(quiche::QuicheStringPiece error_message));
};
class HpackWholeEntryBufferTest : public ::testing::Test {
diff --git a/http2/hpack/decoder/hpack_whole_entry_listener.cc b/http2/hpack/decoder/hpack_whole_entry_listener.cc
index b92e64a..69cf122 100644
--- a/http2/hpack/decoder/hpack_whole_entry_listener.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_listener.cc
@@ -21,7 +21,7 @@
HpackDecoderStringBuffer* value_buffer) {}
void HpackWholeEntryNoOpListener::OnDynamicTableSizeUpdate(size_t size) {}
void HpackWholeEntryNoOpListener::OnHpackDecodeError(
- Http2StringPiece error_message) {}
+ quiche::QuicheStringPiece error_message) {}
// static
HpackWholeEntryNoOpListener* HpackWholeEntryNoOpListener::NoOpListener() {
diff --git a/http2/hpack/decoder/hpack_whole_entry_listener.h b/http2/hpack/decoder/hpack_whole_entry_listener.h
index 2e559ce..eabe34a 100644
--- a/http2/hpack/decoder/hpack_whole_entry_listener.h
+++ b/http2/hpack/decoder/hpack_whole_entry_listener.h
@@ -14,7 +14,7 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#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_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -51,7 +51,7 @@
// OnHpackDecodeError is called if an error is detected while decoding.
// error_message may be used in a GOAWAY frame as the Opaque Data.
- virtual void OnHpackDecodeError(Http2StringPiece error_message) = 0;
+ virtual void OnHpackDecodeError(quiche::QuicheStringPiece error_message) = 0;
};
// A no-op implementation of HpackWholeEntryDecoderListener, useful for ignoring
@@ -69,7 +69,7 @@
HpackDecoderStringBuffer* name_buffer,
HpackDecoderStringBuffer* value_buffer) override;
void OnDynamicTableSizeUpdate(size_t size) override;
- void OnHpackDecodeError(Http2StringPiece error_message) override;
+ void OnHpackDecodeError(quiche::QuicheStringPiece error_message) override;
// Returns a listener that ignores all the calls.
static HpackWholeEntryNoOpListener* NoOpListener();