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

Unified Diff: third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp

Issue 1706163002: Refactoring: Remove an argument 'enabled' from onHeapProfilingEnabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp
diff --git a/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp b/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp
index 5025908fc1ca84dd7f6aa366b6df08063a82f0b5..1cc78c0832e48b2d02b60dc18555e7e16d0a4733 100644
--- a/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp
+++ b/third_party/WebKit/Source/platform/PartitionAllocMemoryDumpProvider.cpp
@@ -148,21 +148,17 @@ PartitionAllocMemoryDumpProvider::~PartitionAllocMemoryDumpProvider()
{
}
-void PartitionAllocMemoryDumpProvider::onHeapProfilingEnabled(bool enabled)
+void PartitionAllocMemoryDumpProvider::onHeapProfilingEnabled()
{
- if (enabled) {
- {
- MutexLocker locker(m_allocationRegisterMutex);
- if (!m_allocationRegister)
- m_allocationRegister = adoptPtr(new base::trace_event::AllocationRegister());
- }
- PartitionAllocHooks::setAllocationHook(reportAllocation);
- PartitionAllocHooks::setFreeHook(reportFree);
- } else {
- PartitionAllocHooks::setAllocationHook(nullptr);
- PartitionAllocHooks::setFreeHook(nullptr);
+ ASSERT(!m_isHeapProfilingEnabled);
+ {
+ MutexLocker locker(m_allocationRegisterMutex);
+ if (!m_allocationRegister)
+ m_allocationRegister = adoptPtr(new base::trace_event::AllocationRegister());
}
- m_isHeapProfilingEnabled = enabled;
+ PartitionAllocHooks::setAllocationHook(reportAllocation);
+ PartitionAllocHooks::setFreeHook(reportFree);
+ m_isHeapProfilingEnabled = true;
}
void PartitionAllocMemoryDumpProvider::insert(void* address, size_t size, const char* typeName)

Powered by Google App Engine
This is Rietveld 408576698