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

Unified Diff: cc/tiles/gpu_image_decode_controller.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
Index: cc/tiles/gpu_image_decode_controller.h
diff --git a/cc/tiles/gpu_image_decode_controller.h b/cc/tiles/gpu_image_decode_controller.h
index 345de1143573507e09cb430a4a89f854a039099c..9e346c1310743c851343a93588f4674ba15fff84 100644
--- a/cc/tiles/gpu_image_decode_controller.h
+++ b/cc/tiles/gpu_image_decode_controller.h
@@ -11,6 +11,7 @@
#include "base/containers/mru_cache.h"
#include "base/memory/discardable_memory.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/synchronization/lock.h"
#include "base/trace_event/memory_dump_provider.h"
#include "cc/base/cc_export.h"
@@ -301,6 +302,9 @@ class CC_EXPORT GpuImageDecodeController
ImageData* image_data);
void DeletePendingImages();
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
const ResourceFormat format_;
ContextProvider* context_;
sk_sp<GrContextThreadSafeProxy> context_threadsafe_proxy_;
@@ -327,6 +331,8 @@ class CC_EXPORT GpuImageDecodeController
// so we add them to this list and defer deletion until the next time the lock
// is held.
std::vector<sk_sp<SkImage>> images_pending_deletion_;
+
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698