Chromium Code Reviews| Index: public/platform/WebMemoryAllocatorDump.h |
| diff --git a/public/platform/WebMemoryAllocatorDump.h b/public/platform/WebMemoryAllocatorDump.h |
| index 91136f19852769e96912b0a042f64cb9a48a40ed..39112dbd02d06c7ca8dc9d23622750ba53082a21 100644 |
| --- a/public/platform/WebMemoryAllocatorDump.h |
| +++ b/public/platform/WebMemoryAllocatorDump.h |
| @@ -10,10 +10,50 @@ |
| namespace blink { |
| +// Struct which has the guid of the WebMemoryAllocatorDump. The guid can either |
| +// be uint64_t or WebString. |
| +struct BLINK_PLATFORM_EXPORT WebMemoryAllocatorDumpGuid { |
| +public: |
| + enum GuidType { |
| + IntType, |
| + StringType |
| + }; |
| + |
| + explicit WebMemoryAllocatorDumpGuid(const uint64_t guid) |
| + : guidInt(guid) |
| + , guidString() |
| + , type(IntType) |
| + { |
| + } |
| + |
| + explicit WebMemoryAllocatorDumpGuid(const WebString& guid) |
| + : guidInt(0) |
| + , guidString(guid) |
| + , type(StringType) |
| + { |
| + } |
| + |
| + uint64_t guidInt; |
| + WebString guidString; |
| + GuidType type; |
| +}; |
| + |
| // A container which holds all the attributes of a particular dump for a given |
| // allocator. |
| class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { |
| public: |
| + // TODO(ssid): This constructor should be removed once the usage is |
|
Primiano Tucci (use gerrit)
2015/06/08 09:39:16
I don't think you need neither of these constructo
|
| + // changed in chromium side (crbug.com/480500). |
| + WebMemoryAllocatorDump() |
| + : m_guid(WebMemoryAllocatorDumpGuid(0)) |
| + { |
| + } |
| + |
| + WebMemoryAllocatorDump(WebMemoryAllocatorDumpGuid guid) |
| + : m_guid(guid) |
| + { |
| + } |
| + |
| virtual ~WebMemoryAllocatorDump(); |
| // Adds a scalar attribute to the dump. |
| @@ -27,6 +67,22 @@ public: |
| virtual void AddScalar(const WebString& name, const char* units, uint64_t value) { BLINK_ASSERT_NOT_REACHED(); } |
| virtual void AddScalarF(const WebString& name, const char* units, double value) { BLINK_ASSERT_NOT_REACHED(); } |
| virtual void AddString(const WebString& name, const char* units, const WebString& value) { BLINK_ASSERT_NOT_REACHED(); } |
| + |
| + // |guid| is an optional global dump identifier, unique across all processes |
| + // within the scope of a global dump. It is only required when using the |
| + // graph APIs (see TODO_method_name) to express retention / suballocation or |
|
Primiano Tucci (use gerrit)
2015/06/08 09:39:16
s/TODO_method_name/AddOwnershipEdge/
ssid
2015/06/08 14:29:19
Done.
|
| + // cross process sharing. See crbug.com/492102 for design docs. |
| + // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are |
| + // expected to have the same guid. Always returns WebMemoryAllocatorDumpGuid |
| + // with IntType. |
| + const WebMemoryAllocatorDumpGuid& guid() const |
| + { |
| + BLINK_ASSERT(m_guid.guidInt); |
|
Primiano Tucci (use gerrit)
2015/06/08 09:39:16
This should be just a virtual and the chrome layer
|
| + return m_guid; |
| + } |
| + |
| +protected: |
| + WebMemoryAllocatorDumpGuid m_guid; |
|
Primiano Tucci (use gerrit)
2015/06/08 09:39:16
You don't need this.
Just pass the guid you get in
|
| }; |
| } // namespace blink |