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

Side by Side Diff: net/spdy/hpack/hpack_decoder3.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
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/spdy/hpack/hpack_decoder3.h" 5 #include "net/spdy/hpack/hpack_decoder3.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/http2/decoder/decode_buffer.h" 8 #include "net/http2/decoder/decode_buffer.h"
9 #include "net/http2/decoder/decode_status.h" 9 #include "net/http2/decoder/decode_status.h"
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 100 }
101 } 101 }
102 102
103 void HpackDecoder3::set_max_decode_buffer_size_bytes( 103 void HpackDecoder3::set_max_decode_buffer_size_bytes(
104 size_t max_decode_buffer_size_bytes) { 104 size_t max_decode_buffer_size_bytes) {
105 DVLOG(2) << "HpackDecoder3::set_max_decode_buffer_size_bytes"; 105 DVLOG(2) << "HpackDecoder3::set_max_decode_buffer_size_bytes";
106 max_decode_buffer_size_bytes_ = max_decode_buffer_size_bytes; 106 max_decode_buffer_size_bytes_ = max_decode_buffer_size_bytes;
107 hpack_decoder_.set_max_string_size_bytes(max_decode_buffer_size_bytes); 107 hpack_decoder_.set_max_string_size_bytes(max_decode_buffer_size_bytes);
108 } 108 }
109 109
110 size_t HpackDecoder3::EstimateMemoryUsage() const {
111 return hpack_decoder_.EstimateMemoryUsage();
Bence 2017/02/05 19:11:23 EstimateMemoryUsage(hpack_decoder_)
xunjieli 2017/02/06 14:54:56 Done.
112 }
113
110 HpackDecoder3::ListenerAdapter::ListenerAdapter() : handler_(nullptr) {} 114 HpackDecoder3::ListenerAdapter::ListenerAdapter() : handler_(nullptr) {}
111 HpackDecoder3::ListenerAdapter::~ListenerAdapter() {} 115 HpackDecoder3::ListenerAdapter::~ListenerAdapter() {}
112 116
113 void HpackDecoder3::ListenerAdapter::set_handler( 117 void HpackDecoder3::ListenerAdapter::set_handler(
114 SpdyHeadersHandlerInterface* handler) { 118 SpdyHeadersHandlerInterface* handler) {
115 handler_ = handler; 119 handler_ = handler;
116 } 120 }
117 121
118 void HpackDecoder3::ListenerAdapter::SetHeaderTableDebugVisitor( 122 void HpackDecoder3::ListenerAdapter::SetHeaderTableDebugVisitor(
119 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) { 123 std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 << ", insert_count=" << insert_count 185 << ", insert_count=" << insert_count
182 << ", time_added=" << time_added; 186 << ", time_added=" << time_added;
183 if (visitor_ != nullptr) { 187 if (visitor_ != nullptr) {
184 HpackEntry entry(sp.name, sp.value, /*is_static*/ false, insert_count); 188 HpackEntry entry(sp.name, sp.value, /*is_static*/ false, insert_count);
185 entry.set_time_added(time_added); 189 entry.set_time_added(time_added);
186 visitor_->OnUseEntry(entry); 190 visitor_->OnUseEntry(entry);
187 } 191 }
188 } 192 }
189 193
190 } // namespace net 194 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698