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

Side by Side Diff: cc/resources/resource_pool.h

Issue 1420433009: cc: Keep most recently used resources at the front of resource queue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. 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 | « no previous file | cc/resources/resource_pool.cc » ('j') | cc/resources/resource_pool.cc » ('J')
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 #ifndef CC_RESOURCES_RESOURCE_POOL_H_ 5 #ifndef CC_RESOURCES_RESOURCE_POOL_H_
6 #define CC_RESOURCES_RESOURCE_POOL_H_ 6 #define CC_RESOURCES_RESOURCE_POOL_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/containers/scoped_ptr_map.h" 10 #include "base/containers/scoped_ptr_map.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 ResourceProvider* resource_provider_; 113 ResourceProvider* resource_provider_;
114 const GLenum target_; 114 const GLenum target_;
115 size_t max_memory_usage_bytes_; 115 size_t max_memory_usage_bytes_;
116 size_t max_resource_count_; 116 size_t max_resource_count_;
117 size_t in_use_memory_usage_bytes_; 117 size_t in_use_memory_usage_bytes_;
118 size_t total_memory_usage_bytes_; 118 size_t total_memory_usage_bytes_;
119 size_t total_resource_count_; 119 size_t total_resource_count_;
120 120
121 using ResourceDeque = ScopedPtrDeque<PoolResource>; 121 using ResourceDeque = ScopedPtrDeque<PoolResource>;
122 // Holds least recently used resources at the front of the queue.
reveman 2015/11/02 06:07:51 why don't we just revert this order and keep the l
prashant.n 2015/11/02 17:56:45 Should we do this or leave as it is? Do let me kno
reveman 2015/11/02 18:16:29 Unless I missing something, reverting the order is
122 ResourceDeque unused_resources_; 123 ResourceDeque unused_resources_;
123 ResourceDeque busy_resources_; 124 ResourceDeque busy_resources_;
124 125
125 using ResourceMap = base::ScopedPtrMap<ResourceId, scoped_ptr<PoolResource>>; 126 using ResourceMap = base::ScopedPtrMap<ResourceId, scoped_ptr<PoolResource>>;
126 ResourceMap in_use_resources_; 127 ResourceMap in_use_resources_;
127 128
128 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 129 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
129 bool evict_expired_resources_pending_; 130 bool evict_expired_resources_pending_;
130 base::TimeDelta resource_expiration_delay_; 131 base::TimeDelta resource_expiration_delay_;
131 132
132 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_; 133 base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
133 134
134 DISALLOW_COPY_AND_ASSIGN(ResourcePool); 135 DISALLOW_COPY_AND_ASSIGN(ResourcePool);
135 }; 136 };
136 137
137 } // namespace cc 138 } // namespace cc
138 139
139 #endif // CC_RESOURCES_RESOURCE_POOL_H_ 140 #endif // CC_RESOURCES_RESOURCE_POOL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/resource_pool.cc » ('j') | cc/resources/resource_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698