Chromium Code Reviews| Index: third_party/WebKit/public/platform/WebMemoryAllocatorDump.h |
| diff --git a/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h b/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h |
| index 6d1fefe8aaf79bbc26267a56619a4d5ce5e103de..15a8d7e413122438be4a14e24d9107e740811992 100644 |
| --- a/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h |
| +++ b/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h |
| @@ -8,14 +8,33 @@ |
| #include "WebCommon.h" |
| #include "WebString.h" |
| +// TODO(hajimehoshi): WTF_MAKE_NONCOPYABLE works only in Blink side so far. |
|
tkent
2016/02/29 02:34:04
Blink public classes don't have WTF_MAKE_NONCOPYAB
|
| +// This macro should be replaced with DISALLOW_COPY_AND_ASSIGN in the near |
| +// future. |
| +#if INSIDE_BLINK |
| +#include "wtf/Noncopyable.h" |
| +#endif |
| + |
| +#include <stdint.h> |
| + |
| +namespace base { |
| +namespace trace_event { |
| +class MemoryAllocatorDump; |
| +} // namespace base |
| +} // namespace trace_event |
| + |
| namespace blink { |
| typedef uint64_t WebMemoryAllocatorDumpGuid; |
| // A container which holds all the attributes of a particular dump for a given |
| // allocator. |
| class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump { |
| +#if INSIDE_BLINK |
| + WTF_MAKE_NONCOPYABLE(WebMemoryAllocatorDump); |
| +#endif |
| public: |
| - virtual ~WebMemoryAllocatorDump(); |
| + explicit WebMemoryAllocatorDump(base::trace_event::MemoryAllocatorDump*); |
| + ~WebMemoryAllocatorDump(); |
| // Adds a scalar attribute to the dump. |
| // Arguments: |
| @@ -25,9 +44,9 @@ public: |
| // about the semantics of the attribute. |
| // Currently supported values are "bytes" and "objects". |
| // value: the value of the attribute. |
| - virtual void addScalar(const char* name, const char* units, uint64_t value) {} |
| - virtual void addScalarF(const char* name, const char* units, double value) {} |
| - virtual void addString(const char* name, const char* units, const WebString& value) {} |
| + void addScalar(const char* name, const char* units, uint64_t value); |
| + void addScalarF(const char* name, const char* units, double value); |
| + void addString(const char* name, const char* units, const WebString& value); |
| // |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 |
| @@ -35,11 +54,11 @@ public: |
| // 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. |
| - virtual WebMemoryAllocatorDumpGuid guid() const |
| - { |
| - BLINK_ASSERT_NOT_REACHED(); |
| - return 0; |
| - } |
| + WebMemoryAllocatorDumpGuid guid() const; |
| + |
| +private: |
| + base::trace_event::MemoryAllocatorDump* m_memoryAllocatorDump; // Not owned. |
| + blink::WebMemoryAllocatorDumpGuid m_guid; |
| }; |
| } // namespace blink |