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

Side by Side Diff: net/spdy/hpack/hpack_header_table.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: Address Bence 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_header_table.h" 5 #include "net/spdy/hpack/hpack_header_table.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/trace_event/memory_usage_estimator.h"
10 #include "net/spdy/hpack/hpack_constants.h" 11 #include "net/spdy/hpack/hpack_constants.h"
11 #include "net/spdy/hpack/hpack_static_table.h" 12 #include "net/spdy/hpack/hpack_static_table.h"
12 #include "net/spdy/spdy_flags.h" 13 #include "net/spdy/spdy_flags.h"
13 14
14 namespace net { 15 namespace net {
15 16
16 using base::StringPiece; 17 using base::StringPiece;
17 18
18 size_t HpackHeaderTable::EntryHasher::operator()( 19 size_t HpackHeaderTable::EntryHasher::operator()(
19 const HpackEntry* entry) const { 20 const HpackEntry* entry) const {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 DVLOG(2) << "Full Dynamic Index:"; 268 DVLOG(2) << "Full Dynamic Index:";
268 for (auto* entry : dynamic_index_) { 269 for (auto* entry : dynamic_index_) {
269 DVLOG(2) << " " << entry->GetDebugString(); 270 DVLOG(2) << " " << entry->GetDebugString();
270 } 271 }
271 DVLOG(2) << "Full Dynamic Name Index:"; 272 DVLOG(2) << "Full Dynamic Name Index:";
272 for (const auto it : dynamic_name_index_) { 273 for (const auto it : dynamic_name_index_) {
273 DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString(); 274 DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString();
274 } 275 }
275 } 276 }
276 277
278 size_t HpackHeaderTable::EstimateMemoryUsage() const {
279 return base::trace_event::EstimateMemoryUsage(dynamic_entries_) +
280 base::trace_event::EstimateMemoryUsage(dynamic_index_) +
281 base::trace_event::EstimateMemoryUsage(dynamic_name_index_);
282 }
283
277 } // namespace net 284 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698