Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2096)

Unified Diff: net/spdy/spdy_headers_block_parser.h

Issue 138273017: Added new callbacks to SpdyHeadersHandlerInterface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto upstream change. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/spdy/spdy_headers_block_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_headers_block_parser.h
diff --git a/net/spdy/spdy_headers_block_parser.h b/net/spdy/spdy_headers_block_parser.h
index e22ec1864868817e7996e47ca4587ca7b734cc3e..a5b8502c3a489f6af192859120f74a3f195bec37 100644
--- a/net/spdy/spdy_headers_block_parser.h
+++ b/net/spdy/spdy_headers_block_parser.h
@@ -15,12 +15,21 @@
namespace net {
-// A handler class for SPDY headers block key/value pairs.
-// TODO(ygi) Modify this stub handler to pass the key-value pair
-// through the spdy logic.
-class KeyValueHandler {
+// A handler class for SPDY headers.
+class SpdyHeadersHandlerInterface {
public:
- virtual ~KeyValueHandler() {}
+ virtual ~SpdyHeadersHandlerInterface() {}
+
+ // A callback method which notifies when the parser starts handling a new
+ // SPDY headers block, this method also notifies on the number of headers in
+ // the block.
+ virtual void OnHeaderBlock(uint32_t num_of_headers) = 0;
+
+ // A callback method which notifies when the parser finishes handling a SPDY
+ // headers block.
+ virtual void OnHeaderBlockEnd() = 0;
+
+ // A callback method which notifies on a SPDY header key value pair.
virtual void OnKeyValuePair(const base::StringPiece& key,
const base::StringPiece& value) = 0;
};
@@ -57,7 +66,7 @@ class NET_EXPORT_PRIVATE SpdyHeadersBlockParser {
public:
// Costructor. The handler's OnKeyValuePair will be called for every key
// value pair that we parsed from the headers block.
- explicit SpdyHeadersBlockParser(KeyValueHandler* handler);
+ explicit SpdyHeadersBlockParser(SpdyHeadersHandlerInterface* handler);
virtual ~SpdyHeadersBlockParser();
@@ -102,7 +111,7 @@ class NET_EXPORT_PRIVATE SpdyHeadersBlockParser {
std::vector<char> headers_block_prefix_;
// Handles key-value pairs as we parse them.
- KeyValueHandler* handler_;
+ SpdyHeadersHandlerInterface* handler_;
// Points to the current key.
scoped_ptr<char[]> current_key;
« no previous file with comments | « no previous file | net/spdy/spdy_headers_block_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698