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

Unified Diff: cc/raster/staging_buffer_pool.h

Issue 2130683002: [Experiment] purge-and-suspend Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 5 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 | « no previous file | cc/raster/staging_buffer_pool.cc » ('j') | cc/raster/staging_buffer_pool.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/staging_buffer_pool.h
diff --git a/cc/raster/staging_buffer_pool.h b/cc/raster/staging_buffer_pool.h
index faa012b2b8029192b97400a1b48ff5491d82d3f9..bbb448cc649e6c2cee1678c86e94ff1250e7c80f 100644
--- a/cc/raster/staging_buffer_pool.h
+++ b/cc/raster/staging_buffer_pool.h
@@ -12,6 +12,7 @@
#include <set>
#include "base/macros.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
@@ -78,6 +79,8 @@ class CC_EXPORT StagingBufferPool
void MarkStagingBufferAsBusy(const StagingBuffer* staging_buffer);
base::TimeTicks GetUsageTimeForLRUBuffer();
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
void ScheduleReduceMemoryUsage();
void ReduceMemoryUsage();
void ReleaseBuffersNotUsedSince(base::TimeTicks time);
@@ -91,6 +94,7 @@ class CC_EXPORT StagingBufferPool
ContextProvider* const worker_context_provider_;
ResourceProvider* const resource_provider_;
const bool use_partial_raster_;
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
mutable base::Lock lock_;
// |lock_| must be acquired when accessing the following members.
« no previous file with comments | « no previous file | cc/raster/staging_buffer_pool.cc » ('j') | cc/raster/staging_buffer_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698