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

Unified Diff: base/trace_event/memory_allocator_dump.h

Issue 1180693002: Update from https://crrev.com/333737 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased 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 | « base/trace_event/malloc_dump_provider.cc ('k') | base/trace_event/memory_allocator_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_allocator_dump.h
diff --git a/base/trace_event/memory_allocator_dump.h b/base/trace_event/memory_allocator_dump.h
index 1bb27f952e1a0be5202980efa94b3dbb90fbaa1b..9a151a6f9c5e2df0960b1b56745ab1914bd539d8 100644
--- a/base/trace_event/memory_allocator_dump.h
+++ b/base/trace_event/memory_allocator_dump.h
@@ -8,6 +8,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/logging.h"
+#include "base/trace_event/memory_allocator_dump_guid.h"
#include "base/values.h"
namespace base {
@@ -22,9 +23,15 @@ class BASE_EXPORT MemoryAllocatorDump {
public:
// MemoryAllocatorDump is owned by ProcessMemoryDump.
MemoryAllocatorDump(const std::string& absolute_name,
+ ProcessMemoryDump* process_memory_dump,
+ const MemoryAllocatorDumpGuid& guid);
+ MemoryAllocatorDump(const std::string& absolute_name,
ProcessMemoryDump* process_memory_dump);
~MemoryAllocatorDump();
+ // Standard attribute name to model allocated space.
+ static const char kNameSize[];
+
// Standard attribute name to model total space requested by the allocator
// (e.g., amount of pages requested to the system).
static const char kNameOuterSize[];
@@ -56,6 +63,7 @@ class BASE_EXPORT MemoryAllocatorDump {
// Helper setter for scalar attributes.
void AddScalar(const std::string& name, const char* units, uint64 value);
+ void AddScalarF(const std::string& name, const char* units, double value);
void AddString(const std::string& name,
const char* units,
const std::string& value);
@@ -68,10 +76,19 @@ class BASE_EXPORT MemoryAllocatorDump {
return process_memory_dump_;
}
+ // |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
+ // 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 MemoryAllocatorDumpGuid& guid() const { return guid_; }
+
private:
const std::string absolute_name_;
ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this).
DictionaryValue attributes_;
+ MemoryAllocatorDumpGuid guid_;
DISALLOW_COPY_AND_ASSIGN(MemoryAllocatorDump);
};
« no previous file with comments | « base/trace_event/malloc_dump_provider.cc ('k') | base/trace_event/memory_allocator_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698