| Index: base/trace_event/memory_dump_manager.cc
|
| diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
|
| index 3e7f7a1e67047486b5322135eaa2879553b69b84..6b4e4cfad014274ea5a2eb254c62ab2b90cda173 100644
|
| --- a/base/trace_event/memory_dump_manager.cc
|
| +++ b/base/trace_event/memory_dump_manager.cc
|
| @@ -29,9 +29,7 @@
|
| #include "base/trace_event/heap_profiler.h"
|
| #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
|
| #include "base/trace_event/heap_profiler_event_filter.h"
|
| -#include "base/trace_event/heap_profiler_serialization_state.h"
|
| -#include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
|
| -#include "base/trace_event/heap_profiler_type_name_deduplicator.h"
|
| +#include "base/trace_event/heap_profiler_event_writer.h"
|
| #include "base/trace_event/malloc_dump_provider.h"
|
| #include "base/trace_event/memory_dump_provider.h"
|
| #include "base/trace_event/memory_dump_scheduler.h"
|
| @@ -83,37 +81,6 @@ void FillOsDumpFromProcessMemoryDump(
|
| }
|
| }
|
|
|
| -// Proxy class which wraps a ConvertableToTraceFormat owned by the
|
| -// |heap_profiler_serialization_state| into a proxy object that can be added to
|
| -// the trace event log. This is to solve the problem that the
|
| -// HeapProfilerSerializationState is refcounted but the tracing subsystem wants
|
| -// a std::unique_ptr<ConvertableToTraceFormat>.
|
| -template <typename T>
|
| -struct SessionStateConvertableProxy : public ConvertableToTraceFormat {
|
| - using GetterFunctPtr = T* (HeapProfilerSerializationState::*)() const;
|
| -
|
| - SessionStateConvertableProxy(scoped_refptr<HeapProfilerSerializationState>
|
| - heap_profiler_serialization_state,
|
| - GetterFunctPtr getter_function)
|
| - : heap_profiler_serialization_state(heap_profiler_serialization_state),
|
| - getter_function(getter_function) {}
|
| -
|
| - void AppendAsTraceFormat(std::string* out) const override {
|
| - return (heap_profiler_serialization_state.get()->*getter_function)()
|
| - ->AppendAsTraceFormat(out);
|
| - }
|
| -
|
| - void EstimateTraceMemoryOverhead(
|
| - TraceEventMemoryOverhead* overhead) override {
|
| - return (heap_profiler_serialization_state.get()->*getter_function)()
|
| - ->EstimateTraceMemoryOverhead(overhead);
|
| - }
|
| -
|
| - scoped_refptr<HeapProfilerSerializationState>
|
| - heap_profiler_serialization_state;
|
| - GetterFunctPtr const getter_function;
|
| -};
|
| -
|
| void OnPeakDetected(MemoryDumpLevelOfDetail level_of_detail) {
|
| MemoryDumpManager::GetInstance()->RequestGlobalDump(
|
| MemoryDumpType::PEAK_MEMORY_USAGE, level_of_detail);
|
| @@ -803,28 +770,14 @@ void MemoryDumpManager::SetupForTracing(
|
| ->set_heap_profiler_breakdown_threshold_bytes(
|
| memory_dump_config.heap_profiler_options.breakdown_threshold_bytes);
|
| if (heap_profiling_enabled_) {
|
| - // If heap profiling is enabled, the stack frame deduplicator and type name
|
| - // deduplicator will be in use. Add a metadata events to write the frames
|
| - // and type IDs.
|
| - heap_profiler_serialization_state->SetStackFrameDeduplicator(
|
| - WrapUnique(new StackFrameDeduplicator));
|
| -
|
| - heap_profiler_serialization_state->SetTypeNameDeduplicator(
|
| - WrapUnique(new TypeNameDeduplicator));
|
| -
|
| - TRACE_EVENT_API_ADD_METADATA_EVENT(
|
| - TraceLog::GetCategoryGroupEnabled("__metadata"), "stackFrames",
|
| - "stackFrames",
|
| - MakeUnique<SessionStateConvertableProxy<StackFrameDeduplicator>>(
|
| - heap_profiler_serialization_state,
|
| - &HeapProfilerSerializationState::stack_frame_deduplicator));
|
| -
|
| - TRACE_EVENT_API_ADD_METADATA_EVENT(
|
| - TraceLog::GetCategoryGroupEnabled("__metadata"), "typeNames",
|
| - "typeNames",
|
| - MakeUnique<SessionStateConvertableProxy<TypeNameDeduplicator>>(
|
| - heap_profiler_serialization_state,
|
| - &HeapProfilerSerializationState::type_name_deduplicator));
|
| + heap_profiler_serialization_state->CreateDeduplicators();
|
| + // TODO(dskiba): support continuous mode (crbug.com/701052)
|
| + DLOG_IF(
|
| + ERROR,
|
| + TraceLog::GetInstance()->GetCurrentTraceConfig().GetTraceRecordMode() ==
|
| + RECORD_CONTINUOUSLY)
|
| + << "Heap profile format is incremental and doesn't yet fully support "
|
| + << "continuous mode.";
|
| }
|
|
|
| AutoLock lock(lock_);
|
|
|