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

Side by Side Diff: net/spdy/hpack/hpack_static_table.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/spdy/hpack/hpack_static_table.h ('k') | net/spdy/http2_frame_decoder_adapter.cc » ('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 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_static_table.h" 5 #include "net/spdy/hpack/hpack_static_table.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/spdy/hpack/hpack_constants.h" 8 #include "net/spdy/hpack/hpack_constants.h"
9 #include "net/spdy/hpack/hpack_entry.h" 9 #include "net/spdy/hpack/hpack_entry.h"
10 #include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
10 11
11 namespace net { 12 namespace net {
12 13
13 HpackStaticTable::HpackStaticTable() {} 14 HpackStaticTable::HpackStaticTable() {}
14 15
15 HpackStaticTable::~HpackStaticTable() {} 16 HpackStaticTable::~HpackStaticTable() {}
16 17
17 void HpackStaticTable::Initialize(const HpackStaticEntry* static_entry_table, 18 void HpackStaticTable::Initialize(const HpackStaticEntry* static_entry_table,
18 size_t static_entry_count) { 19 size_t static_entry_count) {
19 CHECK(!IsInitialized()); 20 CHECK(!IsInitialized());
(...skipping 12 matching lines...) Expand all
32 static_name_index_.insert(make_pair(entry->name(), entry)); 33 static_name_index_.insert(make_pair(entry->name(), entry));
33 34
34 ++total_insertions; 35 ++total_insertions;
35 } 36 }
36 } 37 }
37 38
38 bool HpackStaticTable::IsInitialized() const { 39 bool HpackStaticTable::IsInitialized() const {
39 return !static_entries_.empty(); 40 return !static_entries_.empty();
40 } 41 }
41 42
43 size_t HpackStaticTable::EstimateMemoryUsage() const {
44 return SpdyEstimateMemoryUsage(static_entries_) +
45 SpdyEstimateMemoryUsage(static_index_) +
46 SpdyEstimateMemoryUsage(static_name_index_);
47 }
48
42 } // namespace net 49 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack/hpack_static_table.h ('k') | net/spdy/http2_frame_decoder_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698