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

Unified Diff: net/spdy/spdy_header_block.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_header_block.h ('k') | net/spdy/spdy_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_header_block.cc
diff --git a/net/spdy/spdy_header_block.cc b/net/spdy/spdy_header_block.cc
index 6cbd6ba645c4585a3126099322effb3f9525c968..a51532cf015c5777e21661879dcd86fbfd3e7856 100644
--- a/net/spdy/spdy_header_block.cc
+++ b/net/spdy/spdy_header_block.cc
@@ -15,6 +15,7 @@
#include "net/base/arena.h"
#include "net/http/http_log_util.h"
#include "net/log/net_log_capture_mode.h"
+#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
using base::StringPiece;
using std::dec;
@@ -89,6 +90,11 @@ class SpdyHeaderBlock::Storage {
size_t bytes_allocated() const { return arena_.status().bytes_allocated(); }
+ // TODO(xunjieli): https://crbug.com/669108. Merge this with bytes_allocated()
+ size_t EstimateMemoryUsage() const {
+ return arena_.status().bytes_allocated();
+ }
+
private:
UnsafeArena arena_;
};
@@ -299,6 +305,12 @@ void SpdyHeaderBlock::AppendValueOrAddHeader(const StringPiece key,
iter->second.Append(GetStorage()->Write(value));
}
+size_t SpdyHeaderBlock::EstimateMemoryUsage() const {
+ // TODO(xunjieli): https://crbug.com/669108. Also include |block_| when EMU()
+ // supports linked_hash_map.
+ return SpdyEstimateMemoryUsage(storage_);
+}
+
void SpdyHeaderBlock::AppendHeader(const StringPiece key,
const StringPiece value) {
auto storage = GetStorage();
« no previous file with comments | « net/spdy/spdy_header_block.h ('k') | net/spdy/spdy_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698