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 typedef uint64_t WebMemoryAllocatorDumpGuid; | |
|
Primiano Tucci (use gerrit)
2015/06/09 20:51:34
using WebMemoryAllocatorDumpGuid = uint64_t?
ssid
2015/06/10 12:36:00
Webkit has a lot of files which use typedef, for e
| |
| 12 | 13 |
| 13 // A container which holds all the attributes of a particular dump for a given | 14 // A container which holds all the attributes of a particular dump for a given |
| 14 // allocator. | 15 // allocator. |
| 15 class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { | 16 class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { |
| 16 public: | 17 public: |
| 18 // TODO(ssid): This constructor should be removed once the usage is | |
| 19 // changed in chromium side (ETA: 15/06/2015). | |
| 20 WebMemoryAllocatorDump() | |
| 21 : m_guid(0) | |
| 22 { | |
| 23 } | |
| 24 | |
| 25 WebMemoryAllocatorDump(WebMemoryAllocatorDumpGuid guid) | |
| 26 : m_guid(guid) | |
| 27 { | |
| 28 } | |
| 29 | |
| 17 virtual ~WebMemoryAllocatorDump(); | 30 virtual ~WebMemoryAllocatorDump(); |
| 18 | 31 |
| 19 // Adds a scalar attribute to the dump. | 32 // Adds a scalar attribute to the dump. |
| 20 // Arguments: | 33 // Arguments: |
| 21 // name: name of the attribute. Typical names, emitted by most allocators | 34 // name: name of the attribute. Typical names, emitted by most allocators |
| 22 // dump providers are: "outer_size", "inner_size", "objects_count". | 35 // dump providers are: "outer_size", "inner_size", "objects_count". |
| 23 // units: the units for the attribute. Gives a hint to the trace-viewer UI | 36 // units: the units for the attribute. Gives a hint to the trace-viewer UI |
| 24 // about the semantics of the attribute. | 37 // about the semantics of the attribute. |
| 25 // Currently supported values are "bytes" and "objects". | 38 // Currently supported values are "bytes" and "objects". |
| 26 // value: the value of the attribute. | 39 // value: the value of the attribute. |
| 27 virtual void AddScalar(const WebString& name, const char* units, uint64_t va lue) { BLINK_ASSERT_NOT_REACHED(); } | 40 virtual void AddScalar(const WebString& name, const char* units, uint64_t va lue) { BLINK_ASSERT_NOT_REACHED(); } |
| 28 virtual void AddScalarF(const WebString& name, const char* units, double val ue) { BLINK_ASSERT_NOT_REACHED(); } | 41 virtual void AddScalarF(const WebString& name, const char* units, double val ue) { BLINK_ASSERT_NOT_REACHED(); } |
| 29 virtual void AddString(const WebString& name, const char* units, const WebSt ring& value) { BLINK_ASSERT_NOT_REACHED(); } | 42 virtual void AddString(const WebString& name, const char* units, const WebSt ring& value) { BLINK_ASSERT_NOT_REACHED(); } |
| 43 | |
| 44 // |guid| is an optional global dump identifier, unique across all processes | |
| 45 // within the scope of a global dump. It is only required when using the | |
| 46 // graph APIs (see AddOwnershipEdge) to express retention / suballocation or | |
| 47 // cross process sharing. See crbug.com/492102 for design docs. | |
| 48 // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are | |
| 49 // expected to have the same guid. | |
| 50 const WebMemoryAllocatorDumpGuid& guid() const | |
| 51 { | |
| 52 BLINK_ASSERT(m_guid); | |
| 53 return m_guid; | |
| 54 } | |
| 55 | |
| 56 private: | |
| 57 WebMemoryAllocatorDumpGuid m_guid; | |
| 30 }; | 58 }; |
| 31 | 59 |
| 32 } // namespace blink | 60 } // namespace blink |
| 33 | 61 |
| 34 #endif // WebMemoryAllocatorDump_h | 62 #endif // WebMemoryAllocatorDump_h |
| OLD | NEW |