Chromium Code Reviews| Index: net/spdy/spdy_framer.cc |
| diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc |
| index b4abb099a6b69de2c323939bdb382d2e66b10b98..d558b45ad28015ceceed27ca4ef2ce8ed46d3f7b 100644 |
| --- a/net/spdy/spdy_framer.cc |
| +++ b/net/spdy/spdy_framer.cc |
| @@ -21,6 +21,7 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/metrics/histogram_macros.h" |
| #include "base/strings/string_util.h" |
| +#include "base/trace_event/memory_usage_estimator.h" |
| #include "net/quic/core/quic_flags.h" |
| #include "net/spdy/hpack/hpack_constants.h" |
| #include "net/spdy/hpack/hpack_decoder.h" |
| @@ -2417,6 +2418,16 @@ void SpdyFramer::SetEncoderHeaderTableDebugVisitor( |
| GetHpackEncoder()->SetHeaderTableDebugVisitor(std::move(visitor)); |
| } |
| +size_t SpdyFramer::EstimateMemoryUsage() const { |
| + size_t memory_estimate = |
| + current_frame_buffer_.len() + settings_scratch_.buffer.len(); |
|
DmitrySkiba
2017/02/02 18:16:27
CharBuffer should implement EMU (where it should r
xunjieli
2017/02/03 22:25:09
Done.
|
| + if (altsvc_scratch_) |
| + memory_estimate += altsvc_scratch_->len(); |
| + memory_estimate += base::trace_event::EstimateMemoryUsage(hpack_encoder_) + |
| + base::trace_event::EstimateMemoryUsage(hpack_decoder_); |
| + return memory_estimate; |
| +} |
| + |
| void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) { |
| GetHpackEncoder()->ApplyHeaderTableSizeSetting(value); |
| } |