OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/transfer_buffer_manager.h" | 5 #include "gpu/command_buffer/service/transfer_buffer_manager.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( | 42 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( |
43 this); | 43 this); |
44 } | 44 } |
45 | 45 |
46 bool TransferBufferManager::Initialize() { | 46 bool TransferBufferManager::Initialize() { |
47 // When created from InProcessCommandBuffer, we won't have a |memory_tracker_| | 47 // When created from InProcessCommandBuffer, we won't have a |memory_tracker_| |
48 // so don't register a dump provider. | 48 // so don't register a dump provider. |
49 if (memory_tracker_) { | 49 if (memory_tracker_) { |
50 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 50 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
51 this, base::ThreadTaskRunnerHandle::Get()); | 51 this, "gpu::TransferBufferManager", |
| 52 base::ThreadTaskRunnerHandle::Get()); |
52 } | 53 } |
53 return true; | 54 return true; |
54 } | 55 } |
55 | 56 |
56 bool TransferBufferManager::RegisterTransferBuffer( | 57 bool TransferBufferManager::RegisterTransferBuffer( |
57 int32 id, | 58 int32 id, |
58 scoped_ptr<BufferBacking> buffer_backing) { | 59 scoped_ptr<BufferBacking> buffer_backing) { |
59 if (id <= 0) { | 60 if (id <= 0) { |
60 DVLOG(0) << "Cannot register transfer buffer with non-positive ID."; | 61 DVLOG(0) << "Cannot register transfer buffer with non-positive ID."; |
61 return false; | 62 return false; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 auto guid = | 123 auto guid = |
123 GetBufferGUIDForTracing(memory_tracker_->ClientTracingId(), buffer_id); | 124 GetBufferGUIDForTracing(memory_tracker_->ClientTracingId(), buffer_id); |
124 pmd->CreateSharedGlobalAllocatorDump(guid); | 125 pmd->CreateSharedGlobalAllocatorDump(guid); |
125 pmd->AddOwnershipEdge(dump->guid(), guid); | 126 pmd->AddOwnershipEdge(dump->guid(), guid); |
126 } | 127 } |
127 | 128 |
128 return true; | 129 return true; |
129 } | 130 } |
130 | 131 |
131 } // namespace gpu | 132 } // namespace gpu |
132 | |
OLD | NEW |