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

Unified Diff: net/spdy/spdy_protocol.h

Issue 8790015: Make SpdyFrame::size a constant instead of a static method so gcc can optimize the call away. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: fff Created 9 years 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 | « net/spdy/spdy_framer_test.cc ('k') | net/spdy/spdy_protocol_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.h
diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h
index eed9798b0021a898ad269eaf2dd209b51df9a549..2519814f182d1888f073add57dbe13bc5674c253 100644
--- a/net/spdy/spdy_protocol.h
+++ b/net/spdy/spdy_protocol.h
@@ -383,11 +383,11 @@ class SpdyFrame {
kControlFlagMask;
}
- // Returns the size of the SpdyFrameBlock structure.
+ // The size of the SpdyFrameBlock structure.
// Every SpdyFrame* class has a static size() method for accessing
// the size of the data structure which will be sent over the wire.
// Note: this is not the same as sizeof(SpdyFrame).
- static size_t size() { return sizeof(struct SpdyFrameBlock); }
+ enum { kHeaderSize = sizeof(struct SpdyFrameBlock) };
protected:
SpdyFrameBlock* frame_;
@@ -418,7 +418,7 @@ class SpdyDataFrame : public SpdyFrame {
// Returns the size of the SpdyFrameBlock structure.
// Note: this is not the size of the SpdyDataFrame class.
- static size_t size() { return SpdyFrame::size(); }
+ static size_t size() { return SpdyFrame::kHeaderSize; }
const char* payload() const {
return reinterpret_cast<const char*>(frame_) + size();
@@ -522,7 +522,7 @@ class SpdySynStreamControlFrame : public SpdyControlFrame {
// The number of bytes in the header block beyond the frame header length.
int header_block_len() const {
- return length() - (size() - SpdyFrame::size());
+ return length() - (size() - SpdyFrame::kHeaderSize);
}
const char* header_block() const {
@@ -559,7 +559,7 @@ class SpdySynReplyControlFrame : public SpdyControlFrame {
}
int header_block_len() const {
- return length() - (size() - SpdyFrame::size());
+ return length() - (size() - SpdyFrame::kHeaderSize);
}
const char* header_block() const {
@@ -636,7 +636,7 @@ class SpdySettingsControlFrame : public SpdyControlFrame {
}
int header_block_len() const {
- return length() - (size() - SpdyFrame::size());
+ return length() - (size() - SpdyFrame::kHeaderSize);
}
const char* header_block() const {
@@ -734,7 +734,7 @@ class SpdyHeadersControlFrame : public SpdyControlFrame {
// The number of bytes in the header block beyond the frame header length.
int header_block_len() const {
- return length() - (size() - SpdyFrame::size());
+ return length() - (size() - SpdyFrame::kHeaderSize);
}
const char* header_block() const {
« no previous file with comments | « net/spdy/spdy_framer_test.cc ('k') | net/spdy/spdy_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698