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

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

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: rebased 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
« no previous file with comments | « net/http2/hpack/decoder/http2_hpack_decoder.h ('k') | net/proxy/proxy_server.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/http2_hpack_decoder.h" 5 #include "net/http2/hpack/decoder/http2_hpack_decoder.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/trace_event/memory_usage_estimator.h"
8 #include "net/http2/decoder/decode_status.h" 9 #include "net/http2/decoder/decode_status.h"
9 10
10 using base::StringPiece; 11 using base::StringPiece;
11 12
12 namespace net { 13 namespace net {
13 14
14 Http2HpackDecoder::Http2HpackDecoder(HpackDecoderListener* listener, 15 Http2HpackDecoder::Http2HpackDecoder(HpackDecoderListener* listener,
15 size_t max_string_size) 16 size_t max_string_size)
16 : decoder_state_(listener), 17 : decoder_state_(listener),
17 entry_buffer_(&decoder_state_, max_string_size), 18 entry_buffer_(&decoder_state_, max_string_size),
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 DVLOG(2) << "Http2HpackDecoder::error_detected in entry_buffer_"; 110 DVLOG(2) << "Http2HpackDecoder::error_detected in entry_buffer_";
110 error_detected_ = true; 111 error_detected_ = true;
111 } else if (decoder_state_.error_detected()) { 112 } else if (decoder_state_.error_detected()) {
112 DVLOG(2) << "Http2HpackDecoder::error_detected in decoder_state_"; 113 DVLOG(2) << "Http2HpackDecoder::error_detected in decoder_state_";
113 error_detected_ = true; 114 error_detected_ = true;
114 } 115 }
115 } 116 }
116 return error_detected_; 117 return error_detected_;
117 } 118 }
118 119
120 size_t Http2HpackDecoder::EstimateMemoryUsage() const {
121 return base::trace_event::EstimateMemoryUsage(entry_buffer_);
122 }
123
119 void Http2HpackDecoder::ReportError(StringPiece error_message) { 124 void Http2HpackDecoder::ReportError(StringPiece error_message) {
120 DVLOG(3) << "Http2HpackDecoder::ReportError is new=" 125 DVLOG(3) << "Http2HpackDecoder::ReportError is new="
121 << (!error_detected_ ? "true" : "false") 126 << (!error_detected_ ? "true" : "false")
122 << ", error_message: " << error_message; 127 << ", error_message: " << error_message;
123 if (!error_detected_) { 128 if (!error_detected_) {
124 error_detected_ = true; 129 error_detected_ = true;
125 listener()->OnHeaderErrorDetected(error_message); 130 listener()->OnHeaderErrorDetected(error_message);
126 } 131 }
127 } 132 }
128 133
129 } // namespace net 134 } // namespace net
OLDNEW
« no previous file with comments | « net/http2/hpack/decoder/http2_hpack_decoder.h ('k') | net/proxy/proxy_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698