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

Unified Diff: base/trace_event/memory_dump_session_state.cc

Issue 2650863003: [tracing] Switch to new heap dump format. (Closed)
Patch Set: Address comments (heaps_v2) 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 | « base/trace_event/memory_dump_session_state.h ('k') | base/trace_event/process_memory_dump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_session_state.cc
diff --git a/base/trace_event/memory_dump_session_state.cc b/base/trace_event/memory_dump_session_state.cc
index d26b82a5b74c65f774403eb7fae1cc88ba556f7f..3b6cb0f4f57c4e411393f2b07e3d79a2043a930d 100644
--- a/base/trace_event/memory_dump_session_state.cc
+++ b/base/trace_event/memory_dump_session_state.cc
@@ -4,6 +4,11 @@
#include "base/trace_event/memory_dump_session_state.h"
+#include "base/memory/ptr_util.h"
+#include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
+#include "base/trace_event/heap_profiler_string_deduplicator.h"
+#include "base/trace_event/heap_profiler_type_name_deduplicator.h"
+
namespace base {
namespace trace_event {
@@ -11,16 +16,12 @@ MemoryDumpSessionState::MemoryDumpSessionState()
: heap_profiler_breakdown_threshold_bytes_(0) {}
MemoryDumpSessionState::~MemoryDumpSessionState() {}
-void MemoryDumpSessionState::SetStackFrameDeduplicator(
- std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator) {
- DCHECK(!stack_frame_deduplicator_);
- stack_frame_deduplicator_ = std::move(stack_frame_deduplicator);
-}
-
-void MemoryDumpSessionState::SetTypeNameDeduplicator(
- std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator) {
- DCHECK(!type_name_deduplicator_);
- type_name_deduplicator_ = std::move(type_name_deduplicator);
+void MemoryDumpSessionState::CreateDeduplicators() {
+ string_deduplicator_ = base::MakeUnique<StringDeduplicator>();
+ stack_frame_deduplicator_ =
+ base::MakeUnique<StackFrameDeduplicator>(string_deduplicator_.get());
+ type_name_deduplicator_ =
+ base::MakeUnique<TypeNameDeduplicator>(string_deduplicator_.get());
}
void MemoryDumpSessionState::SetAllowedDumpModes(
« no previous file with comments | « base/trace_event/memory_dump_session_state.h ('k') | base/trace_event/process_memory_dump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698