gfe-relnote: n/a(code clean up) Apply quic compile options to spdy/core
code.
These options are added to enhance cross platfrom compatibility. As spdy is also part of QUICHE, it's good to apply these options as well.
Fix all the violations under third_party/spdy/core.
Platform-ize gunit, gmock and gunit_main
PiperOrigin-RevId: 255038615
Change-Id: I6ad003f68679f8adf4b2582c7dea3b6b950f0acc
diff --git a/spdy/core/array_output_buffer_test.cc b/spdy/core/array_output_buffer_test.cc
index 369778d..aac657a 100644
--- a/spdy/core/array_output_buffer_test.cc
+++ b/spdy/core/array_output_buffer_test.cc
@@ -4,8 +4,7 @@
#include "net/third_party/quiche/src/spdy/core/array_output_buffer.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace test {
diff --git a/spdy/core/hpack/hpack_decoder_adapter_test.cc b/spdy/core/hpack/hpack_decoder_adapter_test.cc
index 0d952d1..335920e 100644
--- a/spdy/core/hpack/hpack_decoder_adapter_test.cc
+++ b/spdy/core/hpack/hpack_decoder_adapter_test.cc
@@ -12,8 +12,6 @@
#include <utility>
#include <vector>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
@@ -26,6 +24,7 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
using ::http2::HpackEntryType;
using ::http2::HpackString;
diff --git a/spdy/core/hpack/hpack_encoder_test.cc b/spdy/core/hpack/hpack_encoder_test.cc
index a4f763c..4a70dc0 100644
--- a/spdy/core/hpack/hpack_encoder_test.cc
+++ b/spdy/core/hpack/hpack_encoder_test.cc
@@ -7,10 +7,9 @@
#include <cstdint>
#include <map>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_unsafe_arena.h"
namespace spdy {
diff --git a/spdy/core/hpack/hpack_entry_test.cc b/spdy/core/hpack/hpack_entry_test.cc
index 507c851..224ac18 100644
--- a/spdy/core/hpack/hpack_entry_test.cc
+++ b/spdy/core/hpack/hpack_entry_test.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/hpack/hpack_header_table_test.cc b/spdy/core/hpack/hpack_header_table_test.cc
index 6649cc2..4001174 100644
--- a/spdy/core/hpack/hpack_header_table_test.cc
+++ b/spdy/core/hpack/hpack_header_table_test.cc
@@ -9,10 +9,10 @@
#include <set>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/hpack/hpack_huffman_table_test.cc b/spdy/core/hpack/hpack_huffman_table_test.cc
index 2febbd8..efade41 100644
--- a/spdy/core/hpack/hpack_huffman_table_test.cc
+++ b/spdy/core/hpack/hpack_huffman_table_test.cc
@@ -6,13 +6,12 @@
#include <utility>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/hpack/hpack_output_stream_test.cc b/spdy/core/hpack/hpack_output_stream_test.cc
index 823c41b..9e1988d 100644
--- a/spdy/core/hpack/hpack_output_stream_test.cc
+++ b/spdy/core/hpack/hpack_output_stream_test.cc
@@ -6,7 +6,7 @@
#include <cstddef>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/hpack/hpack_round_trip_test.cc b/spdy/core/hpack/hpack_round_trip_test.cc
index 17477a7..c035812 100644
--- a/spdy/core/hpack/hpack_round_trip_test.cc
+++ b/spdy/core/hpack/hpack_round_trip_test.cc
@@ -7,13 +7,13 @@
#include <ctime>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace test {
diff --git a/spdy/core/hpack/hpack_static_table_test.cc b/spdy/core/hpack/hpack_static_table_test.cc
index 4550be0..3f51955 100644
--- a/spdy/core/hpack/hpack_static_table_test.cc
+++ b/spdy/core/hpack/hpack_static_table_test.cc
@@ -7,9 +7,9 @@
#include <set>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/http2_frame_decoder_adapter.cc b/spdy/core/http2_frame_decoder_adapter.cc
index e5e3e9a..5a59a8e 100644
--- a/spdy/core/http2_frame_decoder_adapter.cc
+++ b/spdy/core/http2_frame_decoder_adapter.cc
@@ -76,8 +76,9 @@
// Overwrites the fields of the header with invalid values, for the purpose
// of identifying reading of unset fields. Only takes effect for debug builds.
// In Address Sanatizer builds, it also marks the fields as un-readable.
-void CorruptFrameHeader(Http2FrameHeader* header) {
+void CorruptFrameHeader(Http2FrameHeader*
#ifndef NDEBUG
+ header) {
// Beyond a valid payload length, which is 2^24 - 1.
header->payload_length = 0x1010dead;
// An unsupported frame type.
@@ -88,6 +89,8 @@
// A stream id with the reserved high-bit (R in the RFC) set.
// 2129510127 when the high-bit is cleared.
header->stream_id = 0xfeedbeef;
+#else
+ /*header*/) {
#endif
}
@@ -455,7 +458,7 @@
}
}
-void Http2DecoderAdapter::OnPadding(const char* padding,
+void Http2DecoderAdapter::OnPadding(const char* /*padding*/,
size_t skipped_length) {
SPDY_DVLOG(1) << "OnPadding: " << skipped_length;
if (frame_header_.type == Http2FrameType::DATA) {
@@ -1015,8 +1018,8 @@
namespace spdy {
-bool SpdyFramerVisitorInterface::OnGoAwayFrameData(const char* goaway_data,
- size_t len) {
+bool SpdyFramerVisitorInterface::OnGoAwayFrameData(const char* /*goaway_data*/,
+ size_t /*len*/) {
return true;
}
diff --git a/spdy/core/http2_frame_decoder_adapter.h b/spdy/core/http2_frame_decoder_adapter.h
index 86489c6..3c05858 100644
--- a/spdy/core/http2_frame_decoder_adapter.h
+++ b/spdy/core/http2_frame_decoder_adapter.h
@@ -379,7 +379,8 @@
// Called when padding length field is received on a DATA frame.
// |stream_id| The stream receiving data.
// |value| The value of the padding length field.
- virtual void OnStreamPadLength(SpdyStreamId stream_id, size_t value) {}
+ virtual void OnStreamPadLength(SpdyStreamId /*stream_id*/, size_t /*value*/) {
+ }
// Called when padding is received (the trailing octets, not pad_len field) on
// a DATA frame.
diff --git a/spdy/core/mock_spdy_framer_visitor.h b/spdy/core/mock_spdy_framer_visitor.h
index 124efe5..9dd709c 100644
--- a/spdy/core/mock_spdy_framer_visitor.h
+++ b/spdy/core/mock_spdy_framer_visitor.h
@@ -8,11 +8,11 @@
#include <cstdint>
#include <memory>
-#include "testing/gmock/include/gmock/gmock.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/priority_write_scheduler_test.cc b/spdy/core/priority_write_scheduler_test.cc
index 08a4ff6..ae348be 100644
--- a/spdy/core/priority_write_scheduler_test.cc
+++ b/spdy/core/priority_write_scheduler_test.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/spdy/core/priority_write_scheduler.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_test_helpers.h"
namespace spdy {
diff --git a/spdy/core/spdy_alt_svc_wire_format_test.cc b/spdy/core/spdy_alt_svc_wire_format_test.cc
index c30edf2..bda5bc5 100644
--- a/spdy/core/spdy_alt_svc_wire_format_test.cc
+++ b/spdy/core/spdy_alt_svc_wire_format_test.cc
@@ -4,9 +4,8 @@
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/spdy_deframer_visitor.cc b/spdy/core/spdy_deframer_visitor.cc
index ac93de4..39a2e51 100644
--- a/spdy/core/spdy_deframer_visitor.cc
+++ b/spdy/core/spdy_deframer_visitor.cc
@@ -11,7 +11,6 @@
#include <limits>
#include <memory>
-#include "testing/gmock/include/gmock/gmock.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h"
@@ -498,7 +497,7 @@
}
SpdyHeadersHandlerInterface* SpdyTestDeframerImpl::OnHeaderFrameStart(
- SpdyStreamId stream_id) {
+ SpdyStreamId /*stream_id*/) {
return this;
}
@@ -736,7 +735,7 @@
// of the set of currently open streams. For now we'll assume that unknown
// frame types are unsupported.
bool SpdyTestDeframerImpl::OnUnknownFrame(SpdyStreamId stream_id,
- uint8_t frame_type) {
+ uint8_t /*frame_type*/) {
SPDY_DVLOG(1) << "OnAltSvc stream_id: " << stream_id;
CHECK_EQ(frame_type_, UNSET)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
@@ -1018,8 +1017,8 @@
// The SpdyFramer will not process any more data at this point.
void DeframerCallbackCollector::OnError(
- http2::Http2DecoderAdapter::SpdyFramerError error,
- SpdyTestDeframer* deframer) {
+ http2::Http2DecoderAdapter::SpdyFramerError /*error*/,
+ SpdyTestDeframer* /*deframer*/) {
CollectedFrame cf;
cf.error_reported = true;
collected_frames_->push_back(std::move(cf));
diff --git a/spdy/core/spdy_deframer_visitor.h b/spdy/core/spdy_deframer_visitor.h
index e3d01b2..272a4f6 100644
--- a/spdy/core/spdy_deframer_visitor.h
+++ b/spdy/core/spdy_deframer_visitor.h
@@ -74,7 +74,6 @@
#include <utility>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.h"
@@ -115,43 +114,43 @@
static std::unique_ptr<SpdyDeframerVisitorInterface> LogBeforeVisiting(
std::unique_ptr<SpdyDeframerVisitorInterface> wrapped_visitor);
- virtual void OnAltSvc(std::unique_ptr<SpdyAltSvcIR> frame) {}
- virtual void OnData(std::unique_ptr<SpdyDataIR> frame) {}
- virtual void OnGoAway(std::unique_ptr<SpdyGoAwayIR> frame) {}
+ virtual void OnAltSvc(std::unique_ptr<SpdyAltSvcIR> /*frame*/) {}
+ virtual void OnData(std::unique_ptr<SpdyDataIR> /*frame*/) {}
+ virtual void OnGoAway(std::unique_ptr<SpdyGoAwayIR> /*frame*/) {}
// SpdyHeadersIR and SpdyPushPromiseIR each has a SpdyHeaderBlock which
// significantly modifies the headers, so the actual header entries (name
// and value strings) are provided in a vector.
- virtual void OnHeaders(std::unique_ptr<SpdyHeadersIR> frame,
- std::unique_ptr<StringPairVector> headers) {}
+ virtual void OnHeaders(std::unique_ptr<SpdyHeadersIR> /*frame*/,
+ std::unique_ptr<StringPairVector> /*headers*/) {}
- virtual void OnPing(std::unique_ptr<SpdyPingIR> frame) {}
- virtual void OnPingAck(std::unique_ptr<SpdyPingIR> frame);
- virtual void OnPriority(std::unique_ptr<SpdyPriorityIR> frame) {}
+ virtual void OnPing(std::unique_ptr<SpdyPingIR> /*frame*/) {}
+ virtual void OnPingAck(std::unique_ptr<SpdyPingIR> /*frame*/);
+ virtual void OnPriority(std::unique_ptr<SpdyPriorityIR> /*frame*/) {}
// SpdyHeadersIR and SpdyPushPromiseIR each has a SpdyHeaderBlock which
// significantly modifies the headers, so the actual header entries (name
// and value strings) are provided in a vector.
- virtual void OnPushPromise(std::unique_ptr<SpdyPushPromiseIR> frame,
- std::unique_ptr<StringPairVector> headers) {}
+ virtual void OnPushPromise(std::unique_ptr<SpdyPushPromiseIR> /*frame*/,
+ std::unique_ptr<StringPairVector> /*headers*/) {}
- virtual void OnRstStream(std::unique_ptr<SpdyRstStreamIR> frame) {}
+ virtual void OnRstStream(std::unique_ptr<SpdyRstStreamIR> /*frame*/) {}
// SpdySettingsIR has a map for settings, so loses info about the order of
// settings, and whether the same setting appeared more than once, so the
// the actual settings (parameter and value) are provided in a vector.
- virtual void OnSettings(std::unique_ptr<SpdySettingsIR> frame,
- std::unique_ptr<SettingVector> settings) {}
+ virtual void OnSettings(std::unique_ptr<SpdySettingsIR> /*frame*/,
+ std::unique_ptr<SettingVector> /*settings*/) {}
// A settings frame with an ACK has no content, but for uniformity passing
// a frame with the ACK flag set.
- virtual void OnSettingsAck(std::unique_ptr<SpdySettingsIR> frame);
+ virtual void OnSettingsAck(std::unique_ptr<SpdySettingsIR> /*frame*/);
- virtual void OnWindowUpdate(std::unique_ptr<SpdyWindowUpdateIR> frame) {}
+ virtual void OnWindowUpdate(std::unique_ptr<SpdyWindowUpdateIR> /*frame*/) {}
// The SpdyFramer will not process any more data at this point.
- virtual void OnError(http2::Http2DecoderAdapter::SpdyFramerError error,
- SpdyTestDeframer* deframer) {}
+ virtual void OnError(http2::Http2DecoderAdapter::SpdyFramerError /*error*/,
+ SpdyTestDeframer* /*deframer*/) {}
};
class SpdyTestDeframer : public SpdyFramerVisitorInterface {
diff --git a/spdy/core/spdy_deframer_visitor_test.cc b/spdy/core/spdy_deframer_visitor_test.cc
index e4f7218..82a85be 100644
--- a/spdy/core/spdy_deframer_visitor_test.cc
+++ b/spdy/core/spdy_deframer_visitor_test.cc
@@ -9,7 +9,6 @@
#include <algorithm>
#include <limits>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h"
@@ -21,6 +20,7 @@
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace test {
diff --git a/spdy/core/spdy_frame_builder_test.cc b/spdy/core/spdy_frame_builder_test.cc
index 11d3c7b..c5f234e 100644
--- a/spdy/core/spdy_frame_builder_test.cc
+++ b/spdy/core/spdy_frame_builder_test.cc
@@ -6,11 +6,11 @@
#include <memory>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/array_output_buffer.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_export.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/spdy_frame_reader_test.cc b/spdy/core/spdy_frame_reader_test.cc
index 8caf60f..92c8e9b 100644
--- a/spdy/core/spdy_frame_reader_test.cc
+++ b/spdy/core/spdy_frame_reader_test.cc
@@ -6,9 +6,9 @@
#include <cstdint>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_arraysize.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/spdy_framer.cc b/spdy/core/spdy_framer.cc
index 4e3ad1b..7891d72 100644
--- a/spdy/core/spdy_framer.cc
+++ b/spdy/core/spdy_framer.cc
@@ -840,7 +840,7 @@
}
}
- void VisitRstStream(const SpdyRstStreamIR& rst_stream) override {
+ void VisitRstStream(const SpdyRstStreamIR& /*rst_stream*/) override {
flags_ = kNoFlags;
}
@@ -858,7 +858,9 @@
}
}
- void VisitGoAway(const SpdyGoAwayIR& goaway) override { flags_ = kNoFlags; }
+ void VisitGoAway(const SpdyGoAwayIR& /*goaway*/) override {
+ flags_ = kNoFlags;
+ }
// TODO(diannahu): The END_HEADERS flag is incorrect for HEADERS that require
// CONTINUATION frames.
@@ -875,7 +877,7 @@
}
}
- void VisitWindowUpdate(const SpdyWindowUpdateIR& window_update) override {
+ void VisitWindowUpdate(const SpdyWindowUpdateIR& /*window_update*/) override {
flags_ = kNoFlags;
}
@@ -890,13 +892,15 @@
// TODO(diannahu): The END_HEADERS flag is incorrect for CONTINUATIONs that
// require CONTINUATION frames.
- void VisitContinuation(const SpdyContinuationIR& continuation) override {
+ void VisitContinuation(const SpdyContinuationIR& /*continuation*/) override {
flags_ = HEADERS_FLAG_END_HEADERS;
}
- void VisitAltSvc(const SpdyAltSvcIR& altsvc) override { flags_ = kNoFlags; }
+ void VisitAltSvc(const SpdyAltSvcIR& /*altsvc*/) override {
+ flags_ = kNoFlags;
+ }
- void VisitPriority(const SpdyPriorityIR& priority) override {
+ void VisitPriority(const SpdyPriorityIR& /*priority*/) override {
flags_ = kNoFlags;
}
diff --git a/spdy/core/spdy_framer_test.cc b/spdy/core/spdy_framer_test.cc
index 0caa160..abca5a7 100644
--- a/spdy/core/spdy_framer_test.cc
+++ b/spdy/core/spdy_framer_test.cc
@@ -12,8 +12,6 @@
#include <tuple>
#include <vector>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/array_output_buffer.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h"
@@ -28,6 +26,7 @@
#include "net/third_party/quiche/src/spdy/platform/api/spdy_ptr_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
using ::http2::Http2DecoderAdapter;
using ::testing::_;
@@ -315,14 +314,14 @@
}
SpdyHeadersHandlerInterface* OnHeaderFrameStart(
- SpdyStreamId stream_id) override {
+ SpdyStreamId /*stream_id*/) override {
if (headers_handler_ == nullptr) {
headers_handler_ = SpdyMakeUnique<TestHeadersHandler>();
}
return headers_handler_.get();
}
- void OnHeaderFrameEnd(SpdyStreamId stream_id) override {
+ void OnHeaderFrameEnd(SpdyStreamId /*stream_id*/) override {
CHECK(headers_handler_ != nullptr);
headers_ = headers_handler_->decoded_block().Clone();
header_bytes_received_ = headers_handler_->header_bytes_parsed();
diff --git a/spdy/core/spdy_header_block_test.cc b/spdy/core/spdy_header_block_test.cc
index 3511a21..f869431 100644
--- a/spdy/core/spdy_header_block_test.cc
+++ b/spdy/core/spdy_header_block_test.cc
@@ -7,9 +7,8 @@
#include <memory>
#include <utility>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
using ::testing::ElementsAre;
diff --git a/spdy/core/spdy_no_op_visitor.cc b/spdy/core/spdy_no_op_visitor.cc
index 5dcc15c..20a19f7 100644
--- a/spdy/core/spdy_no_op_visitor.cc
+++ b/spdy/core/spdy_no_op_visitor.cc
@@ -16,12 +16,12 @@
SpdyNoOpVisitor::~SpdyNoOpVisitor() = default;
SpdyHeadersHandlerInterface* SpdyNoOpVisitor::OnHeaderFrameStart(
- SpdyStreamId stream_id) {
+ SpdyStreamId /*stream_id*/) {
return this;
}
-bool SpdyNoOpVisitor::OnUnknownFrame(SpdyStreamId stream_id,
- uint8_t frame_type) {
+bool SpdyNoOpVisitor::OnUnknownFrame(SpdyStreamId /*stream_id*/,
+ uint8_t /*frame_type*/) {
return true;
}
diff --git a/spdy/core/spdy_no_op_visitor.h b/spdy/core/spdy_no_op_visitor.h
index 80e1535..6e4a48a 100644
--- a/spdy/core/spdy_no_op_visitor.h
+++ b/spdy/core/spdy_no_op_visitor.h
@@ -26,59 +26,63 @@
~SpdyNoOpVisitor() override;
// SpdyFramerVisitorInterface methods:
- void OnError(http2::Http2DecoderAdapter::SpdyFramerError error) override {}
+ void OnError(http2::Http2DecoderAdapter::SpdyFramerError /*error*/) override {
+ }
SpdyHeadersHandlerInterface* OnHeaderFrameStart(
SpdyStreamId stream_id) override;
- void OnHeaderFrameEnd(SpdyStreamId stream_id) override {}
- void OnDataFrameHeader(SpdyStreamId stream_id,
- size_t length,
- bool fin) override {}
- void OnStreamFrameData(SpdyStreamId stream_id,
- const char* data,
- size_t len) override {}
- void OnStreamEnd(SpdyStreamId stream_id) override {}
- void OnStreamPadding(SpdyStreamId stream_id, size_t len) override {}
- void OnRstStream(SpdyStreamId stream_id, SpdyErrorCode error_code) override {}
- void OnSetting(SpdySettingsId id, uint32_t value) override {}
- void OnPing(SpdyPingId unique_id, bool is_ack) override {}
+ void OnHeaderFrameEnd(SpdyStreamId /*stream_id*/) override {}
+ void OnDataFrameHeader(SpdyStreamId /*stream_id*/,
+ size_t /*length*/,
+ bool /*fin*/) override {}
+ void OnStreamFrameData(SpdyStreamId /*stream_id*/,
+ const char* /*data*/,
+ size_t /*len*/) override {}
+ void OnStreamEnd(SpdyStreamId /*stream_id*/) override {}
+ void OnStreamPadding(SpdyStreamId /*stream_id*/, size_t /*len*/) override {}
+ void OnRstStream(SpdyStreamId /*stream_id*/,
+ SpdyErrorCode /*error_code*/) override {}
+ void OnSetting(SpdySettingsId /*id*/, uint32_t /*value*/) override {}
+ void OnPing(SpdyPingId /*unique_id*/, bool /*is_ack*/) override {}
void OnSettingsEnd() override {}
void OnSettingsAck() override {}
- void OnGoAway(SpdyStreamId last_accepted_stream_id,
- SpdyErrorCode error_code) override {}
- void OnHeaders(SpdyStreamId stream_id,
- bool has_priority,
- int weight,
- SpdyStreamId parent_stream_id,
- bool exclusive,
- bool fin,
- bool end) override {}
- void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override {}
- void OnPushPromise(SpdyStreamId stream_id,
- SpdyStreamId promised_stream_id,
- bool end) override {}
- void OnContinuation(SpdyStreamId stream_id, bool end) override {}
- void OnAltSvc(SpdyStreamId stream_id,
- SpdyStringPiece origin,
+ void OnGoAway(SpdyStreamId /*last_accepted_stream_id*/,
+ SpdyErrorCode /*error_code*/) override {}
+ void OnHeaders(SpdyStreamId /*stream_id*/,
+ bool /*has_priority*/,
+ int /*weight*/,
+ SpdyStreamId /*parent_stream_id*/,
+ bool /*exclusive*/,
+ bool /*fin*/,
+ bool /*end*/) override {}
+ void OnWindowUpdate(SpdyStreamId /*stream_id*/,
+ int /*delta_window_size*/) override {}
+ void OnPushPromise(SpdyStreamId /*stream_id*/,
+ SpdyStreamId /*promised_stream_id*/,
+ bool /*end*/) override {}
+ void OnContinuation(SpdyStreamId /*stream_id*/, bool /*end*/) override {}
+ void OnAltSvc(SpdyStreamId /*stream_id*/,
+ SpdyStringPiece /*origin*/,
const SpdyAltSvcWireFormat::AlternativeServiceVector&
- altsvc_vector) override {}
- void OnPriority(SpdyStreamId stream_id,
- SpdyStreamId parent_stream_id,
- int weight,
- bool exclusive) override {}
- bool OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) override;
+ /*altsvc_vector*/) override {}
+ void OnPriority(SpdyStreamId /*stream_id*/,
+ SpdyStreamId /*parent_stream_id*/,
+ int /*weight*/,
+ bool /*exclusive*/) override {}
+ bool OnUnknownFrame(SpdyStreamId /*stream_id*/,
+ uint8_t /*frame_type*/) override;
// SpdyFramerDebugVisitorInterface methods:
- void OnSendCompressedFrame(SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t payload_len,
- size_t frame_len) override {}
- void OnReceiveCompressedFrame(SpdyStreamId stream_id,
- SpdyFrameType type,
- size_t frame_len) override {}
+ void OnSendCompressedFrame(SpdyStreamId /*stream_id*/,
+ SpdyFrameType /*type*/,
+ size_t /*payload_len*/,
+ size_t /*frame_len*/) override {}
+ void OnReceiveCompressedFrame(SpdyStreamId /*stream_id*/,
+ SpdyFrameType /*type*/,
+ size_t /*frame_len*/) override {}
// SpdyHeadersHandlerInterface methods:
void OnHeaderBlockStart() override {}
- void OnHeader(SpdyStringPiece key, SpdyStringPiece value) override {}
+ void OnHeader(SpdyStringPiece /*key*/, SpdyStringPiece /*value*/) override {}
void OnHeaderBlockEnd(size_t /* uncompressed_header_bytes */,
size_t /* compressed_header_bytes */) override {}
};
diff --git a/spdy/core/spdy_pinnable_buffer_piece_test.cc b/spdy/core/spdy_pinnable_buffer_piece_test.cc
index d5a6c33..d62af5b 100644
--- a/spdy/core/spdy_pinnable_buffer_piece_test.cc
+++ b/spdy/core/spdy_pinnable_buffer_piece_test.cc
@@ -4,10 +4,9 @@
#include "net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/spdy_prefixed_buffer_reader_test.cc b/spdy/core/spdy_prefixed_buffer_reader_test.cc
index 1d052c7..f570dfc 100644
--- a/spdy/core/spdy_prefixed_buffer_reader_test.cc
+++ b/spdy/core/spdy_prefixed_buffer_reader_test.cc
@@ -4,10 +4,9 @@
#include "net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader.h"
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
diff --git a/spdy/core/spdy_protocol.cc b/spdy/core/spdy_protocol.cc
index e454e08..d9b642f 100644
--- a/spdy/core/spdy_protocol.cc
+++ b/spdy/core/spdy_protocol.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
+#include <limits>
#include <ostream>
#include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h"
@@ -24,10 +25,9 @@
}
SpdyPriority ClampSpdy3Priority(SpdyPriority priority) {
- if (priority < kV3HighestPriority) {
- SPDY_BUG << "Invalid priority: " << static_cast<int>(priority);
- return kV3HighestPriority;
- }
+ static_assert(std::numeric_limits<SpdyPriority>::min() == kV3HighestPriority,
+ "The value of given priority shouldn't be smaller than highest "
+ "priority. Check this invariant explicitly.");
if (priority > kV3LowestPriority) {
SPDY_BUG << "Invalid priority: " << static_cast<int>(priority);
return kV3LowestPriority;
diff --git a/spdy/core/spdy_protocol_test.cc b/spdy/core/spdy_protocol_test.cc
index fc595a2..e10d2d6 100644
--- a/spdy/core/spdy_protocol_test.cc
+++ b/spdy/core/spdy_protocol_test.cc
@@ -8,9 +8,9 @@
#include <limits>
#include <memory>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/core/spdy_bitmasks.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_test_helpers.h"
namespace spdy {
diff --git a/spdy/core/spdy_protocol_test_utils.cc b/spdy/core/spdy_protocol_test_utils.cc
index 5714aa9..b8ffb4a 100644
--- a/spdy/core/spdy_protocol_test_utils.cc
+++ b/spdy/core/spdy_protocol_test_utils.cc
@@ -32,8 +32,8 @@
}
::testing::AssertionResult VerifySpdyFrameIREquals(
- const SpdyContinuationIR& expected,
- const SpdyContinuationIR& actual) {
+ const SpdyContinuationIR& /*expected*/,
+ const SpdyContinuationIR& /*actual*/) {
return ::testing::AssertionFailure()
<< "VerifySpdyFrameIREquals SpdyContinuationIR not yet implemented";
}
diff --git a/spdy/core/spdy_protocol_test_utils.h b/spdy/core/spdy_protocol_test_utils.h
index bb8bea3..8012db1 100644
--- a/spdy/core/spdy_protocol_test_utils.h
+++ b/spdy/core/spdy_protocol_test_utils.h
@@ -19,12 +19,11 @@
#include <typeinfo>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace test {
diff --git a/spdy/core/spdy_simple_arena_test.cc b/spdy/core/spdy_simple_arena_test.cc
index fc4b130..217e2d7 100644
--- a/spdy/core/spdy_simple_arena_test.cc
+++ b/spdy/core/spdy_simple_arena_test.cc
@@ -6,9 +6,9 @@
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace {
diff --git a/spdy/core/spdy_test_utils.cc b/spdy/core/spdy_test_utils.cc
index 622a5a6..bf54a1a 100644
--- a/spdy/core/spdy_test_utils.cc
+++ b/spdy/core/spdy_test_utils.cc
@@ -11,9 +11,9 @@
#include <utility>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace test {
diff --git a/spdy/platform/api/spdy_mem_slice_test.cc b/spdy/platform/api/spdy_mem_slice_test.cc
index af323f6..84313b0 100644
--- a/spdy/platform/api/spdy_mem_slice_test.cc
+++ b/spdy/platform/api/spdy_mem_slice_test.cc
@@ -6,7 +6,11 @@
#include <utility>
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Weverything"
+
#include "testing/gtest/include/gtest/gtest.h"
+#pragma clang diagnostic pop
namespace spdy {
namespace test {
diff --git a/spdy/platform/api/spdy_string_utils_test.cc b/spdy/platform/api/spdy_string_utils_test.cc
index 3f7e6a1..91656ae 100644
--- a/spdy/platform/api/spdy_string_utils_test.cc
+++ b/spdy/platform/api/spdy_string_utils_test.cc
@@ -6,8 +6,8 @@
#include <cstdint>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_piece.h"
+#include "net/third_party/quiche/src/spdy/platform/api/spdy_test.h"
namespace spdy {
namespace test {
diff --git a/spdy/platform/api/spdy_test.h b/spdy/platform/api/spdy_test.h
new file mode 100644
index 0000000..3b00cc0
--- /dev/null
+++ b/spdy/platform/api/spdy_test.h
@@ -0,0 +1,10 @@
+// Copyright (c) 2019 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef QUICHE_SPDY_PLATFORM_API_SPDY_TEST_H_
+#define QUICHE_SPDY_PLATFORM_API_SPDY_TEST_H_
+
+#include "net/spdy/platform/impl/spdy_test_impl.h"
+
+#endif // QUICHE_SPDY_PLATFORM_API_SPDY_TEST_H_