Index: gpu/command_buffer/service/transfer_buffer_manager.cc |
diff --git a/gpu/command_buffer/service/transfer_buffer_manager.cc b/gpu/command_buffer/service/transfer_buffer_manager.cc |
index 02adf6a2265ff6858411cd82c5891db9ed4cc4bc..dfbd8ad41bf10ab5fd8edb73a343df3db98fb589 100644 |
--- a/gpu/command_buffer/service/transfer_buffer_manager.cc |
+++ b/gpu/command_buffer/service/transfer_buffer_manager.cc |
@@ -10,6 +10,7 @@ |
#include <memory> |
#include "base/logging.h" |
+#include "base/memory/shared_memory_tracker.h" |
#include "base/process/process_handle.h" |
#include "base/strings/stringprintf.h" |
#include "base/threading/thread_task_runner_handle.h" |
@@ -40,7 +41,7 @@ TransferBufferManager::TransferBufferManager( |
TransferBufferManager::~TransferBufferManager() { |
while (!registered_buffers_.empty()) { |
BufferMap::iterator it = registered_buffers_.begin(); |
- if (it->second->backing()->is_shared()) { |
+ if (it->second->backing()->shared_memory()) { |
DCHECK(shared_memory_bytes_allocated_ >= it->second->size()); |
shared_memory_bytes_allocated_ -= it->second->size(); |
} |
@@ -73,7 +74,7 @@ bool TransferBufferManager::RegisterTransferBuffer( |
DCHECK(!(reinterpret_cast<uintptr_t>(buffer->memory()) & |
(kCommandBufferEntrySize - 1))); |
- if (buffer->backing()->is_shared()) |
+ if (buffer->backing()->shared_memory()) |
shared_memory_bytes_allocated_ += buffer->size(); |
registered_buffers_[id] = buffer; |
@@ -87,7 +88,7 @@ void TransferBufferManager::DestroyTransferBuffer(int32_t id) { |
return; |
} |
- if (it->second->backing()->is_shared()) { |
+ if (it->second->backing()->shared_memory()) { |
DCHECK(shared_memory_bytes_allocated_ >= it->second->size()); |
shared_memory_bytes_allocated_ -= it->second->size(); |
} |
@@ -132,11 +133,11 @@ bool TransferBufferManager::OnMemoryDump( |
MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_name); |
dump->AddScalar(MemoryAllocatorDump::kNameSize, |
MemoryAllocatorDump::kUnitsBytes, buffer->size()); |
- if (buffer->backing()->is_shared()) { |
- auto guid = GetBufferGUIDForTracing(memory_tracker_->ClientTracingId(), |
- buffer_id); |
- pmd->CreateSharedGlobalAllocatorDump(guid); |
- pmd->AddOwnershipEdge(dump->guid(), guid); |
+ base::SharedMemory* shared_memory = |
+ buffer_entry.second->backing()->shared_memory(); |
+ if (shared_memory) { |
+ base::SharedMemoryTracker::AddOwnershipEdges(pmd, dump->guid(), |
+ *shared_memory); |
} |
} |