summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/http2/hpack
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/third_party/quiche/src/http2/hpack')
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc9
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h4
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc19
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc23
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc5
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc3
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc7
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc12
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc3
9 files changed, 46 insertions, 39 deletions
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
index 6c6a9773c59..b7a8b39d051 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -8,6 +8,7 @@
#include <initializer_list>
+#include "absl/strings/escaping.h"
#include "http2/platform/api/http2_logging.h"
#include "http2/platform/api/http2_string_utils.h"
#include "http2/platform/api/http2_test_helpers.h"
@@ -151,7 +152,7 @@ TEST_F(HpackDecoderStringBufferTest, PlainSplit) {
}
TEST_F(HpackDecoderStringBufferTest, HuffmanWhole) {
- std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
+ std::string encoded = absl::HexStringToBytes("f1e3c2e5f23a6ba0ab90f4ff");
absl::string_view decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
@@ -176,7 +177,7 @@ TEST_F(HpackDecoderStringBufferTest, HuffmanWhole) {
}
TEST_F(HpackDecoderStringBufferTest, HuffmanSplit) {
- std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
+ std::string encoded = absl::HexStringToBytes("f1e3c2e5f23a6ba0ab90f4ff");
std::string part1 = encoded.substr(0, 5);
std::string part2 = encoded.substr(5);
absl::string_view decoded("www.example.com");
@@ -215,7 +216,7 @@ TEST_F(HpackDecoderStringBufferTest, HuffmanSplit) {
TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnData) {
// Explicitly encode the End-of-String symbol, a no-no.
- std::string encoded = Http2HexDecode("ffffffff");
+ std::string encoded = absl::HexStringToBytes("ffffffff");
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
EXPECT_EQ(state(), State::COLLECTING);
@@ -229,7 +230,7 @@ TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnData) {
TEST_F(HpackDecoderStringBufferTest, InvalidHuffmanOnEnd) {
// Last byte of string doesn't end with prefix of End-of-String symbol.
- std::string encoded = Http2HexDecode("00");
+ std::string encoded = absl::HexStringToBytes("00");
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
EXPECT_EQ(state(), State::COLLECTING);
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h
index f75916d67df..ef5b3d2d678 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h
@@ -25,8 +25,8 @@
#include <vector>
#include "http2/http2_constants.h"
-#include "quic/core/quic_circular_deque.h"
#include "common/platform/api/quiche_export.h"
+#include "common/quiche_circular_deque.h"
namespace http2 {
namespace test {
@@ -107,7 +107,7 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderDynamicTable {
// Removes the oldest dynamic table entry.
void RemoveLastEntry();
- quic::QuicCircularDeque<HpackStringPair> table_;
+ quiche::QuicheCircularDeque<HpackStringPair> table_;
// The last received DynamicTableSizeUpdate value, initialized to
// SETTINGS_HEADER_TABLE_SIZE.
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc
index fa88038af2f..e7a346e7719 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc
@@ -9,6 +9,7 @@
#include <iostream>
#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "http2/decoder/decode_buffer.h"
#include "http2/decoder/decode_status.h"
#include "http2/platform/api/http2_string_utils.h"
@@ -188,13 +189,13 @@ class HpackHuffmanDecoderTest : public RandomDecoderTest {
TEST_F(HpackHuffmanDecoderTest, SpecRequestExamples) {
HpackHuffmanDecoder decoder;
std::string test_table[] = {
- Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff"),
+ absl::HexStringToBytes("f1e3c2e5f23a6ba0ab90f4ff"),
"www.example.com",
- Http2HexDecode("a8eb10649cbf"),
+ absl::HexStringToBytes("a8eb10649cbf"),
"no-cache",
- Http2HexDecode("25a849e95ba97d7f"),
+ absl::HexStringToBytes("25a849e95ba97d7f"),
"custom-key",
- Http2HexDecode("25a849e95bb8e8b4bf"),
+ absl::HexStringToBytes("25a849e95bb8e8b4bf"),
"custom-value",
};
for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
@@ -212,17 +213,17 @@ TEST_F(HpackHuffmanDecoderTest, SpecResponseExamples) {
HpackHuffmanDecoder decoder;
// clang-format off
std::string test_table[] = {
- Http2HexDecode("6402"),
+ absl::HexStringToBytes("6402"),
"302",
- Http2HexDecode("aec3771a4b"),
+ absl::HexStringToBytes("aec3771a4b"),
"private",
- Http2HexDecode("d07abe941054d444a8200595040b8166"
+ absl::HexStringToBytes("d07abe941054d444a8200595040b8166"
"e082a62d1bff"),
"Mon, 21 Oct 2013 20:13:21 GMT",
- Http2HexDecode("9d29ad171863c78f0b97c8e9ae82ae43"
+ absl::HexStringToBytes("9d29ad171863c78f0b97c8e9ae82ae43"
"d3"),
"https://www.example.com",
- Http2HexDecode("94e7821dd7f2e6c7b335dfdfcd5b3960"
+ absl::HexStringToBytes("94e7821dd7f2e6c7b335dfdfcd5b3960"
"d5af27087f3672c1ab270fb5291f9587"
"316065c003ed4ee5b1063d5007"),
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc
index 666fe95d948..0d321876149 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc
@@ -5,6 +5,7 @@
#include "http2/hpack/huffman/hpack_huffman_encoder.h"
#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "http2/platform/api/http2_string_utils.h"
#include "common/platform/api/quiche_test.h"
@@ -40,13 +41,13 @@ TEST_P(HuffmanEncoderTest, Empty) {
TEST_P(HuffmanEncoderTest, SpecRequestExamples) {
std::string test_table[] = {
- Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff"),
+ absl::HexStringToBytes("f1e3c2e5f23a6ba0ab90f4ff"),
"www.example.com",
- Http2HexDecode("a8eb10649cbf"),
+ absl::HexStringToBytes("a8eb10649cbf"),
"no-cache",
- Http2HexDecode("25a849e95ba97d7f"),
+ absl::HexStringToBytes("25a849e95ba97d7f"),
"custom-key",
- Http2HexDecode("25a849e95bb8e8b4bf"),
+ absl::HexStringToBytes("25a849e95bb8e8b4bf"),
"custom-value",
};
for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
@@ -64,17 +65,17 @@ TEST_P(HuffmanEncoderTest, SpecRequestExamples) {
TEST_P(HuffmanEncoderTest, SpecResponseExamples) {
// clang-format off
std::string test_table[] = {
- Http2HexDecode("6402"),
+ absl::HexStringToBytes("6402"),
"302",
- Http2HexDecode("aec3771a4b"),
+ absl::HexStringToBytes("aec3771a4b"),
"private",
- Http2HexDecode("d07abe941054d444a8200595040b8166"
+ absl::HexStringToBytes("d07abe941054d444a8200595040b8166"
"e082a62d1bff"),
"Mon, 21 Oct 2013 20:13:21 GMT",
- Http2HexDecode("9d29ad171863c78f0b97c8e9ae82ae43"
+ absl::HexStringToBytes("9d29ad171863c78f0b97c8e9ae82ae43"
"d3"),
"https://www.example.com",
- Http2HexDecode("94e7821dd7f2e6c7b335dfdfcd5b3960"
+ absl::HexStringToBytes("94e7821dd7f2e6c7b335dfdfcd5b3960"
"d5af27087f3672c1ab270fb5291f9587"
"316065c003ed4ee5b1063d5007"),
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
@@ -120,11 +121,11 @@ TEST_P(HuffmanEncoderTest, AppendToOutput) {
size_t encoded_size = HuffmanSize("foo");
std::string buffer;
Encode("foo", encoded_size, &buffer);
- EXPECT_EQ(Http2HexDecode("94e7"), buffer);
+ EXPECT_EQ(absl::HexStringToBytes("94e7"), buffer);
encoded_size = HuffmanSize("bar");
Encode("bar", encoded_size, &buffer);
- EXPECT_EQ(Http2HexDecode("94e78c767f"), buffer);
+ EXPECT_EQ(absl::HexStringToBytes("94e78c767f"), buffer);
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc
index d4eb3d78790..3821127bd08 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc
@@ -4,6 +4,7 @@
#include "http2/hpack/tools/hpack_block_builder.h"
+#include "absl/strings/escaping.h"
#include "http2/platform/api/http2_string_utils.h"
#include "common/platform/api/quiche_test.h"
@@ -97,7 +98,7 @@ TEST(HpackBlockBuilderTest, ExamplesFromSpecC3) {
// 0x0010: 2e63 6f6d .com
const std::string expected =
- Http2HexDecode("828684410f7777772e6578616d706c652e636f6d");
+ absl::HexStringToBytes("828684410f7777772e6578616d706c652e636f6d");
EXPECT_EQ(expected, b.buffer());
}
}
@@ -128,7 +129,7 @@ TEST(HpackBlockBuilderTest, ExamplesFromSpecC4) {
// 0x0010: ff .
const std::string expected =
- Http2HexDecode("828684418cf1e3c2e5f23a6ba0ab90f4ff");
+ absl::HexStringToBytes("828684418cf1e3c2e5f23a6ba0ab90f4ff");
EXPECT_EQ(expected, b.buffer());
}
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc
index 00664b27f14..b2783e3b277 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc
@@ -6,6 +6,7 @@
#include <ctype.h>
+#include "absl/strings/escaping.h"
#include "absl/strings/str_cat.h"
#include "http2/platform/api/http2_bug_tracker.h"
#include "http2/platform/api/http2_logging.h"
@@ -22,7 +23,7 @@ void HpackExampleToStringOrDie(absl::string_view example, std::string* output) {
QUICHE_CHECK_GT(example.size(), 1u) << "Truncated hex byte?";
const char c1 = example[1];
QUICHE_CHECK(isxdigit(c1)) << "Found half a byte?";
- *output += Http2HexDecode(example.substr(0, 2));
+ *output += absl::HexStringToBytes(example.substr(0, 2));
example.remove_prefix(2);
continue;
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc
index 3d73c5c4a86..a67cca6c729 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc
@@ -9,6 +9,7 @@
#include <stddef.h>
#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "absl/strings/string_view.h"
#include "http2/platform/api/http2_logging.h"
#include "http2/platform/api/http2_string_utils.h"
@@ -28,7 +29,7 @@ class HpackVarintDecoderTest : public RandomDecoderTest,
protected:
HpackVarintDecoderTest()
: high_bits_(::testing::get<0>(GetParam())),
- suffix_(Http2HexDecode(::testing::get<1>(GetParam()))),
+ suffix_(absl::HexStringToBytes(::testing::get<1>(GetParam()))),
prefix_length_(0) {}
void DecodeExpectSuccess(absl::string_view data,
@@ -261,7 +262,7 @@ struct {
TEST_P(HpackVarintDecoderTest, Success) {
for (size_t i = 0; i < ABSL_ARRAYSIZE(kSuccessTestData); ++i) {
- DecodeExpectSuccess(Http2HexDecode(kSuccessTestData[i].data),
+ DecodeExpectSuccess(absl::HexStringToBytes(kSuccessTestData[i].data),
kSuccessTestData[i].prefix_length,
kSuccessTestData[i].expected_value);
}
@@ -302,7 +303,7 @@ struct {
TEST_P(HpackVarintDecoderTest, Error) {
for (size_t i = 0; i < ABSL_ARRAYSIZE(kErrorTestData); ++i) {
- DecodeExpectError(Http2HexDecode(kErrorTestData[i].data),
+ DecodeExpectError(absl::HexStringToBytes(kErrorTestData[i].data),
kErrorTestData[i].prefix_length);
}
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc
index cd1666b8ce3..7f049e8eabf 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc
@@ -5,8 +5,8 @@
#include "http2/hpack/varint/hpack_varint_encoder.h"
#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "http2/platform/api/http2_string_utils.h"
-
#include "common/platform/api/quiche_test.h"
namespace http2 {
@@ -105,7 +105,7 @@ TEST(HpackVarintEncoderTest, Long) {
// a single ResumeEncoding() call.
for (size_t i = 0; i < ABSL_ARRAYSIZE(kLongTestData); ++i) {
std::string expected_encoding =
- Http2HexDecode(kLongTestData[i].expected_encoding);
+ absl::HexStringToBytes(kLongTestData[i].expected_encoding);
std::string output;
HpackVarintEncoder::Encode(kLongTestData[i].high_bits,
@@ -145,16 +145,16 @@ TEST(HpackVarintEncoderTest, LastByteIsZero) {
// Test that encoder appends correctly to non-empty string.
TEST(HpackVarintEncoderTest, Append) {
std::string output("foo");
- EXPECT_EQ(Http2HexDecode("666f6f"), output);
+ EXPECT_EQ(absl::HexStringToBytes("666f6f"), output);
HpackVarintEncoder::Encode(0b10011000, 3, 103, &output);
- EXPECT_EQ(Http2HexDecode("666f6f9f60"), output);
+ EXPECT_EQ(absl::HexStringToBytes("666f6f9f60"), output);
HpackVarintEncoder::Encode(0b10100000, 5, 8, &output);
- EXPECT_EQ(Http2HexDecode("666f6f9f60a8"), output);
+ EXPECT_EQ(absl::HexStringToBytes("666f6f9f60a8"), output);
HpackVarintEncoder::Encode(0b10011000, 3, 202147110, &output);
- EXPECT_EQ(Http2HexDecode("666f6f9f60a89f9f8ab260"), output);
+ EXPECT_EQ(absl::HexStringToBytes("666f6f9f60a89f9f8ab260"), output);
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc
index a8ba99a8a31..d8152593547 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc
@@ -14,6 +14,7 @@
#include <vector>
#include "absl/strings/str_cat.h"
+#include "absl/strings/str_format.h"
#include "absl/strings/string_view.h"
#include "http2/hpack/tools/hpack_block_builder.h"
#include "http2/platform/api/http2_logging.h"
@@ -285,7 +286,7 @@ TEST_F(HpackVarintRoundTripTest, Encode) {
for (uint64_t value : values) {
EncodeNoRandom(value, prefix_length);
std::string dump = Http2HexDump(buffer_);
- HTTP2_LOG(INFO) << Http2StringPrintf("%10llu %0#18x ", value, value)
+ HTTP2_LOG(INFO) << absl::StrFormat("%10llu %0#18x ", value, value)
<< Http2HexDump(buffer_).substr(7);
}
}