| 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();
|
|
|