Index: base/trace_event/heap_profiler_serialization_state.cc |
diff --git a/base/trace_event/heap_profiler_serialization_state.cc b/base/trace_event/heap_profiler_serialization_state.cc |
index d332d43c4710cfb08e75194b3333134ec84e507e..c7784eeb57b5002b07241516df3ff8faf959a0f7 100644 |
--- a/base/trace_event/heap_profiler_serialization_state.cc |
+++ b/base/trace_event/heap_profiler_serialization_state.cc |
@@ -4,6 +4,11 @@ |
#include "base/trace_event/heap_profiler_serialization_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 @@ HeapProfilerSerializationState::HeapProfilerSerializationState() |
: heap_profiler_breakdown_threshold_bytes_(0) {} |
HeapProfilerSerializationState::~HeapProfilerSerializationState() {} |
-void HeapProfilerSerializationState::SetStackFrameDeduplicator( |
- std::unique_ptr<StackFrameDeduplicator> stack_frame_deduplicator) { |
- DCHECK(!stack_frame_deduplicator_); |
- stack_frame_deduplicator_ = std::move(stack_frame_deduplicator); |
-} |
- |
-void HeapProfilerSerializationState::SetTypeNameDeduplicator( |
- std::unique_ptr<TypeNameDeduplicator> type_name_deduplicator) { |
- DCHECK(!type_name_deduplicator_); |
- type_name_deduplicator_ = std::move(type_name_deduplicator); |
+void HeapProfilerSerializationState::CreateDeduplicators() { |
+ string_deduplicator_ = base::MakeUnique<StringDeduplicator>(); |
+ stack_frame_deduplicator_ = |
+ base::MakeUnique<StackFrameDeduplicator>(string_deduplicator_.get()); |
+ type_name_deduplicator_ = |
+ base::MakeUnique<TypeNameDeduplicator>(string_deduplicator_.get()); |
} |
} // namespace trace_event |