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

Unified Diff: net/spdy/spdy_framer.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: address bnc comments Created 3 years, 11 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698