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

Unified Diff: net/spdy/http2_frame_decoder_adapter.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: Address Bence comments 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
Index: net/spdy/http2_frame_decoder_adapter.cc
diff --git a/net/spdy/http2_frame_decoder_adapter.cc b/net/spdy/http2_frame_decoder_adapter.cc
index 8c34b694485c8f823106fe719e560111ee0be494..d76e02d9d8385d709c26091d2824bc5cd63ac176 100644
--- a/net/spdy/http2_frame_decoder_adapter.cc
+++ b/net/spdy/http2_frame_decoder_adapter.cc
@@ -20,6 +20,7 @@
#include "base/optional.h"
#include "base/strings/string_piece.h"
#include "base/sys_byteorder.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "net/http2/decoder/decode_buffer.h"
#include "net/http2/decoder/decode_status.h"
#include "net/http2/decoder/http2_frame_decoder.h"
@@ -143,6 +144,12 @@ class Http2DecoderAdapter : public SpdyFramerDecoderAdapter,
return latched_probable_http_response_;
}
+ size_t EstimateMemoryUsage() const override {
+ // Skip |frame_decoder_|, |frame_header_| and |hpack_first_frame_header_| as
+ // they don't allocate.
+ return base::trace_event::EstimateMemoryUsage(alt_svc_origin_) +
+ base::trace_event::EstimateMemoryUsage(alt_svc_value_);
+ }
// ===========================================================================
// Implementations of the methods declared by Http2FrameDecoderListener.

Powered by Google App Engine
This is Rietveld 408576698