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

Unified Diff: net/spdy/hpack/hpack_static_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 side-by-side diff with in-line comments
Download patch
Index: net/spdy/hpack/hpack_static_table.cc
diff --git a/net/spdy/hpack/hpack_static_table.cc b/net/spdy/hpack/hpack_static_table.cc
index 5588ebe183800bbcda42786ea20be6bd9ca1552c..2e572cfa29caf78bb9f93a3d5c0a04b6e11283ba 100644
--- a/net/spdy/hpack/hpack_static_table.cc
+++ b/net/spdy/hpack/hpack_static_table.cc
@@ -5,6 +5,7 @@
#include "net/spdy/hpack/hpack_static_table.h"
#include "base/logging.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "net/spdy/hpack/hpack_constants.h"
#include "net/spdy/hpack/hpack_entry.h"
@@ -39,4 +40,10 @@ bool HpackStaticTable::IsInitialized() const {
return !static_entries_.empty();
}
+size_t HpackStaticTable::EstimateMemoryUsage() const {
+ return base::trace_event::EstimateMemoryUsage(static_entries_) +
+ base::trace_event::EstimateMemoryUsage(static_index_) +
+ base::trace_event::EstimateMemoryUsage(static_name_index_);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698