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

Unified Diff: net/spdy/spdy_session_pool.cc

Issue 2639403005: Skip creating spdy_session_pool dump if pool is empty in MemoryDumpProvider (Closed)
Patch Set: early return 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session_pool.cc
diff --git a/net/spdy/spdy_session_pool.cc b/net/spdy/spdy_session_pool.cc
index bba426920241fbaf46374819dd866e15a8138bba..1a594d0cb7bda48e16f9926124411e1d5e370a12 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -371,10 +371,8 @@ void SpdySessionPool::OnCertDBChanged(const X509Certificate* cert) {
void SpdySessionPool::DumpMemoryStats(
base::trace_event::ProcessMemoryDump* pmd,
const std::string& parent_dump_absolute_name) const {
- std::string dump_name = base::StringPrintf("%s/spdy_session_pool",
- parent_dump_absolute_name.c_str());
- base::trace_event::MemoryAllocatorDump* dump =
- pmd->CreateAllocatorDump(dump_name);
+ if (sessions_.empty())
+ return;
size_t total_size = 0;
size_t buffer_size = 0;
size_t cert_count = 0;
@@ -391,6 +389,9 @@ void SpdySessionPool::DumpMemoryStats(
if (is_session_active)
num_active_sessions++;
}
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(base::StringPrintf(
+ "%s/spdy_session_pool", parent_dump_absolute_name.c_str()));
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
total_size);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698