OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkMemoryAllocatorDump_DEFINED |
| 9 #define SkMemoryAllocatorDump_DEFINED |
| 10 |
| 11 #include "SkTypes.h" |
| 12 #include "SkString.h" |
| 13 |
| 14 typedef uint64_t SkMemoryAllocatorDumpGuid; |
| 15 |
| 16 // A container which holds all the attributes of a particular dump for a given |
| 17 // allocator. |
| 18 class SK_API SkMemoryAllocatorDump { |
| 19 public: |
| 20 virtual ~SkMemoryAllocatorDump(); |
| 21 |
| 22 // Adds a scalar attribute to the dump. |
| 23 // Arguments: |
| 24 // name: name of the attribute. Typical names, emitted by most allocators |
| 25 // dump providers are: "size" and "objects_count". |
| 26 // units: the units for the attribute. Gives a hint to the trace-viewer UI |
| 27 // about the semantics of the attribute. |
| 28 // Currently supported values are "bytes" and "objects". |
| 29 // value: the value of the attribute. |
| 30 virtual void AddScalar(const char* name, const char* units, uint64_t value) {} |
| 31 virtual void AddScalarF(const char* name, const char* units, double value) {} |
| 32 virtual void AddString(const char* name, |
| 33 const char* units, |
| 34 const SkString& value) {} |
| 35 |
| 36 // |guid| is an optional global dump identifier, unique across all processes |
| 37 // within the scope of a global dump. It is only required when using the |
| 38 // graph APIs (see AddOwnershipEdge) to express retention / suballocation or |
| 39 // cross process sharing. See crbug.com/492102 for design docs. |
| 40 // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are |
| 41 // expected to have the same guid. |
| 42 virtual SkMemoryAllocatorDumpGuid guid() const { return 0; } |
| 43 }; |
| 44 |
| 45 #endif // SkMemoryAllocatorDump_DEFINED |
OLD | NEW |