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

Side by Side Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.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 unified diff | Download patch
OLDNEW
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
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 is allocated in SharedMemory. Get
196 // shared memory handle of that and call
197 // base::SharedMemoryDumpProvider::AddOwnershipEdgeToSharedGlobalDump here
195 } 198 }
196 } 199 }
197 200
198 return true; 201 return true;
199 } 202 }
200 203
201 void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer( 204 void BrowserGpuMemoryBufferManager::ChildProcessDeletedGpuMemoryBuffer(
202 gfx::GpuMemoryBufferId id, 205 gfx::GpuMemoryBufferId id,
203 int child_client_id, 206 int child_client_id,
204 const gpu::SyncToken& sync_token) { 207 const gpu::SyncToken& sync_token) {
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 format(format), 510 format(format),
508 usage(usage), 511 usage(usage),
509 gpu_host_id(gpu_host_id) {} 512 gpu_host_id(gpu_host_id) {}
510 513
511 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = 514 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) =
512 default; 515 default;
513 516
514 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} 517 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {}
515 518
516 } // namespace content 519 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698