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

Side by Side Diff: third_party/WebKit/Source/platform/web_memory_allocator_dump.h

Issue 2028483002: Remove abstract classes for memory dumper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WebMemoryAllocatorDump_h
6 #define WebMemoryAllocatorDump_h
7
8 #include <stdint.h>
9
10 #include "base/macros.h"
11 #include "platform/PlatformExport.h"
12 #include "wtf/text/WTFString.h"
13
14 namespace base {
15 namespace trace_event {
16 class MemoryAllocatorDump;
17 } // namespace base
18 } // namespace trace_event
19
20 namespace blink {
21
22 typedef uint64_t WebMemoryAllocatorDumpGuid;
23
24 // A container which holds all the attributes of a particular dump for a given
25 // allocator.
26 class PLATFORM_EXPORT WebMemoryAllocatorDump final {
27 public:
28 explicit WebMemoryAllocatorDump(
29 base::trace_event::MemoryAllocatorDump* memory_allocator_dump);
30 ~WebMemoryAllocatorDump();
31
32 // Adds a scalar attribute to the dump.
33 // Arguments:
34 // name: name of the attribute. Typical names, emitted by most allocators
35 // dump providers are: "size" and "objects_count".
36 // units: the units for the attribute. Gives a hint to the trace-viewer UI
37 // about the semantics of the attribute.
38 // Currently supported values are "bytes" and "objects".
39 // value: the value of the attribute.
40 void addScalar(const char* name, const char* units, uint64_t value);
41 void addScalarF(const char* name, const char* units, double value);
42 void addString(const char* name,
43 const char* units,
44 const String& value);
45
46 // |guid| is an optional global dump identifier, unique across all processes
47 // within the scope of a global dump. It is only required when using the
48 // graph APIs (see AddOwnershipEdge) to express retention / suballocation or
49 // cross process sharing. See crbug.com/492102 for design docs.
50 // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are
51 // expected to have the same guid.
52 blink::WebMemoryAllocatorDumpGuid guid() const;
53
54 private:
55 base::trace_event::MemoryAllocatorDump* memory_allocator_dump_; // Not owned.
56 blink::WebMemoryAllocatorDumpGuid guid_;
57
58 DISALLOW_COPY_AND_ASSIGN(WebMemoryAllocatorDump);
59 };
60
61 } // namespace blink
62
63 #endif // WebMemoryAllocatorDump_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698