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

Unified Diff: net/spdy/spdy_stream.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/spdy_stream.cc
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index e00ae2140c35d47cf8f4fb9af4e5dab490ea9890..4528e9ccf263f161506f5402884349002a0adcf9 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -19,6 +19,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/trace_event/memory_usage_estimator.h"
#include "base/values.h"
#include "net/log/net_log.h"
#include "net/log/net_log_capture_mode.h"
@@ -820,6 +821,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 base::trace_event::EstimateMemoryUsage(url_) +
+ base::trace_event::EstimateMemoryUsage(request_headers_) +
+ base::trace_event::EstimateMemoryUsage(url_from_header_block_) +
+ base::trace_event::EstimateMemoryUsage(pending_recv_data_) +
+ base::trace_event::EstimateMemoryUsage(response_headers_);
+}
+
void SpdyStream::UpdateHistograms() {
// We need at least the receive timers to be filled in, as otherwise
// metrics can be bogus.

Powered by Google App Engine
This is Rietveld 408576698