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

Unified Diff: cc/raster/staging_buffer_pool.cc

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: Implement buckets Created 3 years, 11 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: cc/raster/staging_buffer_pool.cc
diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc
index ef78e4d317e60f4a8f3b3b5ca1298a05446fb60d..5a925b14286aaf58b0c17e02661a14121b08afe7 100644
--- a/cc/raster/staging_buffer_pool.cc
+++ b/cc/raster/staging_buffer_pool.cc
@@ -8,6 +8,7 @@
#include "base/memory/memory_coordinator_client_registry.h"
#include "base/memory/ptr_util.h"
+#include "base/memory/shared_memory_tracker.h"
#include "base/strings/stringprintf.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/memory_dump_manager.h"
@@ -122,6 +123,11 @@ void StagingBuffer::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
// the tracing UI will account the effective size of the buffer to the child.
const int kImportance = 2;
pmd->AddOwnershipEdge(buffer_dump->guid(), shared_buffer_guid, kImportance);
+
+ base::SharedMemoryHandle shared_memory_handle =
+ gpu_memory_buffer->GetHandle().handle;
+ base::SharedMemoryTracker::AddOwnershipEdgeToSharedGlobalDump(
+ pmd, shared_buffer_guid, shared_memory_handle, buffer_size_in_bytes);
}
StagingBufferPool::StagingBufferPool(base::SequencedTaskRunner* task_runner,

Powered by Google App Engine
This is Rietveld 408576698