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

Unified Diff: net/spdy/spdy_framer.cc

Issue 2665283003: Improve memory estimate of SpdySessionPool in net/ MemoryDumpProvider. (Closed)
Patch Set: rebased 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
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_decoder_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 85135d564fd1e3d204b63d90d6c11787562955c7..90200d8f2ee3bfbb4dcc1dc17eb2c4e31a5ce3d6 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -28,6 +28,7 @@
#include "net/spdy/hpack/hpack_decoder2.h"
#include "net/spdy/hpack/hpack_decoder3.h"
#include "net/spdy/http2_frame_decoder_adapter.h"
+#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/spdy/spdy_bitmasks.h"
#include "net/spdy/spdy_bug_tracker.h"
#include "net/spdy/spdy_flags.h"
@@ -563,6 +564,10 @@ void SpdyFramer::CharBuffer::Rewind() {
len_ = 0;
}
+size_t SpdyFramer::CharBuffer::EstimateMemoryUsage() const {
+ return capacity_;
+}
+
SpdyFramer::SpdySettingsScratch::SpdySettingsScratch()
: buffer(8), last_setting_id(-1) {}
@@ -571,6 +576,10 @@ void SpdyFramer::SpdySettingsScratch::Reset() {
last_setting_id = -1;
}
+size_t SpdyFramer::SpdySettingsScratch::EstimateMemoryUsage() const {
+ return SpdyEstimateMemoryUsage(buffer);
+}
+
SpdyFrameType SpdyFramer::ValidateFrameHeader(bool is_control_frame,
uint8_t frame_type_field,
size_t payload_length_field) {
@@ -2352,6 +2361,15 @@ void SpdyFramer::SetEncoderHeaderTableDebugVisitor(
GetHpackEncoder()->SetHeaderTableDebugVisitor(std::move(visitor));
}
+size_t SpdyFramer::EstimateMemoryUsage() const {
+ return SpdyEstimateMemoryUsage(current_frame_buffer_) +
+ SpdyEstimateMemoryUsage(settings_scratch_) +
+ SpdyEstimateMemoryUsage(altsvc_scratch_) +
+ SpdyEstimateMemoryUsage(hpack_encoder_) +
+ SpdyEstimateMemoryUsage(hpack_decoder_) +
+ SpdyEstimateMemoryUsage(decoder_adapter_);
+}
+
void SpdyFramer::UpdateHeaderEncoderTableSize(uint32_t value) {
GetHpackEncoder()->ApplyHeaderTableSizeSetting(value);
}
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_decoder_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698