| 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..eb798a0f3fddb274df11bca9b91e3e1b4312d535 100644
|
| --- a/net/spdy/spdy_header_block.cc
|
| +++ b/net/spdy/spdy_header_block.cc
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| +#include "base/trace_event/memory_usage_estimator.h"
|
| #include "base/values.h"
|
| #include "net/base/arena.h"
|
| #include "net/http/http_log_util.h"
|
| @@ -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 base::trace_event::EstimateMemoryUsage(storage_);
|
| +}
|
| +
|
| void SpdyHeaderBlock::AppendHeader(const StringPiece key,
|
| const StringPiece value) {
|
| auto storage = GetStorage();
|
|
|