Chromium Code Reviews| 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 300c050ea43be007578f712bdb3f495111051170..8bd84b47e28f004738d4b70ac867704b7f766a83 100644 |
| --- a/net/url_request/url_request_context.cc |
| +++ b/net/url_request/url_request_context.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "base/trace_event/memory_allocator_dump.h" |
| #include "base/trace_event/memory_dump_manager.h" |
| +#include "base/trace_event/memory_dump_request_args.h" |
| #include "base/trace_event/process_memory_dump.h" |
| #include "net/base/sdch_manager.h" |
| #include "net/cookies/cookie_store.h" |
| @@ -138,11 +139,21 @@ 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)); |
| + |
| + SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd); |
| + |
| + std::string dump_name = base::StringPrintf( |
| + "net/url_request_context_0x%" PRIxPTR, reinterpret_cast<uintptr_t>(this)); |
|
ssid
2017/02/23 20:41:01
include inttypes?
xunjieli
2017/02/23 20:48:17
Done.
|
| + base::trace_event::MemoryAllocatorDump* dump = |
| + pmd->CreateAllocatorDump(dump_name); |
| dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount, |
| base::trace_event::MemoryAllocatorDump::kUnitsObjects, |
| url_requests_->size()); |
| + if (args.level_of_detail != |
| + base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) { |
| + dump->AddString("origin", |
| + base::trace_event::MemoryAllocatorDump::kTypeString, name_); |
| + } |
| HttpTransactionFactory* transaction_factory = http_transaction_factory(); |
| if (transaction_factory) { |
| HttpNetworkSession* network_session = transaction_factory->GetSession(); |
| @@ -152,9 +163,8 @@ bool URLRequestContext::OnMemoryDump( |
| if (http_cache) |
| http_cache->DumpMemoryStats(pmd, dump->absolute_name()); |
| } |
| - SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd); |
| if (sdch_manager_) |
| - sdch_manager_->DumpMemoryStats(pmd, dump->absolute_name()); |
| + sdch_manager_->DumpMemoryStats(pmd, dump_name); |
| return true; |
| } |