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

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

Issue 13598037: Add helper function for SPDY 4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_framer.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 // TODO(rtenhove) clean up frame buffer size calculations so that we aren't 5 // TODO(rtenhove) clean up frame buffer size calculations so that we aren't
6 // constantly adding and subtracting header sizes; this is ugly and error- 6 // constantly adding and subtracting header sizes; this is ugly and error-
7 // prone. 7 // prone.
8 8
9 #include "net/spdy/spdy_framer.h" 9 #include "net/spdy/spdy_framer.h"
10 10
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 return GetControlFrameHeaderSize() + 8; 246 return GetControlFrameHeaderSize() + 8;
247 } 247 }
248 248
249 size_t SpdyFramer::GetCredentialMinimumSize() const { 249 size_t SpdyFramer::GetCredentialMinimumSize() const {
250 // Size, in bytes, of a CREDENTIAL frame sans variable-length certificate list 250 // Size, in bytes, of a CREDENTIAL frame sans variable-length certificate list
251 // and proof. Calculated as: 251 // and proof. Calculated as:
252 // control frame header + 2 (slot) 252 // control frame header + 2 (slot)
253 return GetControlFrameHeaderSize() + 2; 253 return GetControlFrameHeaderSize() + 2;
254 } 254 }
255 255
256 size_t SpdyFramer::GetDataFrameMaximumPayload() const {
257 if (protocol_version() < 4) {
258 return 0xffffff - GetDataFrameMinimumSize();
Ryan Hamilton 2013/04/08 16:11:45 I really think these values should be constants wh
259 }
260 return 0xffff - GetDataFrameMinimumSize();
261 }
262
256 const char* SpdyFramer::StateToString(int state) { 263 const char* SpdyFramer::StateToString(int state) {
257 switch (state) { 264 switch (state) {
258 case SPDY_ERROR: 265 case SPDY_ERROR:
259 return "ERROR"; 266 return "ERROR";
260 case SPDY_AUTO_RESET: 267 case SPDY_AUTO_RESET:
261 return "AUTO_RESET"; 268 return "AUTO_RESET";
262 case SPDY_RESET: 269 case SPDY_RESET:
263 return "RESET"; 270 return "RESET";
264 case SPDY_READING_COMMON_HEADER: 271 case SPDY_READING_COMMON_HEADER:
265 return "READING_COMMON_HEADER"; 272 return "READING_COMMON_HEADER";
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2047 post_compress_bytes.Add(compressed_size); 2054 post_compress_bytes.Add(compressed_size);
2048 2055
2049 compressed_frames.Increment(); 2056 compressed_frames.Increment();
2050 2057
2051 if (debug_visitor_ != NULL) { 2058 if (debug_visitor_ != NULL) {
2052 debug_visitor_->OnCompressedHeaderBlock(uncompressed_len, compressed_size); 2059 debug_visitor_->OnCompressedHeaderBlock(uncompressed_len, compressed_size);
2053 } 2060 }
2054 } 2061 }
2055 2062
2056 } // namespace net 2063 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698