| Index: ui/gl/gl_image_shared_memory.cc
|
| diff --git a/ui/gl/gl_image_shared_memory.cc b/ui/gl/gl_image_shared_memory.cc
|
| index 469a6f98d1c242a89e71792eb2c240ceb3d318c8..372790996f5f7509b35d56d8087f6ac8b7189015 100644
|
| --- a/ui/gl/gl_image_shared_memory.cc
|
| +++ b/ui/gl/gl_image_shared_memory.cc
|
| @@ -33,8 +33,7 @@ bool SizeInBytes(const gfx::Size& size,
|
|
|
| GLImageSharedMemory::GLImageSharedMemory(const gfx::Size& size,
|
| unsigned internalformat)
|
| - : GLImageMemory(size, internalformat) {
|
| -}
|
| + : GLImageMemory(size, internalformat) {}
|
|
|
| GLImageSharedMemory::~GLImageSharedMemory() {
|
| DCHECK(!shared_memory_);
|
| @@ -73,6 +72,7 @@ bool GLImageSharedMemory::Initialize(const gfx::GpuMemoryBufferHandle& handle,
|
|
|
| DCHECK(!shared_memory_);
|
| shared_memory_ = duped_shared_memory.Pass();
|
| + shared_memory_id_ = handle.id;
|
| return true;
|
| }
|
|
|
| @@ -81,4 +81,22 @@ void GLImageSharedMemory::Destroy(bool have_context) {
|
| shared_memory_.reset();
|
| }
|
|
|
| +void GLImageSharedMemory::DumpMemory(base::trace_event::ProcessMemoryDump* pmd,
|
| + uint64_t process_tracing_id,
|
| + const std::string& dump_name) {
|
| + size_t size_bytes;
|
| + SizeInBytes(GetSize(), format(), &size_bytes);
|
| +
|
| + base::trace_event::MemoryAllocatorDump* dump =
|
| + pmd->CreateAllocatorDump(dump_name);
|
| + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes,
|
| + static_cast<uint64_t>(size_bytes));
|
| +
|
| + auto guid = base::trace_event::GetGenericSharedMemoryGUIDForTracing(
|
| + process_tracing_id, shared_memory_id_);
|
| + pmd->CreateSharedGlobalAllocatorDump(guid);
|
| + pmd->AddOwnershipEdge(dump->guid(), guid);
|
| +}
|
| +
|
| } // namespace gfx
|
|
|