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

Side by Side Diff: net/http2/hpack/decoder/hpack_whole_entry_buffer.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: address bnc comments Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/http2/hpack/decoder/hpack_whole_entry_buffer.h" 5 #include "net/http2/hpack/decoder/hpack_whole_entry_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 using base::StringPiece; 9 using base::StringPiece;
10 10
(...skipping 14 matching lines...) Expand all
25 void HpackWholeEntryBuffer::set_max_string_size_bytes( 25 void HpackWholeEntryBuffer::set_max_string_size_bytes(
26 size_t max_string_size_bytes) { 26 size_t max_string_size_bytes) {
27 max_string_size_bytes_ = max_string_size_bytes; 27 max_string_size_bytes_ = max_string_size_bytes;
28 } 28 }
29 29
30 void HpackWholeEntryBuffer::BufferStringsIfUnbuffered() { 30 void HpackWholeEntryBuffer::BufferStringsIfUnbuffered() {
31 name_.BufferStringIfUnbuffered(); 31 name_.BufferStringIfUnbuffered();
32 value_.BufferStringIfUnbuffered(); 32 value_.BufferStringIfUnbuffered();
33 } 33 }
34 34
35 size_t HpackWholeEntryBuffer::EstimateMemoryUsage() const {
36 return name_.BufferedLength() + value_.BufferedLength();
DmitrySkiba 2017/02/02 18:16:27 Hmm, can we add EMU to HpackDecoderStringBuffer? B
xunjieli 2017/02/03 22:25:09 Done.
37 }
38
35 void HpackWholeEntryBuffer::OnIndexedHeader(size_t index) { 39 void HpackWholeEntryBuffer::OnIndexedHeader(size_t index) {
36 DVLOG(2) << "HpackWholeEntryBuffer::OnIndexedHeader: index=" << index; 40 DVLOG(2) << "HpackWholeEntryBuffer::OnIndexedHeader: index=" << index;
37 listener_->OnIndexedHeader(index); 41 listener_->OnIndexedHeader(index);
38 } 42 }
39 43
40 void HpackWholeEntryBuffer::OnStartLiteralHeader(HpackEntryType entry_type, 44 void HpackWholeEntryBuffer::OnStartLiteralHeader(HpackEntryType entry_type,
41 size_t maybe_name_index) { 45 size_t maybe_name_index) {
42 DVLOG(2) << "HpackWholeEntryBuffer::OnStartLiteralHeader: entry_type=" 46 DVLOG(2) << "HpackWholeEntryBuffer::OnStartLiteralHeader: entry_type="
43 << entry_type << ", maybe_name_index=" << maybe_name_index; 47 << entry_type << ", maybe_name_index=" << maybe_name_index;
44 entry_type_ = entry_type; 48 entry_type_ = entry_type;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 void HpackWholeEntryBuffer::ReportError(StringPiece error_message) { 130 void HpackWholeEntryBuffer::ReportError(StringPiece error_message) {
127 if (!error_detected_) { 131 if (!error_detected_) {
128 DVLOG(1) << "HpackWholeEntryBuffer::ReportError: " << error_message; 132 DVLOG(1) << "HpackWholeEntryBuffer::ReportError: " << error_message;
129 error_detected_ = true; 133 error_detected_ = true;
130 listener_->OnHpackDecodeError(error_message); 134 listener_->OnHpackDecodeError(error_message);
131 listener_ = HpackWholeEntryNoOpListener::NoOpListener(); 135 listener_ = HpackWholeEntryNoOpListener::NoOpListener();
132 } 136 }
133 } 137 }
134 138
135 } // namespace net 139 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698