| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // double-count them in tracing. If, instead, no other process will emit a | 185 // double-count them in tracing. If, instead, no other process will emit a |
| 186 // dump with the same guid, the segment will be accounted to the browser. | 186 // dump with the same guid, the segment will be accounted to the browser. |
| 187 uint64_t client_tracing_process_id = | 187 uint64_t client_tracing_process_id = |
| 188 ClientIdToTracingProcessId(client_id); | 188 ClientIdToTracingProcessId(client_id); |
| 189 | 189 |
| 190 base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid = | 190 base::trace_event::MemoryAllocatorDumpGuid shared_buffer_guid = |
| 191 gfx::GetGpuMemoryBufferGUIDForTracing(client_tracing_process_id, | 191 gfx::GetGpuMemoryBufferGUIDForTracing(client_tracing_process_id, |
| 192 buffer_id); | 192 buffer_id); |
| 193 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); | 193 pmd->CreateSharedGlobalAllocatorDump(shared_buffer_guid); |
| 194 pmd->AddOwnershipEdge(dump->guid(), shared_buffer_guid); | 194 pmd->AddOwnershipEdge(dump->guid(), shared_buffer_guid); |
| 195 // TODO(hajimehoshi): GpuMemoryBuffer might be allocated in SharedMemory. |
| 196 // This depends on configuration (IsNativeGpuMemoryBufferConfiguration). |
| 197 // Get shared memory handle of that and call |
| 198 // base::SharedMemoryTracker::AddOwnershipEdges here when necessary. |
| 195 } | 199 } |
| 196 } | 200 } |
| 197 | 201 |
| 198 return true; | 202 return true; |
| 199 } | 203 } |
| 200 | 204 |
| 201 void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer( | 205 void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer( |
| 202 gfx::GpuMemoryBufferId id, | 206 gfx::GpuMemoryBufferId id, |
| 203 int child_client_id, | 207 int child_client_id, |
| 204 const gpu::SyncToken& sync_token) { | 208 const gpu::SyncToken& sync_token) { |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 format(format), | 511 format(format), |
| 508 usage(usage), | 512 usage(usage), |
| 509 gpu_host_id(gpu_host_id) {} | 513 gpu_host_id(gpu_host_id) {} |
| 510 | 514 |
| 511 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = | 515 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = |
| 512 default; | 516 default; |
| 513 | 517 |
| 514 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} | 518 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} |
| 515 | 519 |
| 516 } // namespace content | 520 } // namespace content |
| OLD | NEW |