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

Unified Diff: include/utils/SkMemoryDumpProvider.h

Issue 1263813002: [WIP] Exposing memory-infra to Skia. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Prettier. Created 5 years, 5 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: include/utils/SkMemoryDumpProvider.h
diff --git a/include/utils/SkMemoryDumpProvider.h b/include/utils/SkMemoryDumpProvider.h
new file mode 100644
index 0000000000000000000000000000000000000000..0ab6c61490754291ce0bdd80a7b22090fe73dea8
--- /dev/null
+++ b/include/utils/SkMemoryDumpProvider.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 Google Inc. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkMemoryAllocatorDump_DEFINED
+#define SkMemoryAllocatorDump_DEFINED
+
+class SkProcessMemoryDump;
+
+// Base interface to be part of the memory tracing infrastructure. Skia classes
+// can implement this interface and register themselves (see
+// Platform::registerMemoryDumpProvider()) to dump stats for their allocators.
+class SK_API SkMemoryDumpProvider {
+ public:
+ virtual ~SkMemoryDumpProvider();
+
+ // Called by the MemoryDumpManager when generating memory dumps. Embedders
+ // are expected to populate the SkProcessMemoryDump* argument and return
+ // true on success or false if anything went wrong and the dump should be
+ // considered invalid.
+ virtual bool onMemoryDump(SkProcessMemoryDump*) = 0;
+};
+
+#endif // SkMemoryDumpProvider_DEFINED

Powered by Google App Engine
This is Rietveld 408576698