1 // Copyright 2021 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef QUICHE_BALSA_NOOP_BALSA_VISITOR_H_ 6 #define QUICHE_BALSA_NOOP_BALSA_VISITOR_H_ 7 8 #include <cstddef> 9 #include <memory> 10 11 #include "absl/strings/string_view.h" 12 #include "quiche/balsa/balsa_visitor_interface.h" 13 #include "quiche/common/platform/api/quiche_export.h" 14 15 namespace quiche { 16 17 class BalsaHeaders; 18 19 // Provides empty BalsaVisitorInterface overrides for convenience. 20 // Intended to be used as a base class for BalsaVisitorInterface subclasses that 21 // only need to override a small number of methods. 22 class QUICHE_EXPORT NoOpBalsaVisitor : public BalsaVisitorInterface { 23 public: 24 NoOpBalsaVisitor() = default; 25 26 NoOpBalsaVisitor(const NoOpBalsaVisitor&) = delete; 27 NoOpBalsaVisitor& operator=(const NoOpBalsaVisitor&) = delete; 28 ~NoOpBalsaVisitor()29 ~NoOpBalsaVisitor() override {} 30 OnRawBodyInput(absl::string_view)31 void OnRawBodyInput(absl::string_view /*input*/) override {} OnBodyChunkInput(absl::string_view)32 void OnBodyChunkInput(absl::string_view /*input*/) override {} OnHeaderInput(absl::string_view)33 void OnHeaderInput(absl::string_view /*input*/) override {} OnTrailerInput(absl::string_view)34 void OnTrailerInput(absl::string_view /*input*/) override {} ProcessHeaders(const BalsaHeaders &)35 void ProcessHeaders(const BalsaHeaders& /*headers*/) override {} OnTrailers(std::unique_ptr<BalsaHeaders>)36 void OnTrailers(std::unique_ptr<BalsaHeaders> /*trailers*/) override {} 37 OnRequestFirstLineInput(absl::string_view,absl::string_view,absl::string_view,absl::string_view)38 void OnRequestFirstLineInput(absl::string_view /*line_input*/, 39 absl::string_view /*method_input*/, 40 absl::string_view /*request_uri_input*/, 41 absl::string_view /*version_input*/) override {} OnResponseFirstLineInput(absl::string_view,absl::string_view,absl::string_view,absl::string_view)42 void OnResponseFirstLineInput(absl::string_view /*line_input*/, 43 absl::string_view /*version_input*/, 44 absl::string_view /*status_input*/, 45 absl::string_view /*reason_input*/) override {} OnChunkLength(size_t)46 void OnChunkLength(size_t /*chunk_length*/) override {} OnChunkExtensionInput(absl::string_view)47 void OnChunkExtensionInput(absl::string_view /*input*/) override {} OnInterimHeaders(std::unique_ptr<BalsaHeaders>)48 void OnInterimHeaders(std::unique_ptr<BalsaHeaders> /*headers*/) override {} ContinueHeaderDone()49 void ContinueHeaderDone() override {} HeaderDone()50 void HeaderDone() override {} MessageDone()51 void MessageDone() override {} HandleError(BalsaFrameEnums::ErrorCode)52 void HandleError(BalsaFrameEnums::ErrorCode /*error_code*/) override {} HandleWarning(BalsaFrameEnums::ErrorCode)53 void HandleWarning(BalsaFrameEnums::ErrorCode /*error_code*/) override {} 54 }; 55 56 } // namespace quiche 57 58 #endif // QUICHE_BALSA_NOOP_BALSA_VISITOR_H_ 59