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

Side by Side Diff: cc/resources/resource_pool.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
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/resources/resource_pool.h" 5 #include "cc/resources/resource_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 max_resource_count_(0), 62 max_resource_count_(0),
63 in_use_memory_usage_bytes_(0), 63 in_use_memory_usage_bytes_(0),
64 total_memory_usage_bytes_(0), 64 total_memory_usage_bytes_(0),
65 total_resource_count_(0), 65 total_resource_count_(0),
66 task_runner_(task_runner), 66 task_runner_(task_runner),
67 evict_expired_resources_pending_(false), 67 evict_expired_resources_pending_(false),
68 resource_expiration_delay_( 68 resource_expiration_delay_(
69 base::TimeDelta::FromMilliseconds(kResourceExpirationDelayMs)), 69 base::TimeDelta::FromMilliseconds(kResourceExpirationDelayMs)),
70 weak_ptr_factory_(this) { 70 weak_ptr_factory_(this) {
71 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 71 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
72 this, task_runner_.get()); 72 this, "cc::ResourcePool", task_runner_.get());
73 } 73 }
74 74
75 ResourcePool::~ResourcePool() { 75 ResourcePool::~ResourcePool() {
76 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider( 76 base::trace_event::MemoryDumpManager::GetInstance()->UnregisterDumpProvider(
77 this); 77 this);
78 78
79 DCHECK_EQ(0u, in_use_resources_.size()); 79 DCHECK_EQ(0u, in_use_resources_.size());
80 80
81 while (!busy_resources_.empty()) { 81 while (!busy_resources_.empty()) {
82 DidFinishUsingResource(busy_resources_.take_front()); 82 DidFinishUsingResource(busy_resources_.take_front());
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 for (const auto& resource : busy_resources_) { 300 for (const auto& resource : busy_resources_) {
301 resource->OnMemoryDump(pmd, resource_provider_, false /* is_free */); 301 resource->OnMemoryDump(pmd, resource_provider_, false /* is_free */);
302 } 302 }
303 for (const auto& entry : in_use_resources_) { 303 for (const auto& entry : in_use_resources_) {
304 entry.second->OnMemoryDump(pmd, resource_provider_, false /* is_free */); 304 entry.second->OnMemoryDump(pmd, resource_provider_, false /* is_free */);
305 } 305 }
306 return true; 306 return true;
307 } 307 }
308 308
309 } // namespace cc 309 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/one_copy_tile_task_worker_pool.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698