summaryrefslogtreecommitdiffstats
path: root/chromium/cc/tiles/software_image_decode_cache.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-16 11:45:35 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-07-17 08:59:23 +0000
commit552906b0f222c5d5dd11b9fd73829d510980461a (patch)
tree3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/cc/tiles/software_image_decode_cache.cc
parent1b05827804eaf047779b597718c03e7d38344261 (diff)
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/cc/tiles/software_image_decode_cache.cc')
-rw-r--r--chromium/cc/tiles/software_image_decode_cache.cc29
1 files changed, 9 insertions, 20 deletions
diff --git a/chromium/cc/tiles/software_image_decode_cache.cc b/chromium/cc/tiles/software_image_decode_cache.cc
index a0077ff4e3d..c674a447206 100644
--- a/chromium/cc/tiles/software_image_decode_cache.cc
+++ b/chromium/cc/tiles/software_image_decode_cache.cc
@@ -11,6 +11,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/debug/stack_trace.h"
#include "base/format_macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
@@ -169,9 +170,6 @@ SoftwareImageDecodeCache::SoftwareImageDecodeCache(
this, "cc::SoftwareImageDecodeCache",
base::ThreadTaskRunnerHandle::Get());
}
- memory_pressure_listener_.reset(new base::MemoryPressureListener(
- base::BindRepeating(&SoftwareImageDecodeCache::OnMemoryPressure,
- base::Unretained(this))));
}
SoftwareImageDecodeCache::~SoftwareImageDecodeCache() {
@@ -370,8 +368,10 @@ SoftwareImageDecodeCache::DecodeImageIfNecessary(const CacheKey& key,
// If we can use the original decode, we'll definitely need a decode.
if (key.type() == CacheKey::kOriginal) {
base::AutoUnlock release(lock_);
- local_cache_entry = Utils::DoDecodeImage(key, paint_image, color_type_,
- generator_client_id_);
+ local_cache_entry = Utils::DoDecodeImage(
+ key, paint_image, color_type_, generator_client_id_,
+ base::BindOnce(&SoftwareImageDecodeCache::ClearCache,
+ base::Unretained(this)));
} else {
// Attempt to find a cached decode to generate a scaled/subrected decode
// from.
@@ -398,8 +398,10 @@ SoftwareImageDecodeCache::DecodeImageIfNecessary(const CacheKey& key,
DCHECK(!should_decode_to_scale || !key.is_nearest_neighbor());
if (should_decode_to_scale) {
base::AutoUnlock release(lock_);
- local_cache_entry = Utils::DoDecodeImage(key, paint_image, color_type_,
- generator_client_id_);
+ local_cache_entry = Utils::DoDecodeImage(
+ key, paint_image, color_type_, generator_client_id_,
+ base::BindOnce(&SoftwareImageDecodeCache::ClearCache,
+ base::Unretained(this)));
}
// Couldn't decode to scale or find a cached candidate. Create the
@@ -684,19 +686,6 @@ bool SoftwareImageDecodeCache::OnMemoryDump(
return true;
}
-void SoftwareImageDecodeCache::OnMemoryPressure(
- base::MemoryPressureListener::MemoryPressureLevel level) {
- base::AutoLock lock(lock_);
- switch (level) {
- case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
- case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
- break;
- case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
- ReduceCacheUsageUntilWithinLimit(0);
- break;
- }
-}
-
SoftwareImageDecodeCache::CacheEntry* SoftwareImageDecodeCache::AddCacheEntry(
const CacheKey& key) {
frame_key_to_image_keys_[key.frame_key()].push_back(key);