| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebMemoryAllocatorDump_h | 5 #ifndef WebMemoryAllocatorDump_h |
| 6 #define WebMemoryAllocatorDump_h | 6 #define WebMemoryAllocatorDump_h |
| 7 | 7 |
| 8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
| 9 #include "WebString.h" | 9 #include "WebString.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 // A container which holds all the attributes of a particular dump for a given | 13 // A container which holds all the attributes of a particular dump for a given |
| 14 // allocator. | 14 // allocator. |
| 15 class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { | 15 class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { |
| 16 public: | 16 public: |
| 17 virtual ~WebMemoryAllocatorDump(); | 17 virtual ~WebMemoryAllocatorDump(); |
| 18 | 18 |
| 19 // Adds a scalar attribute to the dump. | 19 // Adds a scalar attribute to the dump. |
| 20 // Arguments: | 20 // Arguments: |
| 21 // name: name of the attribute. Typical names, emitted by most allocators | 21 // name: name of the attribute. Typical names, emitted by most allocators |
| 22 // dump providers are: "size" and "objects_count". | 22 // dump providers are: "size" and "objects_count". |
| 23 // units: the units for the attribute. Gives a hint to the trace-viewer UI | 23 // units: the units for the attribute. Gives a hint to the trace-viewer UI |
| 24 // about the semantics of the attribute. | 24 // about the semantics of the attribute. |
| 25 // Currently supported values are "bytes" and "objects". | 25 // Currently supported values are "bytes" and "objects". |
| 26 // value: the value of the attribute. | 26 // value: the value of the attribute. |
| 27 virtual void AddScalar(const char* name, const char* units, uint64_t value)
{ } | 27 virtual void AddScalar(const char* name, const char* units, uint64_t value)
{ } |
| 28 virtual void AddScalarF(const char* name, const char* units, double value) {
} | 28 virtual void AddScalarF(const char* name, const char* units, double value) {
} |
| 29 virtual void AddString(const char* name, const char* units, const WebString&
value) { } | 29 virtual void AddString(const char* name, const char* units, const WebString&
value) { } |
| 30 | |
| 31 // TODO(primiano): these below will go away soon, required only to handle a
multisided patch. | |
| 32 virtual void AddScalar(const WebString& name, const char* units, uint64_t va
lue) { } | |
| 33 virtual void AddScalarF(const WebString& name, const char* units, double val
ue) { } | |
| 34 virtual void AddString(const WebString& name, const char* units, const WebSt
ring& value) { } | |
| 35 }; | 30 }; |
| 36 | 31 |
| 37 } // namespace blink | 32 } // namespace blink |
| 38 | 33 |
| 39 #endif // WebMemoryAllocatorDump_h | 34 #endif // WebMemoryAllocatorDump_h |
| OLD | NEW |