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

Unified Diff: net/url_request/url_request_context.cc

Issue 2772283003: Make url_request_context dumps include context names (Closed)
Patch Set: Revert back to an explicit list Created 3 years, 9 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 | « net/url_request/url_request_context.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a7b02337c3da375d6c7d3a2a731cd38c2ec24e78..59f74d4989323a5a8bc8845b11d5c4b47b648ae8 100644
--- a/net/url_request/url_request_context.cc
+++ b/net/url_request/url_request_context.cc
@@ -49,7 +49,8 @@ URLRequestContext::URLRequestContext()
network_quality_estimator_(nullptr),
url_requests_(new std::set<const URLRequest*>),
enable_brotli_(false),
- check_cleartext_permitted_(false) {
+ check_cleartext_permitted_(false),
+ name_(nullptr) {
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "URLRequestContext", base::ThreadTaskRunnerHandle::Get());
}
@@ -139,23 +140,19 @@ void URLRequestContext::AssertNoURLRequests() const {
bool URLRequestContext::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
- if (name_.empty())
+ if (!name_)
name_ = "unknown";
SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd);
- std::string dump_name = base::StringPrintf(
- "net/url_request_context_0x%" PRIxPTR, reinterpret_cast<uintptr_t>(this));
+ std::string dump_name =
+ base::StringPrintf("net/url_request_context/%s/0x%" PRIxPTR, name_,
+ reinterpret_cast<uintptr_t>(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());
- 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();
« no previous file with comments | « net/url_request/url_request_context.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698