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

Unified Diff: public/platform/WebMemoryAllocatorDump.h

Issue 1159923006: [tracing] Expose AddOwnershipEdge and CreateAllocatorDump with guid to blink. (blink-side). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing comments. Created 5 years, 6 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
« no previous file with comments | « no previous file | public/platform/WebProcessMemoryDump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebMemoryAllocatorDump.h
diff --git a/public/platform/WebMemoryAllocatorDump.h b/public/platform/WebMemoryAllocatorDump.h
index 91136f19852769e96912b0a042f64cb9a48a40ed..fe1c09bfffee2438e5905fe377fd2d86ae952ae5 100644
--- a/public/platform/WebMemoryAllocatorDump.h
+++ b/public/platform/WebMemoryAllocatorDump.h
@@ -10,10 +10,45 @@
namespace blink {
+// Class which holds the guid of the WebMemoryAllocatorDump.
+class BLINK_PLATFORM_EXPORT WebMemoryAllocatorDumpGuid {
+public:
+ explicit WebMemoryAllocatorDumpGuid(const uint64_t guid)
+ : m_guidInt(guid)
+ {
+ }
+
+ explicit WebMemoryAllocatorDumpGuid(const WebString& guid)
+ : m_guidInt(HashGuidString(guid))
+ {
+ }
+
+private:
Primiano Tucci (use gerrit) 2015/06/09 20:51:34 I think this should be protected for sake of clari
+ virtual uint64_t HashGuidString(const WebString& guid) const
+ {
+ BLINK_ASSERT_NOT_REACHED();
+ return 0;
+ }
+
+ uint64_t m_guidInt;
+};
+
// 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
+ // changed in chromium side (ETA: 15/06/2015).
+ WebMemoryAllocatorDump()
+ : m_guid(WebMemoryAllocatorDumpGuid(0))
+ {
+ }
+
+ WebMemoryAllocatorDump(WebMemoryAllocatorDumpGuid guid)
+ : m_guid(guid)
+ {
+ }
+
virtual ~WebMemoryAllocatorDump();
// Adds a scalar attribute to the dump.
@@ -27,6 +62,20 @@ 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 AddOwnershipEdge) to express retention / suballocation or
+ // 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.
+ const WebMemoryAllocatorDumpGuid& guid() const
+ {
+ return m_guid;
+ }
+
+private:
+ WebMemoryAllocatorDumpGuid m_guid;
};
} // namespace blink
« no previous file with comments | « no previous file | public/platform/WebProcessMemoryDump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698