diff options
author | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-07 18:01:00 +0000 |
---|---|---|
committer | rch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-07 18:01:00 +0000 |
commit | 3926b12f8dc685d436685f7128970c019b4ac3e9 (patch) | |
tree | 041f05b3b4ba0f5de6c72a570562aab2fb28a23a | |
parent | 377f193eac275d27a54c0fee005c3fec9b167f03 (diff) | |
download | chromium_src-3926b12f8dc685d436685f7128970c019b4ac3e9.zip chromium_src-3926b12f8dc685d436685f7128970c019b4ac3e9.tar.gz chromium_src-3926b12f8dc685d436685f7128970c019b4ac3e9.tar.bz2 |
Land small change to SPDY code from server
Review URL: http://codereview.chromium.org/10282003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135672 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/spdy/spdy_framer.cc | 7 | ||||
-rw-r--r-- | net/spdy/spdy_framer.h | 10 | ||||
-rw-r--r-- | net/spdy/spdy_protocol.h | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc index ba6a022..3a2ad73 100644 --- a/net/spdy/spdy_framer.cc +++ b/net/spdy/spdy_framer.cc @@ -913,7 +913,7 @@ size_t SpdyFramer::ProcessDataFramePayload(const char* data, size_t len) { bool SpdyFramer::ParseHeaderBlockInBuffer(const char* header_data, size_t header_length, - SpdyHeaderBlock* block) { + SpdyHeaderBlock* block) const { SpdyFrameReader reader(header_data, header_length); // Read number of headers. @@ -1234,9 +1234,10 @@ SpdyCredentialControlFrame* SpdyFramer::CreateCredentialFrame( return reinterpret_cast<SpdyCredentialControlFrame*>(frame.take()); } -SpdyDataFrame* SpdyFramer::CreateDataFrame(SpdyStreamId stream_id, +SpdyDataFrame* SpdyFramer::CreateDataFrame( + SpdyStreamId stream_id, const char* data, - uint32 len, SpdyDataFlags flags) { + uint32 len, SpdyDataFlags flags) const { DCHECK_EQ(0u, stream_id & ~kStreamIdMask); size_t frame_size = SpdyDataFrame::size() + len; SpdyFrameBuilder frame(stream_id, flags, frame_size); diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h index 690e848..63570a6 100644 --- a/net/spdy/spdy_framer.h +++ b/net/spdy/spdy_framer.h @@ -260,10 +260,10 @@ class NET_EXPORT_PRIVATE SpdyFramer { SpdyError error_code() const { return error_code_; } SpdyState state() const { return state_; } - bool MessageFullyRead() { + bool MessageFullyRead() const { return state_ == SPDY_DONE || state_ == SPDY_AUTO_RESET; } - bool HasError() { return state_ == SPDY_ERROR; } + bool HasError() const { return state_ == SPDY_ERROR; } // Given a buffer containing a decompressed header block in SPDY // serialized format, parse out a SpdyHeaderBlock, putting the results @@ -271,7 +271,7 @@ class NET_EXPORT_PRIVATE SpdyFramer { // Returns true if successfully parsed, false otherwise. bool ParseHeaderBlockInBuffer(const char* header_data, size_t header_length, - SpdyHeaderBlock* block); + SpdyHeaderBlock* block) const; // Create a SpdySynStreamControlFrame. // |stream_id| is the id for this stream. @@ -359,7 +359,7 @@ class NET_EXPORT_PRIVATE SpdyFramer { // |flags| is the flags to use with the data. // To mark this frame as the last data frame, enable DATA_FLAG_FIN. SpdyDataFrame* CreateDataFrame(SpdyStreamId stream_id, const char* data, - uint32 len, SpdyDataFlags flags); + uint32 len, SpdyDataFlags flags) const; // NOTES about frame compression. // We want spdy to compress headers across the entire session. As long as @@ -415,7 +415,7 @@ class NET_EXPORT_PRIVATE SpdyFramer { int protocol_version() const { return spdy_version_; } - bool probable_http_response() { return probable_http_response_; } + bool probable_http_response() const { return probable_http_response_; } SpdyPriority GetLowestPriority() const { return spdy_version_ < 3 ? 3 : 7; } SpdyPriority GetHighestPriority() const { return 0; } diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index a74c399..0a0a7ce 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h @@ -936,7 +936,7 @@ class SpdyGoAwayControlFrame : public SpdyControlFrame { } SpdyGoAwayStatus status() const { - if (version() < 2) { + if (version() < 3) { LOG(DFATAL) << "Attempted to access status of SPDY 2 GOAWAY."; return GOAWAY_INVALID; } else { |