| Index: gpu/command_buffer/client/cmd_buffer_helper.cc
|
| diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
|
| index 7021fa399f4ccf7f887667ab73589d5753206b43..d45552c1118dfe2ffe93b4bcd6f876a1ae8a88d2 100644
|
| --- a/gpu/command_buffer/client/cmd_buffer_helper.cc
|
| +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
|
| @@ -10,6 +10,7 @@
|
|
|
| #include <algorithm>
|
| #include "base/logging.h"
|
| +#include "base/memory/shared_memory_tracker.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| @@ -364,10 +365,6 @@ bool CommandBufferHelper::OnMemoryDump(
|
| if (!HaveRingBuffer())
|
| return true;
|
|
|
| - const uint64_t tracing_process_id =
|
| - base::trace_event::MemoryDumpManager::GetInstance()
|
| - ->GetTracingProcessId();
|
| -
|
| MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(base::StringPrintf(
|
| "gpu/command_buffer_memory/buffer_%d", ring_buffer_id_));
|
| dump->AddScalar(MemoryAllocatorDump::kNameSize,
|
| @@ -377,10 +374,13 @@ bool CommandBufferHelper::OnMemoryDump(
|
| dump->AddScalar(
|
| "free_size", MemoryAllocatorDump::kUnitsBytes,
|
| GetTotalFreeEntriesNoWaiting() * sizeof(CommandBufferEntry));
|
| - auto guid = GetBufferGUIDForTracing(tracing_process_id, ring_buffer_id_);
|
| - const int kImportance = 2;
|
| - pmd->CreateSharedGlobalAllocatorDump(guid);
|
| - pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
|
| + auto* shared_memory = ring_buffer_->backing()->shared_memory();
|
| + if (shared_memory) {
|
| + // TODO: Importance
|
| + base::SharedMemoryTracker::AddOwnershipEdges(
|
| + pmd, dump->guid(), shared_memory->handle(),
|
| + shared_memory->mapped_size());
|
| + }
|
| }
|
|
|
| return true;
|
|
|