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

Unified Diff: chrome/browser/android/thumbnail/thumbnail_cache.h

Issue 2244783005: Android: Don't evict thumbnails for last visible tab on stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android: Don't evict thumbnails for last visible tab on stop 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
Index: chrome/browser/android/thumbnail/thumbnail_cache.h
diff --git a/chrome/browser/android/thumbnail/thumbnail_cache.h b/chrome/browser/android/thumbnail/thumbnail_cache.h
index 92f3797b2607d89d882431d9d89c9816ff4a65b0..2361e1a0983e76a843f359495f7117247ac794f9 100644
--- a/chrome/browser/android/thumbnail/thumbnail_cache.h
+++ b/chrome/browser/android/thumbnail/thumbnail_cache.h
@@ -15,6 +15,7 @@
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
#include "base/time/time.h"
@@ -147,6 +148,9 @@ class ThumbnailCache : ThumbnailDelegate {
static std::pair<SkBitmap, float> CreateApproximation(const SkBitmap& bitmap,
float scale);
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel level);
+
const size_t compression_queue_max_size_;
const size_t write_queue_max_size_;
const bool use_approximation_thumbnail_;
@@ -164,6 +168,7 @@ class ThumbnailCache : ThumbnailDelegate {
ui::UIResourceProvider* ui_resource_provider_;
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_;
base::WeakPtrFactory<ThumbnailCache> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ThumbnailCache);
« no previous file with comments | « chrome/browser/android/thumbnail/scoped_ptr_expiring_cache.h ('k') | chrome/browser/android/thumbnail/thumbnail_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698