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

Unified Diff: base/trace_event/trace_event_memory.cc

Issue 1469843002: Remove dependency on allocator from 'content' targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unify_allocator1_2
Patch Set: Fix build Created 5 years, 1 month 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
Index: base/trace_event/trace_event_memory.cc
diff --git a/base/trace_event/trace_event_memory.cc b/base/trace_event/trace_event_memory.cc
index 73c8536cac2a83a2145a88e93c35ec0a61d45490..5be03758202e10c24729db230a438663e0ace934 100644
--- a/base/trace_event/trace_event_memory.cc
+++ b/base/trace_event/trace_event_memory.cc
@@ -145,15 +145,8 @@ int GetPseudoStack(int skip_count_ignored, void** stack_out) {
//////////////////////////////////////////////////////////////////////////////
TraceMemoryController::TraceMemoryController(
- scoped_refptr<SingleThreadTaskRunner> task_runner,
- HeapProfilerStartFunction heap_profiler_start_function,
- HeapProfilerStopFunction heap_profiler_stop_function,
- GetHeapProfileFunction get_heap_profile_function)
- : task_runner_(task_runner.Pass()),
- heap_profiler_start_function_(heap_profiler_start_function),
- heap_profiler_stop_function_(heap_profiler_stop_function),
- get_heap_profile_function_(get_heap_profile_function),
- weak_factory_(this) {
+ scoped_refptr<SingleThreadTaskRunner> task_runner)
+ : task_runner_(task_runner.Pass()), weak_factory_(this) {
// Force the "memory" category to show up in the trace viewer.
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("memory"), "init");
// Watch for the tracing system being enabled.
@@ -198,7 +191,7 @@ void TraceMemoryController::StartProfiling() {
InitThreadLocalStorage();
ScopedTraceMemory::set_enabled(true);
// Call ::HeapProfilerWithPseudoStackStart().
- heap_profiler_start_function_(&GetPseudoStack);
+ allocator::HeapProfilerStart(&GetPseudoStack);
const int kDumpIntervalSeconds = 5;
dump_timer_.Start(FROM_HERE,
TimeDelta::FromSeconds(kDumpIntervalSeconds),
@@ -214,7 +207,7 @@ void TraceMemoryController::DumpMemoryProfile() {
DVLOG(1) << "DumpMemoryProfile";
// MemoryDumpHolder takes ownership of this string. See GetHeapProfile() in
// tcmalloc for details.
- char* dump = get_heap_profile_function_();
+ char* dump = allocator::GetHeapProfile();
const int kSnapshotId = 1;
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("memory"),
@@ -232,7 +225,7 @@ void TraceMemoryController::StopProfiling() {
ScopedTraceMemory::set_enabled(false);
CleanupThreadLocalStorage();
// Call ::HeapProfilerStop().
- heap_profiler_stop_function_();
+ allocator::HeapProfilerStop();
}
bool TraceMemoryController::IsTimerRunningForTest() const {

Powered by Google App Engine
This is Rietveld 408576698