Chromium Code Reviews| Index: content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc |
| diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc |
| index 9db36962d20ed24423a55646490399a8aef00764..3b8cafe3c5bd55708d87d4a510c40dae5cdab163 100644 |
| --- a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc |
| +++ b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc |
| @@ -163,6 +163,28 @@ bool GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat( |
| return false; |
| } |
| +// static |
| +void GpuMemoryBufferImplSharedMemory::DumpGenericSharedMemory( |
| + base::trace_event::ProcessMemoryDump* pmd, |
| + uint64_t client_tracing_process_id, |
| + gfx::GpuMemoryBufferId id) { |
| + // Establish the link between a GpuMemoryBufferId and any |
| + // GenericSharedMemoryId. |
| + base::trace_event::MemoryAllocatorDumpGuid gpu_memory_buffer_guid = |
| + gfx::GetGpuMemoryBufferGUIDForTracing(client_tracing_process_id, id); |
| + base::trace_event::MemoryAllocatorDumpGuid generic_shared_memory_guid = |
| + base::GetGenericSharedMemoryGUIDForTracing(client_tracing_process_id, id); |
| + pmd->CreateSharedGlobalAllocatorDump(generic_shared_memory_guid); |
| + |
| + // The link from the shared memory guid to the gpu memory buffer guid is |
| + // higher than the link from the shared memory guid to the various low |
| + // level memory dumps. This ensures that memory is tracked on the gpu |
| + // memory buffer. |
| + const int kImportance = 2; |
| + pmd->AddOwnershipEdge(gpu_memory_buffer_guid, generic_shared_memory_guid, |
| + kImportance); |
|
reveman
2015/08/06 19:19:36
I think the edge and the gpu_memory_buffer_guid sh
ericrk
2015/08/06 22:05:19
Acknowledged.
|
| +} |
| + |
| bool GpuMemoryBufferImplSharedMemory::Map(void** data) { |
| DCHECK(!mapped_); |
| size_t offset = 0; |