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

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

Issue 12224019: Add SpdyFramerDebugVisitorInterface for later usage in stats collecting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile failure 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_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 : state_(SPDY_RESET), 116 : state_(SPDY_RESET),
117 previous_state_(SPDY_RESET), 117 previous_state_(SPDY_RESET),
118 error_code_(SPDY_NO_ERROR), 118 error_code_(SPDY_NO_ERROR),
119 remaining_data_(0), 119 remaining_data_(0),
120 remaining_control_payload_(0), 120 remaining_control_payload_(0),
121 remaining_control_header_(0), 121 remaining_control_header_(0),
122 current_frame_buffer_(new char[kControlFrameBufferSize]), 122 current_frame_buffer_(new char[kControlFrameBufferSize]),
123 current_frame_len_(0), 123 current_frame_len_(0),
124 enable_compression_(true), 124 enable_compression_(true),
125 visitor_(NULL), 125 visitor_(NULL),
126 debug_visitor_(NULL),
126 display_protocol_("SPDY"), 127 display_protocol_("SPDY"),
127 spdy_version_(version), 128 spdy_version_(version),
128 syn_frame_processed_(false), 129 syn_frame_processed_(false),
129 probable_http_response_(false) { 130 probable_http_response_(false) {
130 DCHECK_GE(kMaxSpdyVersion, version); 131 DCHECK_GE(kMaxSpdyVersion, version);
131 DCHECK_LE(kMinSpdyVersion, version); 132 DCHECK_LE(kMinSpdyVersion, version);
132 } 133 }
133 134
134 SpdyFramer::~SpdyFramer() { 135 SpdyFramer::~SpdyFramer() {
135 if (header_compressor_.get()) { 136 if (header_compressor_.get()) {
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 header_length + compressed_size - SpdyFrame::kHeaderSize); 1670 header_length + compressed_size - SpdyFrame::kHeaderSize);
1670 1671
1671 pre_compress_bytes.Add(payload_length); 1672 pre_compress_bytes.Add(payload_length);
1672 post_compress_bytes.Add(new_frame->length()); 1673 post_compress_bytes.Add(new_frame->length());
1673 1674
1674 compressed_frames.Increment(); 1675 compressed_frames.Increment();
1675 1676
1676 if (visitor_) 1677 if (visitor_)
1677 visitor_->OnControlFrameCompressed(frame, *new_frame); 1678 visitor_->OnControlFrameCompressed(frame, *new_frame);
1678 1679
1680 if (debug_visitor_ != NULL) {
1681 debug_visitor_->OnCompressedHeaderBlock(payload_length, compressed_size);
1682 }
1683
1679 return new_frame.release(); 1684 return new_frame.release();
1680 } 1685 }
1681 1686
1682 // Incrementally decompress the control frame's header block, feeding the 1687 // Incrementally decompress the control frame's header block, feeding the
1683 // result to the visitor in chunks. Continue this until the visitor 1688 // result to the visitor in chunks. Continue this until the visitor
1684 // indicates that it cannot process any more data, or (more commonly) we 1689 // indicates that it cannot process any more data, or (more commonly) we
1685 // run out of data to deliver. 1690 // run out of data to deliver.
1686 bool SpdyFramer::IncrementallyDecompressControlFrameHeaderData( 1691 bool SpdyFramer::IncrementallyDecompressControlFrameHeaderData(
1687 const SpdyControlFrame* control_frame, 1692 const SpdyControlFrame* control_frame,
1688 const char* data, 1693 const char* data,
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 } 1877 }
1873 } 1878 }
1874 return stream_id; 1879 return stream_id;
1875 } 1880 }
1876 1881
1877 void SpdyFramer::set_enable_compression(bool value) { 1882 void SpdyFramer::set_enable_compression(bool value) {
1878 enable_compression_ = value; 1883 enable_compression_ = value;
1879 } 1884 }
1880 1885
1881 } // namespace net 1886 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698