Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1356)

Unified Diff: third_party/WebKit/public/platform/WebMemoryAllocatorDump.h

Issue 1738843002: Refactoring: Unify WebMemoryAllocatorDump and WebMemoryAllocatorDumpImpl Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebasing) Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1908d057e6474215d73d68cfea74eb65a86ce1ed 100644
--- a/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h
+++ b/third_party/WebKit/public/platform/WebMemoryAllocatorDump.h
@@ -6,16 +6,26 @@
#define WebMemoryAllocatorDump_h
#include "WebCommon.h"
+#include "WebNonCopyable.h"
#include "WebString.h"
+#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 {
+class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDump : public WebNonCopyable {
public:
- virtual ~WebMemoryAllocatorDump();
+ explicit WebMemoryAllocatorDump(base::trace_event::MemoryAllocatorDump*);
+ ~WebMemoryAllocatorDump();
// Adds a scalar attribute to the dump.
// Arguments:
@@ -25,9 +35,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 +45,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

Powered by Google App Engine
This is Rietveld 408576698