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

Unified Diff: net/url_request/url_request_context.cc

Issue 2699163002: Whitelist net/ MemoryDumpProvider (Closed)
Patch Set: fix test on windows Created 3 years, 10 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/ssl/ssl_client_session_cache_unittest.cc ('k') | net/url_request/url_request_context_unittest.cc » ('j') | 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 300c050ea43be007578f712bdb3f495111051170..a7b02337c3da375d6c7d3a2a731cd38c2ec24e78 100644
--- a/net/url_request/url_request_context.cc
+++ b/net/url_request/url_request_context.cc
@@ -4,6 +4,8 @@
#include "net/url_request/url_request_context.h"
+#include <inttypes.h>
+
#include "base/compiler_specific.h"
#include "base/debug/alias.h"
#include "base/memory/ptr_util.h"
@@ -12,6 +14,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 +141,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));
+ 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 +165,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;
}
« no previous file with comments | « net/ssl/ssl_client_session_cache_unittest.cc ('k') | net/url_request/url_request_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698