Chromium Code Reviews| 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 // Class which has the guid of the WebMemoryAllocatorDump. The guid can either | |
| 14 // be uint64_t or WebString. | |
| 15 struct BLINK_PLATFORM_EXPORT WebMemoryAllocatorDumpGuid { | |
| 16 enum GuidType { | |
| 17 Int64Type, | |
|
Primiano Tucci (use gerrit)
2015/05/29 11:24:53
Technically this is a uint64 not int64, so either
ssid
2015/05/29 15:50:48
Done.
| |
| 18 StringType | |
| 19 }; | |
| 20 | |
| 21 const uint64_t guidInt64; | |
| 22 const WebString guidString; | |
| 23 const GuidType type; | |
| 24 | |
| 25 explicit WebMemoryAllocatorDumpGuid(const uint64_t guid) | |
| 26 : guidInt64(guid) | |
| 27 , guidString() | |
| 28 , type(Int64Type) | |
| 29 { | |
| 30 } | |
| 31 | |
| 32 explicit WebMemoryAllocatorDumpGuid(const WebString& guid) | |
| 33 : guidInt64(0) | |
| 34 , guidString(guid) | |
| 35 , type(StringType) | |
| 36 { | |
| 37 } | |
| 38 }; | |
| 39 | |
| 13 // A container which holds all the attributes of a particular dump for a given | 40 // A container which holds all the attributes of a particular dump for a given |
| 14 // allocator. | 41 // allocator. |
| 15 class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { | 42 class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { |
| 16 public: | 43 public: |
| 17 virtual ~WebMemoryAllocatorDump(); | 44 virtual ~WebMemoryAllocatorDump(); |
| 18 | 45 |
| 19 // Adds a scalar attribute to the dump. | 46 // Adds a scalar attribute to the dump. |
| 20 // Arguments: | 47 // Arguments: |
| 21 // name: name of the attribute. Typical names, emitted by most allocators | 48 // name: name of the attribute. Typical names, emitted by most allocators |
| 22 // dump providers are: "outer_size", "inner_size", "objects_count". | 49 // dump providers are: "outer_size", "inner_size", "objects_count". |
| 23 // units: the units for the attribute. Gives a hint to the trace-viewer UI | 50 // units: the units for the attribute. Gives a hint to the trace-viewer UI |
| 24 // about the semantics of the attribute. | 51 // about the semantics of the attribute. |
| 25 // Currently supported values are "bytes" and "objects". | 52 // Currently supported values are "bytes" and "objects". |
| 26 // value: the value of the attribute. | 53 // value: the value of the attribute. |
| 27 virtual void AddScalar(const WebString& name, const char* units, uint64_t va lue) { } | 54 virtual void AddScalar(const WebString& name, const char* units, uint64_t va lue) { } |
| 28 virtual void AddString(const WebString& name, const char* units, const WebSt ring& value) { } | 55 virtual void AddString(const WebString& name, const char* units, const WebSt ring& value) { } |
| 29 }; | 56 }; |
| 30 | 57 |
| 31 } // namespace blink | 58 } // namespace blink |
| 32 | 59 |
| 33 #endif // WebMemoryAllocatorDump_h | 60 #endif // WebMemoryAllocatorDump_h |
| OLD | NEW |