#ifndef QUICHE_HTTP2_ADAPTER_HTTP2_VISITOR_INTERFACE_H_ #define QUICHE_HTTP2_ADAPTER_HTTP2_VISITOR_INTERFACE_H_ #include <cstdint> #include <vector> #include "absl/strings/string_view.h" #include "quiche/http2/adapter/http2_protocol.h" #include "quiche/common/platform/api/quiche_export.h" #include "quiche/common/platform/api/quiche_logging.h" namespace http2 { namespace adapter { // Http2VisitorInterface contains callbacks for receiving HTTP/2-level events. A // processor like NghttpAdapter parses HTTP/2 frames and invokes the callbacks // on an instance of this interface. Prefer a void return type for these // callbacks, instead setting output parameters as needed. // // Example sequences of calls/events: // GET: // - OnBeginHeadersForStream() // - OnHeaderForStream() // - OnEndHeadersForStream() // - OnEndStream() // // POST: // - OnBeginHeadersForStream() // - OnHeaderForStream() // - OnEndHeadersForStream() // - OnBeginDataForStream() // - OnDataForStream() // - OnEndStream() // // Request canceled mid-stream, e.g, with error code CANCEL: // - OnBeginHeadersForStream() // - OnHeaderForStream() // - OnEndHeadersForStream() // - OnRstStream() // - OnCloseStream() // // Request closed mid-stream, e.g., with error code NO_ERROR: // - OnBeginHeadersForStream() // - OnHeaderForStream() // - OnEndHeadersForStream() // - OnRstStream() // - OnCloseStream() // // More details are at RFC 7540 (go/http2spec). class QUICHE_EXPORT Http2VisitorInterface { … }; } // namespace adapter } // namespace http2 #endif // QUICHE_HTTP2_ADAPTER_HTTP2_VISITOR_INTERFACE_H_