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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | include/utils/SkProcessMemoryDump.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« 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