| 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
|
|
|