Remove quiche::QuicheStringPiece and quiche::QuicheStringPieceHash.
Also replace some MOCK_METHOD1 with MOCK_METHOD to make the linter happy.
PiperOrigin-RevId: 336909722
Change-Id: I68bcc1a674815934fb271870eac2dff9028d980d
diff --git a/http2/hpack/decoder/hpack_block_collector.cc b/http2/hpack/decoder/hpack_block_collector.cc
index 325a60c..88e0a9a 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,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view 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,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view 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 6030c14..55d9449 100644
--- a/http2/hpack/decoder/hpack_block_collector.h
+++ b/http2/hpack/decoder/hpack_block_collector.h
@@ -18,12 +18,12 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h"
#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/test_tools/http2_random.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -96,16 +96,16 @@
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view 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,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view 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 9618145..e392ffa 100644
--- a/http2/hpack/decoder/hpack_block_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_block_decoder_test.cc
@@ -9,6 +9,7 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
@@ -17,7 +18,6 @@
#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"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionSuccess;
@@ -66,7 +66,7 @@
}
AssertionResult DecodeHpackExampleAndValidateSeveralWays(
- quiche::QuicheStringPiece hpack_example,
+ absl::string_view hpack_example,
Validator validator) {
std::string input = HpackExampleToStringOrDie(hpack_example);
DecodeBuffer db(input);
diff --git a/http2/hpack/decoder/hpack_decoder_listener.cc b/http2/hpack/decoder/hpack_decoder_listener.cc
index c1f7c8e..c2c8308 100644
--- a/http2/hpack/decoder/hpack_decoder_listener.cc
+++ b/http2/hpack/decoder/hpack_decoder_listener.cc
@@ -17,7 +17,7 @@
const HpackString& /*value*/) {}
void HpackDecoderNoOpListener::OnHeaderListEnd() {}
void HpackDecoderNoOpListener::OnHeaderErrorDetected(
- quiche::QuicheStringPiece /*error_message*/) {}
+ absl::string_view /*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 f1b76db..9b67012 100644
--- a/http2/hpack/decoder/hpack_decoder_listener.h
+++ b/http2/hpack/decoder/hpack_decoder_listener.h
@@ -8,10 +8,10 @@
#ifndef QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODER_LISTENER_H_
#define QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODER_LISTENER_H_
+#include "absl/strings/string_view.h"
#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/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -37,8 +37,7 @@
// 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(
- quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnHeaderErrorDetected(absl::string_view error_message) = 0;
};
// A no-op implementation of HpackDecoderListener, useful for ignoring
@@ -52,7 +51,7 @@
void OnHeaderListStart() override;
void OnHeader(const HpackString& name, const HpackString& value) override;
void OnHeaderListEnd() override;
- void OnHeaderErrorDetected(quiche::QuicheStringPiece error_message) override;
+ void OnHeaderErrorDetected(absl::string_view error_message) override;
// Returns a listener that ignores all the calls.
static HpackDecoderNoOpListener* NoOpListener();
diff --git a/http2/hpack/decoder/hpack_decoder_state.h b/http2/hpack/decoder/hpack_decoder_state.h
index 3854a6c..6478a46 100644
--- a/http2/hpack/decoder/hpack_decoder_state.h
+++ b/http2/hpack/decoder/hpack_decoder_state.h
@@ -16,6 +16,7 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
@@ -23,7 +24,6 @@
#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/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
diff --git a/http2/hpack/decoder/hpack_decoder_state_test.cc b/http2/hpack/decoder/hpack_decoder_state_test.cc
index d0c7b52..3ceaea2 100644
--- a/http2/hpack/decoder/hpack_decoder_state_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_state_test.cc
@@ -9,12 +9,12 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#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/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_test_helpers.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
@@ -40,8 +40,10 @@
MOCK_METHOD2(OnHeader,
void(const HpackString& name, const HpackString& value));
MOCK_METHOD0(OnHeaderListEnd, void());
- MOCK_METHOD1(OnHeaderErrorDetected,
- void(quiche::QuicheStringPiece error_message));
+ MOCK_METHOD(void,
+ OnHeaderErrorDetected,
+ (absl::string_view error_message),
+ (override));
};
enum StringBacking { STATIC, UNBUFFERED, BUFFERED };
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
index f461c1e..2e476b0 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -60,8 +60,7 @@
state_ = State::RESET;
}
-void HpackDecoderStringBuffer::Set(quiche::QuicheStringPiece value,
- bool is_static) {
+void HpackDecoderStringBuffer::Set(absl::string_view value, bool is_static) {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::Set";
DCHECK_EQ(state_, State::RESET);
value_ = value;
@@ -101,7 +100,7 @@
backing_ = Backing::RESET;
// OnData is not called for empty (zero length) strings, so make sure that
// value_ is cleared.
- value_ = quiche::QuicheStringPiece();
+ value_ = absl::string_view();
}
}
@@ -114,7 +113,7 @@
if (is_huffman_encoded_) {
DCHECK_EQ(backing_, Backing::BUFFERED);
- return decoder_.Decode(quiche::QuicheStringPiece(data, len), &buffer_);
+ return decoder_.Decode(absl::string_view(data, len), &buffer_);
}
if (backing_ == Backing::RESET) {
@@ -122,7 +121,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_ = quiche::QuicheStringPiece(data, len);
+ value_ = absl::string_view(data, len);
backing_ = Backing::UNBUFFERED;
return true;
}
@@ -188,14 +187,13 @@
return IsBuffered() ? buffer_.size() : 0;
}
-quiche::QuicheStringPiece HpackDecoderStringBuffer::str() const {
+absl::string_view HpackDecoderStringBuffer::str() const {
HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::str";
DCHECK_EQ(state_, State::COMPLETE);
return value_;
}
-quiche::QuicheStringPiece HpackDecoderStringBuffer::GetStringIfComplete()
- const {
+absl::string_view HpackDecoderStringBuffer::GetStringIfComplete() const {
if (state_ != State::COMPLETE) {
return {};
}
diff --git a/http2/hpack/decoder/hpack_decoder_string_buffer.h b/http2/hpack/decoder/hpack_decoder_string_buffer.h
index 1341e79..b11d50f 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer.h
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer.h
@@ -14,9 +14,9 @@
#include <ostream>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.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(quiche::QuicheStringPiece value, bool is_static);
+ void Set(absl::string_view 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,14 +47,14 @@
// 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 QuicheStringPiece pointing to the backing store for the string,
+ // Returns a string_view 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).
- quiche::QuicheStringPiece str() const;
+ absl::string_view str() const;
// Same as str() if state_ is COMPLETE. Otherwise, returns empty string piece.
- quiche::QuicheStringPiece GetStringIfComplete() const;
+ absl::string_view GetStringIfComplete() const;
// Returns the completely collected string by value, using std::move in an
// effort to avoid unnecessary copies. ReleaseString() must not be called
@@ -75,10 +75,10 @@
// (e.g. if Huffman encoded, buffer_ is storage for the decoded string).
std::string buffer_;
- // The QuicheStringPiece to be returned by HpackDecoderStringBuffer::str(). If
+ // The string_view to be returned by HpackDecoderStringBuffer::str(). If
// a string has been collected, but not buffered, value_ points to that
// string.
- quiche::QuicheStringPiece value_;
+ absl::string_view 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 69da1da..51747e7 100644
--- a/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -46,7 +46,7 @@
};
TEST_F(HpackDecoderStringBufferTest, SetStatic) {
- quiche::QuicheStringPiece data("static string");
+ absl::string_view data("static string");
EXPECT_EQ(state(), State::RESET);
EXPECT_TRUE(VerifyLogHasSubstrs({"state=RESET"}));
@@ -71,7 +71,7 @@
}
TEST_F(HpackDecoderStringBufferTest, PlainWhole) {
- quiche::QuicheStringPiece data("some text.");
+ absl::string_view data("some text.");
HTTP2_LOG(INFO) << buf_;
EXPECT_EQ(state(), State::RESET);
@@ -93,7 +93,7 @@
{"state=COMPLETE", "backing=UNBUFFERED", "value: some text."}));
// We expect that the string buffer points to the passed in
- // QuicheStringPiece's backing store.
+ // string_view'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
@@ -109,9 +109,9 @@
}
TEST_F(HpackDecoderStringBufferTest, PlainSplit) {
- quiche::QuicheStringPiece data("some text.");
- quiche::QuicheStringPiece part1 = data.substr(0, 1);
- quiche::QuicheStringPiece part2 = data.substr(1);
+ absl::string_view data("some text.");
+ absl::string_view part1 = data.substr(0, 1);
+ absl::string_view part2 = data.substr(1);
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ false, data.size());
@@ -137,7 +137,7 @@
EXPECT_EQ(buf_.BufferedLength(), data.size());
HTTP2_LOG(INFO) << buf_;
- quiche::QuicheStringPiece buffered = buf_.str();
+ absl::string_view buffered = buf_.str();
EXPECT_EQ(data, buffered);
EXPECT_NE(data.data(), buffered.data());
@@ -152,7 +152,7 @@
TEST_F(HpackDecoderStringBufferTest, HuffmanWhole) {
std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
- quiche::QuicheStringPiece decoded("www.example.com");
+ absl::string_view decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
@@ -179,7 +179,7 @@
std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
std::string part1 = encoded.substr(0, 5);
std::string part2 = encoded.substr(5);
- quiche::QuicheStringPiece decoded("www.example.com");
+ absl::string_view 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 b110f03..eb14276 100644
--- a/http2/hpack/decoder/hpack_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_decoder_test.cc
@@ -67,8 +67,10 @@
MOCK_METHOD2(OnHeader,
void(const HpackString& name, const HpackString& value));
MOCK_METHOD0(OnHeaderListEnd, void());
- MOCK_METHOD1(OnHeaderErrorDetected,
- void(quiche::QuicheStringPiece error_message));
+ MOCK_METHOD(void,
+ OnHeaderErrorDetected,
+ (absl::string_view error_message),
+ (override));
};
class HpackDecoderTest : public QuicheTestWithParam<bool>,
@@ -113,7 +115,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(quiche::QuicheStringPiece error_message) override {
+ void OnHeaderErrorDetected(absl::string_view 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
@@ -123,7 +125,7 @@
HpackDecoderPeer::GetDecoderState(&decoder_), &mock_listener_);
}
- AssertionResult DecodeBlock(quiche::QuicheStringPiece block) {
+ AssertionResult DecodeBlock(absl::string_view block) {
HTTP2_VLOG(1) << "HpackDecoderTest::DecodeBlock";
VERIFY_FALSE(decoder_.DetectError());
diff --git a/http2/hpack/decoder/hpack_decoding_error.cc b/http2/hpack/decoder/hpack_decoding_error.cc
index 3e231b5..4b106a9 100644
--- a/http2/hpack/decoder/hpack_decoding_error.cc
+++ b/http2/hpack/decoder/hpack_decoding_error.cc
@@ -7,7 +7,7 @@
namespace http2 {
// static
-quiche::QuicheStringPiece HpackDecodingErrorToString(HpackDecodingError error) {
+absl::string_view HpackDecodingErrorToString(HpackDecodingError error) {
switch (error) {
case HpackDecodingError::kOk:
return "No error detected";
diff --git a/http2/hpack/decoder/hpack_decoding_error.h b/http2/hpack/decoder/hpack_decoding_error.h
index e346549..3536b97 100644
--- a/http2/hpack/decoder/hpack_decoding_error.h
+++ b/http2/hpack/decoder/hpack_decoding_error.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
#define QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -43,7 +43,7 @@
kCompressedHeaderSizeExceedsLimit,
};
-QUICHE_EXPORT_PRIVATE quiche::QuicheStringPiece HpackDecodingErrorToString(
+QUICHE_EXPORT_PRIVATE absl::string_view HpackDecodingErrorToString(
HpackDecodingError error);
} // namespace http2
diff --git a/http2/hpack/decoder/hpack_entry_collector.cc b/http2/hpack/decoder/hpack_entry_collector.cc
index 109303d..b393828 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,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view 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,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view 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 1c8d709..e333789 100644
--- a/http2/hpack/decoder/hpack_entry_collector.h
+++ b/http2/hpack/decoder/hpack_entry_collector.h
@@ -15,11 +15,11 @@
#include <iosfwd>
#include <string>
+#include "absl/strings/string_view.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/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
@@ -85,16 +85,16 @@
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view 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,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view 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 b9feb48..8300d57 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) {
- quiche::QuicheStringPiece sp(data, length);
+ absl::string_view sp(data, length);
EXPECT_TRUE(IsInProgress()) << ToString();
EXPECT_LE(sp.size(), len) << ToString();
Http2StrAppend(&s, sp);
@@ -80,7 +80,7 @@
}
::testing::AssertionResult HpackStringCollector::Collected(
- quiche::QuicheStringPiece str,
+ absl::string_view 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 2ebc7ae..9ba65c4 100644
--- a/http2/hpack/decoder/hpack_string_collector.h
+++ b/http2/hpack/decoder/hpack_string_collector.h
@@ -12,8 +12,8 @@
#include <iosfwd>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_listener.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
@@ -40,7 +40,7 @@
void OnStringData(const char* data, size_t length) override;
void OnStringEnd() override;
- ::testing::AssertionResult Collected(quiche::QuicheStringPiece str,
+ ::testing::AssertionResult Collected(absl::string_view 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 26213b8..bc6137c 100644
--- a/http2/hpack/decoder/hpack_string_decoder_test.cc
+++ b/http2/hpack/decoder/hpack_string_decoder_test.cc
@@ -6,13 +6,13 @@
// Tests of HpackStringDecoder.
+#include "absl/strings/string_view.h"
#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_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"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
@@ -43,13 +43,13 @@
return decoder_.Resume(b, &listener_);
}
- AssertionResult Collected(quiche::QuicheStringPiece s, bool huffman_encoded) {
+ AssertionResult Collected(absl::string_view 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
- // QuicheStringPiece so that the lambda makes a copy of the string, and thus
+ // absl::string_view 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) {
@@ -112,7 +112,7 @@
{
Validator validator =
ValidateDoneAndOffset(11, MakeValidator("start end.", kUncompressed));
- quiche::QuicheStringPiece data("\x0astart end.");
+ absl::string_view 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 f8d5e9d..ecdcdc9 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.cc
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -70,7 +70,7 @@
void HpackWholeEntryBuffer::OnNameData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameData: len=" << len
<< " data:\n"
- << Http2HexDump(quiche::QuicheStringPiece(data, len));
+ << Http2HexDump(absl::string_view(data, len));
DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnData(data, len)) {
ReportError(HpackDecodingError::kNameHuffmanError, "");
@@ -107,7 +107,7 @@
void HpackWholeEntryBuffer::OnValueData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnValueData: len=" << len
<< " data:\n"
- << Http2HexDump(quiche::QuicheStringPiece(data, len));
+ << Http2HexDump(absl::string_view(data, len));
if (!error_detected_ && !value_.OnData(data, len)) {
ReportError(HpackDecodingError::kValueHuffmanError, "");
HTTP2_CODE_COUNT_N(decompress_failure_3, 22, 23);
diff --git a/http2/hpack/decoder/hpack_whole_entry_buffer.h b/http2/hpack/decoder/hpack_whole_entry_buffer.h
index afca3b8..f7b81c5 100644
--- a/http2/hpack/decoder/hpack_whole_entry_buffer.h
+++ b/http2/hpack/decoder/hpack_whole_entry_buffer.h
@@ -12,13 +12,13 @@
#include <stddef.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.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_whole_entry_listener.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
diff --git a/http2/hpack/decoder/hpack_whole_entry_listener.h b/http2/hpack/decoder/hpack_whole_entry_listener.h
index ec2ae52..92135f9 100644
--- a/http2/hpack/decoder/hpack_whole_entry_listener.h
+++ b/http2/hpack/decoder/hpack_whole_entry_listener.h
@@ -11,11 +11,11 @@
#include <stddef.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {