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

Unified Diff: base/trace_event/memory_allocator_dump.h

Issue 2760253005: memory-infra: Fill the memory dump callback result (1/2) (Closed)
Patch Set: fix nits Created 3 years, 9 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 | 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 c781f071bba40ab08c25dcb18ec1f59fc1b1fc12..99ff114e5c78a28dedb2667e7c3a1b95a1726f82 100644
--- a/base/trace_event/memory_allocator_dump.h
+++ b/base/trace_event/memory_allocator_dump.h
@@ -11,6 +11,7 @@
#include <string>
#include "base/base_export.h"
+#include "base/gtest_prod_util.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/trace_event/memory_allocator_dump_guid.h"
@@ -85,11 +86,21 @@ class BASE_EXPORT MemoryAllocatorDump {
TracedValue* attributes_for_testing() const { return attributes_.get(); }
private:
+ // TODO(hjd): Transitional until we send the full PMD. See crbug.com/704203
+ friend class MemoryDumpManager;
+ FRIEND_TEST_ALL_PREFIXES(MemoryAllocatorDumpTest, GetSize);
+
+ // Get the size for this dump.
+ // The size is the value set with AddScalar(kNameSize, kUnitsBytes, size);
+ // TODO(hjd): Transitional until we send the full PMD. See crbug.com/704203
+ uint64_t GetSize() const { return size_; };
+
const std::string absolute_name_;
ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this).
std::unique_ptr<TracedValue> attributes_;
MemoryAllocatorDumpGuid guid_;
int flags_; // See enum Flags.
+ uint64_t size_;
// A local buffer for Sprintf conversion on fastpath. Avoids allocating
// temporary strings on each AddScalar() call.
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698