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

Unified Diff: Source/platform/heap/BlinkGCMemoryDumpProvider.h

Issue 1149673002: Adding blink gc memory dump infrastructure for thread specific dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing nits. Created 5 years, 7 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: Source/platform/heap/BlinkGCMemoryDumpProvider.h
diff --git a/Source/platform/heap/BlinkGCMemoryDumpProvider.h b/Source/platform/heap/BlinkGCMemoryDumpProvider.h
index 1ed934947dbb4b651a9b3213e8327a56b3d6108c..a5e8c156edd18d165121867a4d3ce84519ce0d7a 100644
--- a/Source/platform/heap/BlinkGCMemoryDumpProvider.h
+++ b/Source/platform/heap/BlinkGCMemoryDumpProvider.h
@@ -6,9 +6,13 @@
#define BlinkGCMemoryDumpProvider_h
#include "platform/PlatformExport.h"
+#include "platform/TraceEvent.h"
#include "public/platform/WebMemoryDumpProvider.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/text/WTFString.h"
namespace blink {
+class WebMemoryAllocatorDump;
class PLATFORM_EXPORT BlinkGCMemoryDumpProvider final : public WebMemoryDumpProvider {
public:
@@ -18,8 +22,22 @@ public:
// WebMemoryDumpProvider implementation.
bool onMemoryDump(WebProcessMemoryDump*) override;
+ static inline bool isMemoryTracingEnabled()
+ {
+ // TODO(ssid): Change this to use api from memory-infra to check tracing
+ // memory_tracing_enabled (crbug.com/490087).
+ bool enabled;
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("memory-infra"), &enabled);
+ return enabled;
+ }
+
+ WebMemoryAllocatorDump* createMemoryAllocatorDumpForLastGC(const String& absoluteName);
+ void clearLastGCProcessMemoryDump();
+
private:
BlinkGCMemoryDumpProvider();
+
+ OwnPtr<WebProcessMemoryDump> m_lastProcessMemoryDump;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698