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

Unified Diff: third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.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/heap/BlinkGCMemoryDumpProvider.cpp
diff --git a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
index 6f924c190fddf649300923184ea073b1df57045a..19bec4cb05062704b241c4e238b90d203d820418 100644
--- a/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
+++ b/third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
@@ -81,21 +81,17 @@ bool BlinkGCMemoryDumpProvider::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfD
return true;
}
-void BlinkGCMemoryDumpProvider::onHeapProfilingEnabled(bool enabled)
+void BlinkGCMemoryDumpProvider::onHeapProfilingEnabled()
{
- if (enabled) {
- {
- MutexLocker locker(m_allocationRegisterMutex);
- if (!m_allocationRegister)
- m_allocationRegister = adoptPtr(new base::trace_event::AllocationRegister());
- }
- HeapAllocHooks::setAllocationHook(reportAllocation);
- HeapAllocHooks::setFreeHook(reportFree);
- } else {
- HeapAllocHooks::setAllocationHook(nullptr);
- HeapAllocHooks::setFreeHook(nullptr);
+ ASSERT(!m_isHeapProfilingEnabled);
+ {
+ MutexLocker locker(m_allocationRegisterMutex);
+ if (!m_allocationRegister)
+ m_allocationRegister = adoptPtr(new base::trace_event::AllocationRegister());
}
- m_isHeapProfilingEnabled = enabled;
+ HeapAllocHooks::setAllocationHook(reportAllocation);
+ HeapAllocHooks::setFreeHook(reportFree);
+ m_isHeapProfilingEnabled = true;
}
WebMemoryAllocatorDump* BlinkGCMemoryDumpProvider::createMemoryAllocatorDumpForCurrentGC(const String& absoluteName)

Powered by Google App Engine
This is Rietveld 408576698