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

Unified Diff: third_party/WebKit/public/platform/WebMemoryDumpProvider.h

Issue 1391933004: [Tracing] Add hook to PartitionAlloc for heap profiling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address jl comments Created 5 years, 2 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 | « third_party/WebKit/Source/wtf/PartitionAlloc.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebMemoryDumpProvider.h
diff --git a/third_party/WebKit/public/platform/WebMemoryDumpProvider.h b/third_party/WebKit/public/platform/WebMemoryDumpProvider.h
index df151e8297bd2e1e5a406a6f8703a4d8a6bdff2a..62fbd13ee494538b8853cef798b4f09b3a765929 100644
--- a/third_party/WebKit/public/platform/WebMemoryDumpProvider.h
+++ b/third_party/WebKit/public/platform/WebMemoryDumpProvider.h
@@ -23,6 +23,11 @@ enum class WebMemoryDumpLevelOfDetail {
// Platform::registerMemoryDumpProvider()) to dump stats for their allocators.
class BLINK_PLATFORM_EXPORT WebMemoryDumpProvider {
public:
+ // Function types for functions that can be called on alloc and free to do
+ // heap profiling.
+ typedef void AllocationHook(void* address, size_t);
+ typedef void FreeHook(void* address);
+
virtual ~WebMemoryDumpProvider();
// Called by the MemoryDumpManager when generating memory dumps.
@@ -32,6 +37,18 @@ public:
// on success or false if anything went wrong and the dump should be
// considered invalid.
virtual bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) = 0;
+
+ // Because Blink cannot depend on base, heap profiling bookkeeping has to
+ // be done in the glue layer for now. This method allows the glue layer to
+ // detect whether the current dump provider supports heap profiling.
+ // TODO(ruuda): Remove once wtf can depend on base and do bookkeeping in the
+ // provider itself.
+ virtual bool supportsHeapProfiling() { return false; }
+
+ // Called by the memory dump manager to enable heap profiling (with
+ // non-null hook functions) or called to disable heap profiling (with null
+ // pointers).
+ virtual void onHeapProfilingEnabled(AllocationHook* allocationHook, FreeHook* freeHook) {}
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/wtf/PartitionAlloc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698