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

Unified Diff: content/common/host_shared_bitmap_manager.cc

Issue 1256613002: Add tracing for GL texture objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browser_process_id
Patch Set: remove unneeded explicit Created 5 years, 5 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/host_shared_bitmap_manager.cc
diff --git a/content/common/host_shared_bitmap_manager.cc b/content/common/host_shared_bitmap_manager.cc
index 07241f2a2ce2f05bb0f6fb63909c50180b253ea9..c6c72e082e623b2afe2d5596c1588ab243ebf25f 100644
--- a/content/common/host_shared_bitmap_manager.cc
+++ b/content/common/host_shared_bitmap_manager.cc
@@ -52,8 +52,6 @@ class HostSharedBitmap : public cc::SharedBitmap {
HostSharedBitmapManager* manager_;
};
-const char kMemoryAllocatorName[] = "sharedbitmap";
-
} // namespace
base::LazyInstance<HostSharedBitmapManager> g_shared_memory_manager =
@@ -155,16 +153,23 @@ bool HostSharedBitmapManager::OnMemoryDump(
base::AutoLock lock(lock_);
for (const auto& bitmap : handle_map_) {
- base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
- base::StringPrintf("%s/%s", kMemoryAllocatorName,
- base::HexEncode(bitmap.first.name,
- sizeof(bitmap.first.name)).c_str()));
+ base::trace_event::MemoryAllocatorDump* dump =
+ pmd->CreateAllocatorDump(base::StringPrintf(
+ "sharedbitmap/%s",
+ base::HexEncode(bitmap.first.name, sizeof(bitmap.first.name))
+ .c_str()));
if (!dump)
return false;
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
bitmap.second->buffer_size);
+
+ // Generate a global GUID used to share this allocation with renderer
+ // processes.
+ auto guid = cc::GetSharedBitmapGUIDForTracing(bitmap.first);
+ pmd->CreateSharedGlobalAllocatorDump(guid);
+ pmd->AddOwnershipEdge(dump->guid(), guid);
}
return true;

Powered by Google App Engine
This is Rietveld 408576698