diff options
author | mbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 18:35:40 +0000 |
---|---|---|
committer | mbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 18:35:40 +0000 |
commit | 592ca909efa35c0000b349285b059700ae543ee4 (patch) | |
tree | 76e6308199862df45804c70e99b23edafcdc85d1 /net/spdy/spdy_framer.h | |
parent | 75a2c3b76edcaba820e96e5e202a7cf5c2f5f088 (diff) | |
download | chromium_src-592ca909efa35c0000b349285b059700ae543ee4.zip chromium_src-592ca909efa35c0000b349285b059700ae543ee4.tar.gz chromium_src-592ca909efa35c0000b349285b059700ae543ee4.tar.bz2 |
Merge deltas from server team common SPDY files.
Fixes one memory leak and one mismatched scoped_ptr/array usage.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/591003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38478 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_framer.h')
-rw-r--r-- | net/spdy/spdy_framer.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index c431f67..8b129ea 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h @@ -59,7 +59,7 @@ class SpdyFramerVisitorInterface { // |len| The length of the data buffer. // When the other side has finished sending data on this stream, // this method will be called with a zero-length buffer. - virtual void OnStreamFrameData(spdy::SpdyStreamId stream_id, + virtual void OnStreamFrameData(SpdyStreamId stream_id, const char* data, size_t len) = 0; }; @@ -84,12 +84,14 @@ class SpdyFramer { // SPDY error codes. enum SpdyError { SPDY_NO_ERROR, - SPDY_UNKNOWN_CONTROL_TYPE, // Control frame is an unknown type. SPDY_INVALID_CONTROL_FRAME, // Control frame is mal-formatted. SPDY_CONTROL_PAYLOAD_TOO_LARGE, // Control frame payload was too large. SPDY_ZLIB_INIT_FAILURE, // The Zlib library could not initialize. SPDY_UNSUPPORTED_VERSION, // Control frame has unsupported version. SPDY_DECOMPRESS_FAILURE, // There was an error decompressing. + SPDY_COMPRESS_FAILURE, // There was an error compressing. + + LAST_ERROR, // Must be the last entry in the enum. }; // Create a new Framer. @@ -181,24 +183,29 @@ class SpdyFramer { // Compresses a SpdyFrame. // On success, returns a new SpdyFrame with the payload compressed. // Compression state is maintained as part of the SpdyFramer. - // Returned frame must be freed with free(). + // Returned frame must be freed with "delete". // On failure, returns NULL. SpdyFrame* CompressFrame(const SpdyFrame* frame); // Decompresses a SpdyFrame. // On success, returns a new SpdyFrame with the payload decompressed. // Compression state is maintained as part of the SpdyFramer. - // Returned frame must be freed with free(). + // Returned frame must be freed with "delete". // On failure, returns NULL. SpdyFrame* DecompressFrame(const SpdyFrame* frame); // Create a copy of a frame. + // Returned frame must be freed with "delete". SpdyFrame* DuplicateFrame(const SpdyFrame* frame); // For debugging. static const char* StateToString(int state); static const char* ErrorCodeToString(int error_code); + // Export the compression dictionary + static const char kDictionary[]; + static const int kDictionarySize; + protected: FRIEND_TEST(SpdyFramerTest, HeaderBlockBarfsOnOutOfOrderHeaders); friend class net::SpdyNetworkTransactionTest; |