| Index: gpu/command_buffer/client/gles2_implementation.cc
|
| diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
|
| index 75d616a9b2eb44f41dbaf75a8fb5077a4b72f307..dbfc3beedd335a59753d4bbcfced1e88b0da860a 100644
|
| --- a/gpu/command_buffer/client/gles2_implementation.cc
|
| +++ b/gpu/command_buffer/client/gles2_implementation.cc
|
| @@ -19,6 +19,7 @@
|
| #include <string>
|
| #include "base/atomic_sequence_num.h"
|
| #include "base/compiler_specific.h"
|
| +#include "base/memory/shared_memory_tracker.h"
|
| #include "base/numerics/safe_math.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/stringprintf.h"
|
| @@ -459,11 +460,16 @@ bool GLES2Implementation::OnMemoryDump(
|
| if (args.level_of_detail != MemoryDumpLevelOfDetail::BACKGROUND) {
|
| dump->AddScalar("free_size", MemoryAllocatorDump::kUnitsBytes,
|
| transfer_buffer_->GetFreeSize());
|
| - auto guid = GetBufferGUIDForTracing(tracing_process_id,
|
| - transfer_buffer_->GetShmId());
|
| - const int kImportance = 2;
|
| - pmd->CreateSharedGlobalAllocatorDump(guid);
|
| - pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
|
| + auto shared_memory = transfer_buffer_->GetSharedMemory();
|
| + if (shared_memory) {
|
| + auto guid = GetBufferGUIDForTracing(tracing_process_id,
|
| + transfer_buffer_->GetShmId());
|
| + const int kImportance = 2;
|
| + pmd->CreateSharedGlobalAllocatorDump(guid);
|
| + pmd->AddOwnershipEdge(dump->guid(), guid, kImportance);
|
| + base::SharedMemoryTracker::AddOwnershipEdgeToSharedGlobalDump(pmd, guid,
|
| + shared_memory->handle(), shared_memory->mapped_size());
|
| + }
|
| }
|
|
|
| return true;
|
|
|