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

Side by Side Diff: gpu/command_buffer/client/mapped_memory.cc

Issue 1406213005: [tracing] Add names to memory-infra dumpers for debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memory-infra-runtime
Patch Set: Rebase + fix android Created 5 years, 1 month 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/client/mapped_memory.h" 5 #include "gpu/command_buffer/client/mapped_memory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
(...skipping 29 matching lines...) Expand all
40 helper_(helper), 40 helper_(helper),
41 allocated_memory_(0), 41 allocated_memory_(0),
42 max_free_bytes_(unused_memory_reclaim_limit), 42 max_free_bytes_(unused_memory_reclaim_limit),
43 max_allocated_bytes_(kNoLimit), 43 max_allocated_bytes_(kNoLimit),
44 tracing_id_(g_next_mapped_memory_manager_tracing_id.GetNext()) { 44 tracing_id_(g_next_mapped_memory_manager_tracing_id.GetNext()) {
45 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). 45 // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview).
46 // Don't register a dump provider in these cases. 46 // Don't register a dump provider in these cases.
47 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156 47 // TODO(ericrk): Get this working in Android Webview. crbug.com/517156
48 if (base::ThreadTaskRunnerHandle::IsSet()) { 48 if (base::ThreadTaskRunnerHandle::IsSet()) {
49 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 49 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
50 this, base::ThreadTaskRunnerHandle::Get()); 50 this, "gpu::MappedMemoryManager", base::ThreadTaskRunnerHandle::Get());
51 } 51 }
52 } 52 }
53 53
54 MappedMemoryManager::~MappedMemoryManager() { 54 MappedMemoryManager::~MappedMemoryManager() {
55 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 55 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
56 this); 56 this);
57 57
58 CommandBuffer* cmd_buf = helper_->command_buffer(); 58 CommandBuffer* cmd_buf = helper_->command_buffer();
59 for (MemoryChunkVector::iterator iter = chunks_.begin(); 59 for (MemoryChunkVector::iterator iter = chunks_.begin();
60 iter != chunks_.end(); ++iter) { 60 iter != chunks_.end(); ++iter) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void ScopedMappedMemoryPtr::Reset(uint32_t new_size) { 212 void ScopedMappedMemoryPtr::Reset(uint32_t new_size) {
213 Release(); 213 Release();
214 214
215 if (new_size) { 215 if (new_size) {
216 buffer_ = mapped_memory_manager_->Alloc(new_size, &shm_id_, &shm_offset_); 216 buffer_ = mapped_memory_manager_->Alloc(new_size, &shm_id_, &shm_offset_);
217 size_ = buffer_ ? new_size : 0; 217 size_ = buffer_ ? new_size : 0;
218 } 218 }
219 } 219 }
220 220
221 } // namespace gpu 221 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.cc ('k') | gpu/command_buffer/service/buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698