diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-04 07:22:49 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-04 07:22:49 +0000 |
commit | e8a57dc2c31bdb2b7ad2cbb3ace0d412455c0ad2 (patch) | |
tree | 28dc6233dc0240ed55ea5aeb4d7b32be819b10e2 /net/spdy/spdy_test_util.cc | |
parent | b6b2b89a89a78a563232ae7a4fdc42b7d1663a07 (diff) | |
download | chromium_src-e8a57dc2c31bdb2b7ad2cbb3ace0d412455c0ad2.zip chromium_src-e8a57dc2c31bdb2b7ad2cbb3ace0d412455c0ad2.tar.gz chromium_src-e8a57dc2c31bdb2b7ad2cbb3ace0d412455c0ad2.tar.bz2 |
Make SpdyFrame::size a constant instead of a static method so gcc can optimize the call away.
Manual changes to spdy_protocol.h and spdy_framer.cc, rest of the CL generated by
running:
perl -pi -e "s/SpdyFrame::size\(\)/SpdyFrame::kHeaderSize/" $(git grep -l SpdyFrame::size)
This is the same as the google-internal CL 25917366 and 25938381
BUG=94125
TEST=none
TBR=willchan
Review URL: http://codereview.chromium.org/8790015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112929 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_test_util.cc')
-rw-r--r-- | net/spdy/spdy_test_util.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/spdy/spdy_test_util.cc b/net/spdy/spdy_test_util.cc index ee478451..5a3d90b 100644 --- a/net/spdy/spdy_test_util.cc +++ b/net/spdy/spdy_test_util.cc @@ -39,7 +39,7 @@ MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) { // |num_chunks| is the number of chunks to create. MockWrite* ChopWriteFrame(const spdy::SpdyFrame& frame, int num_chunks) { return ChopWriteFrame(frame.data(), - frame.length() + spdy::SpdyFrame::size(), + frame.length() + spdy::SpdyFrame::kHeaderSize, num_chunks); } @@ -64,7 +64,7 @@ MockRead* ChopReadFrame(const char* data, int length, int num_chunks) { // |num_chunks| is the number of chunks to create. MockRead* ChopReadFrame(const spdy::SpdyFrame& frame, int num_chunks) { return ChopReadFrame(frame.data(), - frame.length() + spdy::SpdyFrame::size(), + frame.length() + spdy::SpdyFrame::kHeaderSize, num_chunks); } @@ -758,7 +758,7 @@ spdy::SpdyFrame* ConstructWrappedSpdyFrame( const scoped_ptr<spdy::SpdyFrame>& frame, int stream_id) { return ConstructSpdyBodyFrame(stream_id, frame->data(), - frame->length() + spdy::SpdyFrame::size(), + frame->length() + spdy::SpdyFrame::kHeaderSize, false); } @@ -841,7 +841,7 @@ int ConstructSpdyReplyString(const char* const extra_headers[], // Create a MockWrite from the given SpdyFrame. MockWrite CreateMockWrite(const spdy::SpdyFrame& req) { return MockWrite( - true, req.data(), req.length() + spdy::SpdyFrame::size()); + true, req.data(), req.length() + spdy::SpdyFrame::kHeaderSize); } // Create a MockWrite from the given SpdyFrame and sequence number. @@ -852,13 +852,13 @@ MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq) { // Create a MockWrite from the given SpdyFrame and sequence number. MockWrite CreateMockWrite(const spdy::SpdyFrame& req, int seq, bool async) { return MockWrite( - async, req.data(), req.length() + spdy::SpdyFrame::size(), seq); + async, req.data(), req.length() + spdy::SpdyFrame::kHeaderSize, seq); } // Create a MockRead from the given SpdyFrame. MockRead CreateMockRead(const spdy::SpdyFrame& resp) { return MockRead( - true, resp.data(), resp.length() + spdy::SpdyFrame::size()); + true, resp.data(), resp.length() + spdy::SpdyFrame::kHeaderSize); } // Create a MockRead from the given SpdyFrame and sequence number. @@ -869,7 +869,7 @@ MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq) { // Create a MockRead from the given SpdyFrame and sequence number. MockRead CreateMockRead(const spdy::SpdyFrame& resp, int seq, bool async) { return MockRead( - async, resp.data(), resp.length() + spdy::SpdyFrame::size(), seq); + async, resp.data(), resp.length() + spdy::SpdyFrame::kHeaderSize, seq); } // Combines the given SpdyFrames into the given char array and returns @@ -878,12 +878,12 @@ int CombineFrames(const spdy::SpdyFrame** frames, int num_frames, char* buff, int buff_len) { int total_len = 0; for (int i = 0; i < num_frames; ++i) { - total_len += frames[i]->length() + spdy::SpdyFrame::size(); + total_len += frames[i]->length() + spdy::SpdyFrame::kHeaderSize; } DCHECK_LE(total_len, buff_len); char* ptr = buff; for (int i = 0; i < num_frames; ++i) { - int len = frames[i]->length() + spdy::SpdyFrame::size(); + int len = frames[i]->length() + spdy::SpdyFrame::kHeaderSize; memcpy(ptr, frames[i]->data(), len); ptr += len; } |