Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc

Issue 1280513002: Add GenericSharedMemoryId and use w/ GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@trackpools
Patch Set: review Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698