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

Unified Diff: cc/resources/resource_pool.cc

Issue 2254033002: Encourage IOSurface reuse for CSS filter effects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from ericrk. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_pool.cc
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 41358702b7cf56683ab88608a09bdd5c5beac64f..f4523d448f981d568bd229626fcb0fb1f284b3cd 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -20,12 +20,8 @@
#include "cc/resources/scoped_resource.h"
namespace cc {
-namespace {
-
-// Delay before a resource is considered expired.
-const int kResourceExpirationDelayMs = 1000;
-
-} // namespace
+base::TimeDelta ResourcePool::kDefaultExpirationDelay =
+ base::TimeDelta::FromSeconds(1);
void ResourcePool::PoolResource::OnMemoryDump(
base::trace_event::ProcessMemoryDump* pmd,
@@ -60,7 +56,8 @@ void ResourcePool::PoolResource::OnMemoryDump(
ResourcePool::ResourcePool(ResourceProvider* resource_provider,
base::SingleThreadTaskRunner* task_runner,
- bool use_gpu_memory_buffers)
+ bool use_gpu_memory_buffers,
+ const base::TimeDelta& expiration_delay)
: resource_provider_(resource_provider),
use_gpu_memory_buffers_(use_gpu_memory_buffers),
max_memory_usage_bytes_(0),
@@ -70,8 +67,7 @@ ResourcePool::ResourcePool(ResourceProvider* resource_provider,
total_resource_count_(0),
task_runner_(task_runner),
evict_expired_resources_pending_(false),
- resource_expiration_delay_(
- base::TimeDelta::FromMilliseconds(kResourceExpirationDelayMs)),
+ resource_expiration_delay_(expiration_delay),
weak_ptr_factory_(this) {
base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
this, "cc::ResourcePool", task_runner_.get());
« no previous file with comments | « cc/resources/resource_pool.h ('k') | cc/resources/resource_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698