clang-format QUICHE
Run clang-format on *.h and *.cc file in QUICHE.
Tested:
TAP train for global presubmit queue
http://test/OCL:441019335:BASE:441060140:1649756026611:3ef46a33
PiperOrigin-RevId: 441177848
diff --git a/quiche/http2/hpack/varint/hpack_varint_decoder.h b/quiche/http2/hpack/varint/hpack_varint_decoder.h
index bffbdcc..d2c8feb 100644
--- a/quiche/http2/hpack/varint/hpack_varint_decoder.h
+++ b/quiche/http2/hpack/varint/hpack_varint_decoder.h
@@ -61,8 +61,7 @@
// |prefix_length| is number of bits in the first byte that are used for
// encoding the integer. |db| is the rest of the buffer, that is, not
// including the first byte.
- DecodeStatus Start(uint8_t prefix_value,
- uint8_t prefix_length,
+ DecodeStatus Start(uint8_t prefix_value, uint8_t prefix_length,
DecodeBuffer* db);
// The caller has already determined that the encoding requires multiple
@@ -87,8 +86,7 @@
// For benchmarking, these methods ensure the decoder
// is NOT inlined into the caller.
- DecodeStatus StartForTest(uint8_t prefix_value,
- uint8_t prefix_length,
+ DecodeStatus StartForTest(uint8_t prefix_value, uint8_t prefix_length,
DecodeBuffer* db);
DecodeStatus StartExtendedForTest(uint8_t prefix_length, DecodeBuffer* db);
DecodeStatus ResumeForTest(DecodeBuffer* db);
diff --git a/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc b/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc
index e5a2025..a81e891 100644
--- a/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc
+++ b/quiche/http2/hpack/varint/hpack_varint_decoder_test.cc
@@ -30,8 +30,7 @@
suffix_(absl::HexStringToBytes(std::get<1>(GetParam()))),
prefix_length_(0) {}
- void DecodeExpectSuccess(absl::string_view data,
- uint32_t prefix_length,
+ void DecodeExpectSuccess(absl::string_view data, uint32_t prefix_length,
uint64_t expected_value) {
Validator validator = [expected_value, this](
const DecodeBuffer& /*db*/,
@@ -62,8 +61,7 @@
}
private:
- AssertionResult Decode(absl::string_view data,
- uint32_t prefix_length,
+ AssertionResult Decode(absl::string_view data, uint32_t prefix_length,
const Validator validator) {
prefix_length_ = prefix_length;
@@ -107,8 +105,7 @@
};
INSTANTIATE_TEST_SUITE_P(
- HpackVarintDecoderTest,
- HpackVarintDecoderTest,
+ HpackVarintDecoderTest, HpackVarintDecoderTest,
::testing::Combine(
// Bits of the first byte not part of the prefix should be ignored.
::testing::Values(0b00000000, 0b11111111, 0b10101010),
diff --git a/quiche/http2/hpack/varint/hpack_varint_encoder.cc b/quiche/http2/hpack/varint/hpack_varint_encoder.cc
index d7fc66b..89beb4a 100644
--- a/quiche/http2/hpack/varint/hpack_varint_encoder.cc
+++ b/quiche/http2/hpack/varint/hpack_varint_encoder.cc
@@ -11,10 +11,8 @@
namespace http2 {
// static
-void HpackVarintEncoder::Encode(uint8_t high_bits,
- uint8_t prefix_length,
- uint64_t varint,
- std::string* output) {
+void HpackVarintEncoder::Encode(uint8_t high_bits, uint8_t prefix_length,
+ uint64_t varint, std::string* output) {
QUICHE_DCHECK_LE(1u, prefix_length);
QUICHE_DCHECK_LE(prefix_length, 8u);
diff --git a/quiche/http2/hpack/varint/hpack_varint_encoder.h b/quiche/http2/hpack/varint/hpack_varint_encoder.h
index b120ece..69acc16 100644
--- a/quiche/http2/hpack/varint/hpack_varint_encoder.h
+++ b/quiche/http2/hpack/varint/hpack_varint_encoder.h
@@ -20,9 +20,7 @@
public:
// Encode |varint|, appending encoded data to |*output|.
// Appends between 1 and 11 bytes in total.
- static void Encode(uint8_t high_bits,
- uint8_t prefix_length,
- uint64_t varint,
+ static void Encode(uint8_t high_bits, uint8_t prefix_length, uint64_t varint,
std::string* output);
};
diff --git a/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc b/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc
index 44d5b46..ba51649 100644
--- a/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc
+++ b/quiche/http2/hpack/varint/hpack_varint_round_trip_test.cc
@@ -110,9 +110,7 @@
// HpackVarintDecoder is as expected, which also acts as confirmation that
// my thinking about the encodings being used by the tests, i.e. cover the
// range desired.
- void ValidateEncoding(uint64_t value,
- uint64_t minimum,
- uint64_t maximum,
+ void ValidateEncoding(uint64_t value, uint64_t minimum, uint64_t maximum,
size_t expected_bytes) {
ASSERT_EQ(expected_bytes, buffer_.size());
if (expected_bytes > 1) {
@@ -155,8 +153,7 @@
}
void EncodeAndDecodeValues(const std::set<uint64_t>& values,
- uint8_t prefix_length,
- size_t expected_bytes) {
+ uint8_t prefix_length, size_t expected_bytes) {
QUICHE_CHECK(!values.empty());
const uint64_t minimum = *values.begin();
const uint64_t maximum = *values.rbegin();
@@ -201,8 +198,7 @@
// Encode values (all or some of it) in [start, start+range). Check
// that |start| is the smallest value and |start+range-1| is the largest value
// corresponding to |expected_bytes|, except if |expected_bytes| is maximal.
- void EncodeAndDecodeValuesInRange(uint64_t start,
- uint64_t range,
+ void EncodeAndDecodeValuesInRange(uint64_t start, uint64_t range,
uint8_t prefix_length,
size_t expected_bytes) {
const uint8_t prefix_mask = (1 << prefix_length) - 1;
diff --git a/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.cc b/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.cc
index 1b234a1..ed94cf5 100644
--- a/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.cc
+++ b/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.cc
@@ -15,8 +15,7 @@
namespace test {
void NoopEncoderStreamErrorDelegate::OnEncoderStreamError(
- QuicErrorCode /* error_code */,
- absl::string_view /*error_message*/) {}
+ QuicErrorCode /* error_code */, absl::string_view /*error_message*/) {}
TestHeadersHandler::TestHeadersHandler()
: decoding_completed_(false), decoding_error_detected_(false) {}
@@ -66,8 +65,7 @@
}
void QpackDecode(
- uint64_t maximum_dynamic_table_capacity,
- uint64_t maximum_blocked_streams,
+ uint64_t maximum_dynamic_table_capacity, uint64_t maximum_blocked_streams,
QpackDecoder::EncoderStreamErrorDelegate* encoder_stream_error_delegate,
QpackStreamSenderDelegate* decoder_stream_sender_delegate,
QpackProgressiveDecoder::HeadersHandlerInterface* handler,
diff --git a/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.h b/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.h
index 5c1b4f1..e3b9680 100644
--- a/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.h
+++ b/quiche/quic/test_tools/qpack/qpack_decoder_test_utils.h
@@ -34,8 +34,7 @@
public:
~MockEncoderStreamErrorDelegate() override = default;
- MOCK_METHOD(void,
- OnEncoderStreamError,
+ MOCK_METHOD(void, OnEncoderStreamError,
(QuicErrorCode error_code, absl::string_view error_message),
(override));
};
@@ -78,10 +77,8 @@
MockHeadersHandler& operator=(const MockHeadersHandler&) = delete;
~MockHeadersHandler() override = default;
- MOCK_METHOD(void,
- OnHeaderDecoded,
- (absl::string_view name, absl::string_view value),
- (override));
+ MOCK_METHOD(void, OnHeaderDecoded,
+ (absl::string_view name, absl::string_view value), (override));
MOCK_METHOD(void, OnDecodingCompleted, (), (override));
MOCK_METHOD(void, OnDecodingErrorDetected,
(QuicErrorCode error_code, absl::string_view error_message),
@@ -101,8 +98,7 @@
};
void QpackDecode(
- uint64_t maximum_dynamic_table_capacity,
- uint64_t maximum_blocked_streams,
+ uint64_t maximum_dynamic_table_capacity, uint64_t maximum_blocked_streams,
QpackDecoder::EncoderStreamErrorDelegate* encoder_stream_error_delegate,
QpackStreamSenderDelegate* decoder_stream_sender_delegate,
QpackProgressiveDecoder::HeadersHandlerInterface* handler,
diff --git a/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.cc b/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.cc
index ad357a1..718e8fa 100644
--- a/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.cc
+++ b/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.cc
@@ -11,8 +11,7 @@
namespace test {
void NoopDecoderStreamErrorDelegate::OnDecoderStreamError(
- QuicErrorCode /*error_code*/,
- absl::string_view /*error_message*/) {}
+ QuicErrorCode /*error_code*/, absl::string_view /*error_message*/) {}
} // namespace test
} // namespace quic
diff --git a/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.h b/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.h
index 93d242c..fc4621f 100644
--- a/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.h
+++ b/quiche/quic/test_tools/qpack/qpack_encoder_test_utils.h
@@ -32,8 +32,7 @@
public:
~MockDecoderStreamErrorDelegate() override = default;
- MOCK_METHOD(void,
- OnDecoderStreamError,
+ MOCK_METHOD(void, OnDecoderStreamError,
(QuicErrorCode error_code, absl::string_view error_message),
(override));
};
diff --git a/quiche/quic/test_tools/qpack/qpack_test_utils.cc b/quiche/quic/test_tools/qpack/qpack_test_utils.cc
index b6f5317..3d7f20c 100644
--- a/quiche/quic/test_tools/qpack/qpack_test_utils.cc
+++ b/quiche/quic/test_tools/qpack/qpack_test_utils.cc
@@ -5,6 +5,7 @@
#include "quiche/quic/test_tools/qpack/qpack_test_utils.h"
#include <limits>
+
#include "quiche/quic/platform/api/quic_bug_tracker.h"
namespace quic {
diff --git a/quiche/spdy/core/hpack/hpack_decoder_adapter.cc b/quiche/spdy/core/hpack/hpack_decoder_adapter.cc
index 447f258..874a794 100644
--- a/quiche/spdy/core/hpack/hpack_decoder_adapter.cc
+++ b/quiche/spdy/core/hpack/hpack_decoder_adapter.cc
@@ -39,8 +39,7 @@
}
bool HpackDecoderAdapter::HandleControlFrameHeadersData(
- const char* headers_data,
- size_t headers_data_length) {
+ const char* headers_data, size_t headers_data_length) {
QUICHE_DVLOG(2) << "HpackDecoderAdapter::HandleControlFrameHeadersData: len="
<< headers_data_length;
if (!header_block_started_) {
diff --git a/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc b/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc
index f51e2a9..33cc477 100644
--- a/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc
+++ b/quiche/spdy/core/hpack/hpack_decoder_adapter_test.cc
@@ -226,9 +226,7 @@
return decoded_block();
}
- void expectEntry(size_t index,
- size_t size,
- const std::string& name,
+ void expectEntry(size_t index, size_t size, const std::string& name,
const std::string& value) {
const HpackStringPair* entry = decoder_peer_.GetTableEntry(index);
EXPECT_EQ(name, entry->name) << "index " << index;
@@ -256,14 +254,12 @@
};
INSTANTIATE_TEST_SUITE_P(
- NoHandler,
- HpackDecoderAdapterTest,
+ NoHandler, HpackDecoderAdapterTest,
::testing::Combine(::testing::Values(START_WITHOUT_HANDLER, NO_START),
::testing::Bool()));
INSTANTIATE_TEST_SUITE_P(
- WithHandler,
- HpackDecoderAdapterTest,
+ WithHandler, HpackDecoderAdapterTest,
::testing::Combine(::testing::Values(START_WITH_HANDLER),
::testing::Bool()));
diff --git a/quiche/spdy/core/hpack/hpack_encoder_test.cc b/quiche/spdy/core/hpack/hpack_encoder_test.cc
index 6e53fed..886b9ed 100644
--- a/quiche/spdy/core/hpack/hpack_encoder_test.cc
+++ b/quiche/spdy/core/hpack/hpack_encoder_test.cc
@@ -276,8 +276,7 @@
using HpackEncoderTestWithDefaultStrategy = HpackEncoderTest;
-INSTANTIATE_TEST_SUITE_P(HpackEncoderTests,
- HpackEncoderTestWithDefaultStrategy,
+INSTANTIATE_TEST_SUITE_P(HpackEncoderTests, HpackEncoderTestWithDefaultStrategy,
::testing::Values(kDefault));
TEST_P(HpackEncoderTestWithDefaultStrategy, EncodeRepresentations) {
@@ -336,10 +335,8 @@
EXPECT_GT(encoder_.GetDynamicTableSize(), kInitialDynamicTableSize);
}
-INSTANTIATE_TEST_SUITE_P(HpackEncoderTests,
- HpackEncoderTest,
- ::testing::Values(kDefault,
- kIncremental,
+INSTANTIATE_TEST_SUITE_P(HpackEncoderTests, HpackEncoderTest,
+ ::testing::Values(kDefault, kIncremental,
kRepresentations));
TEST_P(HpackEncoderTest, SingleDynamicIndex) {
diff --git a/quiche/spdy/core/hpack/hpack_entry.cc b/quiche/spdy/core/hpack/hpack_entry.cc
index e8f911e..437b5d0 100644
--- a/quiche/spdy/core/hpack/hpack_entry.cc
+++ b/quiche/spdy/core/hpack/hpack_entry.cc
@@ -15,9 +15,7 @@
size_t HpackEntry::Size(absl::string_view name, absl::string_view value) {
return name.size() + value.size() + kHpackEntrySizeOverhead;
}
-size_t HpackEntry::Size() const {
- return Size(name(), value());
-}
+size_t HpackEntry::Size() const { return Size(name(), value()); }
std::string HpackEntry::GetDebugString() const {
return absl::StrCat("{ name: \"", name_, "\", value: \"", value_, "\" }");
diff --git a/quiche/spdy/core/hpack/hpack_header_table.h b/quiche/spdy/core/hpack/hpack_header_table.h
index 8aed099..7886dde 100644
--- a/quiche/spdy/core/hpack/hpack_header_table.h
+++ b/quiche/spdy/core/hpack/hpack_header_table.h
@@ -85,8 +85,7 @@
// Determine the set of entries which would be evicted by the insertion
// of |name| & |value| into the table, as per section 4.4. No eviction
// actually occurs. The set is returned via range [begin_out, end_out).
- void EvictionSet(absl::string_view name,
- absl::string_view value,
+ void EvictionSet(absl::string_view name, absl::string_view value,
DynamicEntryTable::iterator* begin_out,
DynamicEntryTable::iterator* end_out);
diff --git a/quiche/spdy/core/hpack/hpack_round_trip_test.cc b/quiche/spdy/core/hpack/hpack_round_trip_test.cc
index 7a9a262..30a2e77 100644
--- a/quiche/spdy/core/hpack/hpack_round_trip_test.cc
+++ b/quiche/spdy/core/hpack/hpack_round_trip_test.cc
@@ -74,10 +74,8 @@
HpackDecoderAdapter decoder_;
};
-INSTANTIATE_TEST_SUITE_P(Tests,
- HpackRoundTripTest,
- ::testing::Values(ALL_INPUT,
- ONE_BYTE,
+INSTANTIATE_TEST_SUITE_P(Tests, HpackRoundTripTest,
+ ::testing::Values(ALL_INPUT, ONE_BYTE,
ZERO_THEN_ONE_BYTE));
TEST_P(HpackRoundTripTest, ResponseFixtures) {