| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BlinkGCMemoryDumpProvider_h | 5 #ifndef BlinkGCMemoryDumpProvider_h |
| 6 #define BlinkGCMemoryDumpProvider_h | 6 #define BlinkGCMemoryDumpProvider_h |
| 7 | 7 |
| 8 #include "base/trace_event/memory_allocator_dump.h" |
| 9 #include "base/trace_event/memory_dump_provider.h" |
| 8 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
| 9 #include "public/platform/WebMemoryDumpProvider.h" | |
| 10 #include "wtf/OwnPtr.h" | 11 #include "wtf/OwnPtr.h" |
| 11 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 12 | 13 |
| 13 namespace blink { | 14 namespace blink { |
| 14 class WebMemoryAllocatorDump; | 15 class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final : public base::trace_event
::MemoryDumpProvider { |
| 15 | |
| 16 class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final : public WebMemoryDumpProv
ider { | |
| 17 public: | 16 public: |
| 18 static BlinkGCMemoryDumpProvider* instance(); | 17 static BlinkGCMemoryDumpProvider* instance(); |
| 19 ~BlinkGCMemoryDumpProvider() override; | 18 ~BlinkGCMemoryDumpProvider() override; |
| 20 | 19 |
| 21 // WebMemoryDumpProvider implementation. | 20 // base::trace_event::MemoryDumpProvider implementation. |
| 22 bool onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) overrid
e; | 21 bool OnMemoryDump( |
| 22 const base::trace_event::MemoryDumpArgs&, |
| 23 base::trace_event::ProcessMemoryDump*) override; |
| 23 | 24 |
| 24 // The returned WebMemoryAllocatorDump is owned by | 25 // The returned WebMemoryAllocatorDump is owned by |
| 25 // BlinkGCMemoryDumpProvider, and should not be retained (just used to | 26 // BlinkGCMemoryDumpProvider, and should not be retained (just used to |
| 26 // dump in the current call stack). | 27 // dump in the current call stack). |
| 27 WebMemoryAllocatorDump* createMemoryAllocatorDumpForCurrentGC(const String&
absoluteName); | 28 base::trace_event::MemoryAllocatorDump* createMemoryAllocatorDumpForCurrentG
C(const String& absoluteName); |
| 28 | 29 |
| 29 // This must be called before taking a new process-wide GC snapshot, to | 30 // This must be called before taking a new process-wide GC snapshot, to |
| 30 // clear the previous dumps. | 31 // clear the previous dumps. |
| 31 void clearProcessDumpForCurrentGC(); | 32 void clearProcessDumpForCurrentGC(); |
| 32 | 33 |
| 33 WebProcessMemoryDump* currentProcessMemoryDump() { return m_currentProcessMe
moryDump.get(); } | 34 base::trace_event::ProcessMemoryDump* currentProcessMemoryDump() { return m_
currentProcessMemoryDump.get(); } |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 BlinkGCMemoryDumpProvider(); | 37 BlinkGCMemoryDumpProvider(); |
| 37 | 38 |
| 38 OwnPtr<WebProcessMemoryDump> m_currentProcessMemoryDump; | 39 OwnPtr<base::trace_event::ProcessMemoryDump> m_currentProcessMemoryDump; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 } // namespace blink | 42 } // namespace blink |
| 42 | 43 |
| 43 #endif | 44 #endif |
| OLD | NEW |