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

Side by Side Diff: net/spdy/spdy_frame_reader.cc

Issue 12262002: Minor cleanup in SpdyFrameBuilder. No functional/compiled change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_frame_reader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <limits> 5 #include <limits>
6 6
7 #include "base/sys_byteorder.h" 7 #include "base/sys_byteorder.h"
8 #include "net/spdy/spdy_frame_reader.h" 8 #include "net/spdy/spdy_frame_reader.h"
9 #include "net/spdy/spdy_protocol.h" 9 #include "net/spdy/spdy_protocol.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 ofs_ += 4; 62 ofs_ += 4;
63 63
64 return true; 64 return true;
65 } 65 }
66 66
67 bool SpdyFrameReader::ReadUInt31(uint32* result) { 67 bool SpdyFrameReader::ReadUInt31(uint32* result) {
68 bool success = ReadUInt32(result); 68 bool success = ReadUInt32(result);
69 69
70 // Zero out highest-order bit. 70 // Zero out highest-order bit.
71 if (success) { 71 if (success) {
72 *result &= kStreamIdMask; 72 *result &= 0x7fffffff;
73 } 73 }
74 74
75 return success; 75 return success;
76 } 76 }
77 77
78 bool SpdyFrameReader::ReadStringPiece16(base::StringPiece* result) { 78 bool SpdyFrameReader::ReadStringPiece16(base::StringPiece* result) {
79 // Read resultant length. 79 // Read resultant length.
80 uint16 result_len; 80 uint16 result_len;
81 if (!ReadUInt16(&result_len)) { 81 if (!ReadUInt16(&result_len)) {
82 // OnFailure() already called. 82 // OnFailure() already called.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return bytes <= (len_ - ofs_); 157 return bytes <= (len_ - ofs_);
158 } 158 }
159 159
160 void SpdyFrameReader::OnFailure() { 160 void SpdyFrameReader::OnFailure() {
161 // Set our iterator to the end of the buffer so that further reads fail 161 // Set our iterator to the end of the buffer so that further reads fail
162 // immediately. 162 // immediately.
163 ofs_ = len_; 163 ofs_ = len_;
164 } 164 }
165 165
166 } // namespace net 166 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_frame_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698