| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_ | 5 #ifndef NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_ |
| 6 #define NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_ | 6 #define NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| 11 #include "net/base/net_export.h" |
| 11 | 12 |
| 12 namespace net { | 13 namespace net { |
| 13 | 14 |
| 14 // This interface defines how an object that accepts header data should behave. | 15 // This interface defines how an object that accepts header data should behave. |
| 15 // It is used by both SpdyHeadersBlockParser and HpackDecoder. | 16 // It is used by both SpdyHeadersBlockParser and HpackDecoder. |
| 16 class SpdyHeadersHandlerInterface { | 17 class NET_EXPORT_PRIVATE SpdyHeadersHandlerInterface { |
| 17 public: | 18 public: |
| 18 virtual ~SpdyHeadersHandlerInterface() {} | 19 virtual ~SpdyHeadersHandlerInterface() {} |
| 19 | 20 |
| 20 // A callback method which notifies when the parser starts handling a new | 21 // A callback method which notifies when the parser starts handling a new |
| 21 // header block. Will only be called once per block, even if it extends into | 22 // header block. Will only be called once per block, even if it extends into |
| 22 // CONTINUATION frames. | 23 // CONTINUATION frames. |
| 23 virtual void OnHeaderBlockStart() = 0; | 24 virtual void OnHeaderBlockStart() = 0; |
| 24 | 25 |
| 25 // A callback method which notifies on a header key value pair. Multiple | 26 // A callback method which notifies on a header key value pair. Multiple |
| 26 // values for a given key will be emitted as multiple calls to OnHeader. | 27 // values for a given key will be emitted as multiple calls to OnHeader. |
| 27 virtual void OnHeader(base::StringPiece key, base::StringPiece value) = 0; | 28 virtual void OnHeader(base::StringPiece key, base::StringPiece value) = 0; |
| 28 | 29 |
| 29 // A callback method which notifies when the parser finishes handling a | 30 // A callback method which notifies when the parser finishes handling a |
| 30 // header block (i.e. the containing frame has the END_STREAM flag set). | 31 // header block (i.e. the containing frame has the END_STREAM flag set). |
| 31 // Also indicates the total number of bytes in this block. | 32 // Also indicates the total number of bytes in this block. |
| 32 virtual void OnHeaderBlockEnd(size_t uncompressed_header_bytes) = 0; | 33 virtual void OnHeaderBlockEnd(size_t uncompressed_header_bytes) = 0; |
| 33 }; | 34 }; |
| 34 | 35 |
| 35 } // namespace net | 36 } // namespace net |
| 36 | 37 |
| 37 #endif // NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_ | 38 #endif // NET_SPDY_SPDY_HEADERS_HANDLER_INTERFACE_H_ |
| OLD | NEW |