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

Unified Diff: net/spdy/spdy_stream.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_stream.h ('k') | net/spdy/spdy_write_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.cc
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index e00ae2140c35d47cf8f4fb9af4e5dab490ea9890..05d9f13bb08b68e4538fb7e794630961dcdc9342 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -23,6 +23,7 @@
#include "net/log/net_log.h"
#include "net/log/net_log_capture_mode.h"
#include "net/log/net_log_event_type.h"
+#include "net/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/spdy/spdy_buffer_producer.h"
#include "net/spdy/spdy_http_utils.h"
#include "net/spdy/spdy_session.h"
@@ -112,6 +113,7 @@ class SpdyStream::HeadersBufferProducer : public SpdyBufferProducer {
return std::unique_ptr<SpdyBuffer>(
new SpdyBuffer(stream_->ProduceHeadersFrame()));
}
+ size_t EstimateMemoryUsage() const override { return 0; }
private:
const base::WeakPtr<SpdyStream> stream_;
@@ -820,6 +822,16 @@ bool SpdyStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const {
return result;
}
+size_t SpdyStream::EstimateMemoryUsage() const {
+ // TODO(xunjieli): https://crbug.com/669108. Estimate |pending_send_data_|
+ // once scoped_refptr support is in.
+ return SpdyEstimateMemoryUsage(url_) +
+ SpdyEstimateMemoryUsage(request_headers_) +
+ SpdyEstimateMemoryUsage(url_from_header_block_) +
+ SpdyEstimateMemoryUsage(pending_recv_data_) +
+ SpdyEstimateMemoryUsage(response_headers_);
+}
+
void SpdyStream::UpdateHistograms() {
// We need at least the receive timers to be filled in, as otherwise
// metrics can be bogus.
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_write_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698