1 // Copyright 2015 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.
5 #ifndef NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_
6 #define NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_
8 #include "base/strings/string_piece.h"
12 // This interface defines how an object that accepts header data should behave.
13 // It is used by both SpdyHeadersBlockParser and HpackDecoder.
14 class SpdyHeadersHandlerInterface
{
16 virtual ~SpdyHeadersHandlerInterface() {}
18 // A callback method which notifies when the parser starts handling a new
19 // header block fragment.
20 virtual void OnHeaderBlockStart() = 0;
22 // A callback method which notifies on a header key value pair. Multiple
23 // values for a given key will be emitted as multiple calls to OnHeader.
24 virtual void OnHeader(base::StringPiece key
, base::StringPiece value
) = 0;
26 // A callback method which notifies when the parser finishes handling a
27 // header block fragment. Also indicates the total number of bytes in this
29 virtual void OnHeaderBlockEnd(size_t header_bytes_parsed
) = 0;
34 #endif // NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_