 Chromium Code Reviews
 Chromium Code Reviews Issue 2667293003:
  [OBSOLETE][memory-infra] Whitelist net dump providers in field trials  (Closed)
    
  
    Issue 2667293003:
  [OBSOLETE][memory-infra] Whitelist net dump providers in field trials  (Closed) 
  | Index: net/url_request/url_request_context.cc | 
| diff --git a/net/url_request/url_request_context.cc b/net/url_request/url_request_context.cc | 
| index cefa7b9db2593c3e0abc8ed1d39485fef36e267b..e4453d6cf250cc6cae2f7f6e30d33f5593903198 100644 | 
| --- a/net/url_request/url_request_context.cc | 
| +++ b/net/url_request/url_request_context.cc | 
| @@ -127,20 +127,30 @@ bool URLRequestContext::OnMemoryDump( | 
| base::trace_event::ProcessMemoryDump* pmd) { | 
| if (name_.empty()) | 
| name_ = "unknown"; | 
| - base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump( | 
| - base::StringPrintf("net/url_request_context/%s_%p", name_.c_str(), this)); | 
| - dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount, | 
| - base::trace_event::MemoryAllocatorDump::kUnitsObjects, | 
| - url_requests_->size()); | 
| + | 
| + SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd); | 
| + | 
| + // The details about the url request context name are not added in BACKGROUND | 
| + // mode dumps. | 
| + std::string dump_name; | 
| + if (args.level_of_detail != | 
| + base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) { | 
| + dump_name = base::StringPrintf("net/url_request_context/%s_%p", | 
| 
Primiano Tucci (use gerrit)
2017/02/03 03:18:50
don't you have to do this outside of the if?
other
 
ssid
2017/02/03 03:27:56
I am intentionally passing empty dump name here so
 | 
| + name_.c_str(), this); | 
| + base::trace_event::MemoryAllocatorDump* dump = | 
| + pmd->CreateAllocatorDump(dump_name); | 
| + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount, | 
| + base::trace_event::MemoryAllocatorDump::kUnitsObjects, | 
| + url_requests_->size()); | 
| + } | 
| HttpTransactionFactory* transaction_factory = http_transaction_factory(); | 
| if (transaction_factory) { | 
| HttpNetworkSession* network_session = transaction_factory->GetSession(); | 
| if (network_session) | 
| - network_session->DumpMemoryStats(pmd, dump->absolute_name()); | 
| + network_session->DumpMemoryStats(pmd, dump_name); | 
| } | 
| - SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd); | 
| 
Primiano Tucci (use gerrit)
2017/02/03 03:18:50
just checking, is this removal intended or just ac
 
ssid
2017/02/03 03:27:56
I moved it up since it is a static function call.
 | 
| if (sdch_manager_) | 
| - sdch_manager_->DumpMemoryStats(pmd, dump->absolute_name()); | 
| + sdch_manager_->DumpMemoryStats(pmd, dump_name); | 
| return true; | 
| } |