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

Unified Diff: base/trace_event/process_memory_dump.h

Issue 1718173002: tracing: memory-infra cleanup post-C++11 + test coverage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@incwhatyouuse
Patch Set: Re petrcermak review 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
« no previous file with comments | « no previous file | base/trace_event/process_memory_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/process_memory_dump.h
diff --git a/base/trace_event/process_memory_dump.h b/base/trace_event/process_memory_dump.h
index adaf14f9074f33f985a2e87ea736b3a4f228cce3..e38451c4e3d9e747a2d329b21b20ef31afe70e12 100644
--- a/base/trace_event/process_memory_dump.h
+++ b/base/trace_event/process_memory_dump.h
@@ -7,11 +7,10 @@
#include <stddef.h>
+#include <unordered_map>
#include <vector>
#include "base/base_export.h"
-#include "base/containers/hash_tables.h"
-#include "base/containers/small_map.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h"
@@ -34,7 +33,6 @@
namespace base {
namespace trace_event {
-class ConvertableToTraceFormat;
class MemoryDumpManager;
class MemoryDumpSessionState;
class TracedValue;
@@ -53,10 +51,10 @@ class BASE_EXPORT ProcessMemoryDump {
// Maps allocator dumps absolute names (allocator_name/heap/subheap) to
// MemoryAllocatorDump instances.
using AllocatorDumpsMap =
- SmallMap<hash_map<std::string, MemoryAllocatorDump*>>;
+ std::unordered_map<std::string, scoped_ptr<MemoryAllocatorDump>>;
using HeapDumpsMap =
- SmallMap<hash_map<std::string, scoped_refptr<TracedValue>>>;
+ std::unordered_map<std::string, scoped_refptr<TracedValue>>;
#if defined(COUNT_RESIDENT_BYTES_SUPPORTED)
// Returns the total bytes resident for a virtual address range, with given
@@ -171,8 +169,11 @@ class BASE_EXPORT ProcessMemoryDump {
bool has_process_mmaps() const { return has_process_mmaps_; }
void set_has_process_mmaps() { has_process_mmaps_ = true; }
+ const HeapDumpsMap& heap_dumps() const { return heap_dumps_; }
+
private:
- void AddAllocatorDumpInternal(MemoryAllocatorDump* mad);
+ MemoryAllocatorDump* AddAllocatorDumpInternal(
+ scoped_ptr<MemoryAllocatorDump> mad);
ProcessMemoryTotals process_totals_;
bool has_process_totals_;
@@ -183,9 +184,6 @@ class BASE_EXPORT ProcessMemoryDump {
AllocatorDumpsMap allocator_dumps_;
HeapDumpsMap heap_dumps_;
- // ProcessMemoryDump handles the memory ownership of all its belongings.
- ScopedVector<MemoryAllocatorDump> allocator_dumps_storage_;
-
// State shared among all PMDs instances created in a given trace session.
scoped_refptr<MemoryDumpSessionState> session_state_;
« no previous file with comments | « no previous file | base/trace_event/process_memory_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698