Chromium Code Reviews| 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..6ab4bbc732bd3882464288212f3c0d3cc96840cd 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,17 @@ 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 for which dump provider it should do the bookkeeping. |
|
Primiano Tucci (use gerrit)
2015/10/19 21:32:04
s/for which dump provider it should do the bookkee
haraken
2015/10/20 00:14:19
Add a TODO and mention that this should be removed
Ruud van Asseldonk
2015/10/20 11:43:57
Done, though that does miss the fact that the glue
|
| + 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). This is a workaround for the fact that Blink cannot use |
|
Primiano Tucci (use gerrit)
2015/10/19 21:32:03
Remove the "Ths is a workaround" part. You already
Ruud van Asseldonk
2015/10/20 11:43:57
Done.
|
| + // |base::trace_event::AllocationRegister| and do the bookkeeping itself. |
| + virtual void onHeapProfilingEnabled(AllocationHook* allocationHook, FreeHook* freeHook) {} |
| }; |
| } // namespace blink |