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

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

Issue 1989003002: QUIC - add instrumentation to HPACK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase-update Created 4 years, 7 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
« 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 #include "net/spdy/spdy_framer.h" 5 #include "net/spdy/spdy_framer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <ios> 10 #include <ios>
(...skipping 3105 matching lines...) Expand 10 before | Expand all | Expand 10 after
3116 len -= bytes_to_deliver; 3116 len -= bytes_to_deliver;
3117 if (!read_successfully) { 3117 if (!read_successfully) {
3118 // Assume that the problem was the header block was too large for the 3118 // Assume that the problem was the header block was too large for the
3119 // visitor. 3119 // visitor.
3120 set_error(SPDY_CONTROL_PAYLOAD_TOO_LARGE); 3120 set_error(SPDY_CONTROL_PAYLOAD_TOO_LARGE);
3121 } 3121 }
3122 } 3122 }
3123 return read_successfully; 3123 return read_successfully;
3124 } 3124 }
3125 3125
3126 void SpdyFramer::SetDecoderHeaderTableDebugVisitor(
3127 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) {
3128 GetHpackDecoder()->SetHeaderTableDebugVisitor(std::move(visitor));
3129 }
3130
3131 void SpdyFramer::SetEncoderHeaderTableDebugVisitor(
3132 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) {
3133 GetHpackEncoder()->SetHeaderTableDebugVisitor(std::move(visitor));
3134 }
3135
3126 void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) { 3136 void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) {
3127 GetHpackEncoder()->ApplyHeaderTableSizeSetting(value); 3137 GetHpackEncoder()->ApplyHeaderTableSizeSetting(value);
3128 } 3138 }
3129 3139
3130 size_t SpdyFramer::header_encoder_table_size() const { 3140 size_t SpdyFramer::header_encoder_table_size() const {
3131 if (hpack_encoder_ == nullptr) { 3141 if (hpack_encoder_ == nullptr) {
3132 return kDefaultHeaderTableSizeSetting; 3142 return kDefaultHeaderTableSizeSetting;
3133 } else { 3143 } else {
3134 return hpack_encoder_->CurrentHeaderTableSizeSetting(); 3144 return hpack_encoder_->CurrentHeaderTableSizeSetting();
3135 } 3145 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
3200 #else 3210 #else
3201 WriteHeaderBlockToZ(&frame.header_block(), compressor); 3211 WriteHeaderBlockToZ(&frame.header_block(), compressor);
3202 #endif // defined(USE_SYSTEM_ZLIB) 3212 #endif // defined(USE_SYSTEM_ZLIB)
3203 3213
3204 int compressed_size = compressed_max_size - compressor->avail_out; 3214 int compressed_size = compressed_max_size - compressor->avail_out;
3205 builder->Seek(compressed_size); 3215 builder->Seek(compressed_size);
3206 builder->RewriteLength(*this); 3216 builder->RewriteLength(*this);
3207 } 3217 }
3208 3218
3209 } // namespace net 3219 } // 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