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

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: minor fix 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..59cfeca5e17731eb59e9c00d432dbeb99f7cfeba 100644
--- a/net/spdy/spdy_session_pool.cc
+++ b/net/spdy/spdy_session_pool.cc
@@ -371,10 +371,6 @@ 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);
size_t total_size = 0;
size_t buffer_size = 0;
size_t cert_count = 0;
@@ -391,6 +387,11 @@ void SpdySessionPool::DumpMemoryStats(
if (is_session_active)
num_active_sessions++;
}
+ if (sessions_.empty())
ssid 2017/01/20 21:35:58 Could do this at the start of the function. But w
xunjieli 2017/01/20 21:45:26 Done. Good point!
+ return;
+ 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