Index: media/video/gpu_memory_buffer_video_frame_pool.cc |
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.cc b/media/video/gpu_memory_buffer_video_frame_pool.cc |
index 04021f520ca85059efc44e044d7b6e6da6f32839..cc2d05a9a032b6137785d5ef7a163be247106f9e 100644 |
--- a/media/video/gpu_memory_buffer_video_frame_pool.cc |
+++ b/media/video/gpu_memory_buffer_video_frame_pool.cc |
@@ -19,6 +19,8 @@ |
#include "base/containers/stack_container.h" |
#include "base/location.h" |
#include "base/macros.h" |
+#include "base/memory/shared_memory.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/strings/stringprintf.h" |
#include "base/trace_event/memory_dump_manager.h" |
#include "base/trace_event/memory_dump_provider.h" |
@@ -29,7 +31,6 @@ |
#include "media/renderers/gpu_video_accelerator_factories.h" |
#include "third_party/libyuv/include/libyuv.h" |
#include "ui/gfx/buffer_format_util.h" |
-#include "ui/gfx/gpu_memory_buffer_tracing.h" |
#include "ui/gl/trace_util.h" |
namespace media { |
@@ -472,11 +473,19 @@ bool GpuMemoryBufferVideoFramePool::PoolImpl::OnMemoryDump( |
dump->AddScalar("free_size", |
base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
frame_resources->IsInUse() ? 0 : buffer_size_in_bytes); |
- auto shared_buffer_guid = |
- plane_resource.gpu_memory_buffer->GetGUIDForTracing( |
- tracing_process_id); |
- pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); |
- pmd->AddOwnershipEdge(dump->guid(), shared_buffer_guid, kImportance); |
+ |
+ base::SharedMemory* shared_memory = |
+ plane_resource.gpu_memory_buffer->GetSharedMemory(); |
+ if (shared_memory) { |
+ base::SharedMemoryTracker::AddOwnershipEdges(pmd, dump->guid(), |
+ *shared_memory); |
+ } else { |
+ auto shared_buffer_guid = |
+ plane_resource.gpu_memory_buffer->GetGUIDForTracing( |
+ tracing_process_id); |
+ pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); |
+ pmd->AddOwnershipEdge(dump->guid(), shared_buffer_guid, kImportance); |
+ } |
} |
} |
} |