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

Side by Side Diff: third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp

Issue 1675183006: tracing: add dump provider for malloc heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shim_layer_linux
Patch Set: ssid review Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/heap/BlinkGCMemoryDumpProvider.h" 5 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
6 6
7 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" 7 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
8 #include "base/trace_event/heap_profiler_allocation_register.h" 8 #include "base/trace_event/heap_profiler_allocation_register.h"
9 #include "base/trace_event/trace_event_memory_overhead.h" 9 #include "base/trace_event/trace_event_memory_overhead.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() 112 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider()
113 : m_currentProcessMemoryDump(adoptPtr(new WebProcessMemoryDumpImpl())) 113 : m_currentProcessMemoryDump(adoptPtr(new WebProcessMemoryDumpImpl()))
114 , m_isHeapProfilingEnabled(false) 114 , m_isHeapProfilingEnabled(false)
115 { 115 {
116 } 116 }
117 117
118 void BlinkGCMemoryDumpProvider::insert(Address address, size_t size, const char* typeName) 118 void BlinkGCMemoryDumpProvider::insert(Address address, size_t size, const char* typeName)
119 { 119 {
120 base::trace_event::AllocationContext context = base::trace_event::Allocation ContextTracker::GetContextSnapshot(); 120 base::trace_event::AllocationContext context = base::trace_event::Allocation ContextTracker::GetInstanceForCurrentThread()->GetContextSnapshot();
121 context.type_name = typeName; 121 context.type_name = typeName;
122 MutexLocker locker(m_allocationRegisterMutex); 122 MutexLocker locker(m_allocationRegisterMutex);
123 if (m_allocationRegister) 123 if (m_allocationRegister)
124 m_allocationRegister->Insert(address, size, context); 124 m_allocationRegister->Insert(address, size, context);
125 } 125 }
126 126
127 void BlinkGCMemoryDumpProvider::remove(Address address) 127 void BlinkGCMemoryDumpProvider::remove(Address address)
128 { 128 {
129 MutexLocker locker(m_allocationRegisterMutex); 129 MutexLocker locker(m_allocationRegisterMutex);
130 if (m_allocationRegister) 130 if (m_allocationRegister)
131 m_allocationRegister->Remove(address); 131 m_allocationRegister->Remove(address);
132 } 132 }
133 133
134 } // namespace blink 134 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698