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

Unified Diff: include/utils/SkMemoryAllocatorDump.h

Issue 1263813002: [WIP] Exposing memory-infra to Skia. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: One more. Created 5 years, 4 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
« no previous file with comments | « no previous file | include/utils/SkProcessMemoryDump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/utils/SkMemoryAllocatorDump.h
diff --git a/include/utils/SkMemoryAllocatorDump.h b/include/utils/SkMemoryAllocatorDump.h
new file mode 100644
index 0000000000000000000000000000000000000000..15c0b20871a53383a783b62c788a7051499b71b9
--- /dev/null
+++ b/include/utils/SkMemoryAllocatorDump.h
@@ -0,0 +1,45 @@
+/*
+ * 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
+
+#include "SkTypes.h"
+#include "SkString.h"
+
+typedef uint64_t SkMemoryAllocatorDumpGuid;
+
+// A container which holds all the attributes of a particular dump for a given
+// allocator.
+class SK_API SkMemoryAllocatorDump {
+ public:
+ virtual ~SkMemoryAllocatorDump();
+
+ // Adds a scalar attribute to the dump.
+ // Arguments:
+ // name: name of the attribute. Typical names, emitted by most allocators
+ // dump providers are: "size" and "objects_count".
+ // units: the units for the attribute. Gives a hint to the trace-viewer UI
+ // about the semantics of the attribute.
+ // Currently supported values are "bytes" and "objects".
+ // value: the value of the attribute.
+ virtual void AddScalar(const char* name, const char* units, uint64_t value) {}
+ virtual void AddScalarF(const char* name, const char* units, double value) {}
+ virtual void AddString(const char* name,
+ const char* units,
+ const SkString& value) {}
+
+ // |guid| is an optional global dump identifier, unique across all processes
+ // within the scope of a global dump. It is only required when using the
+ // graph APIs (see AddOwnershipEdge) to express retention / suballocation or
+ // cross process sharing. See crbug.com/492102 for design docs.
+ // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are
+ // expected to have the same guid.
+ virtual SkMemoryAllocatorDumpGuid guid() const { return 0; }
+};
+
+#endif // SkMemoryAllocatorDump_DEFINED
« no previous file with comments | « no previous file | include/utils/SkProcessMemoryDump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698