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

Unified Diff: cc/tiles/software_image_decode_cache.h

Issue 2844273004: cc: Make images that can't possibly fit in cache not checker. (Closed)
Patch Set: tests Created 3 years, 8 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/tiles/image_decode_cache.h ('k') | cc/tiles/software_image_decode_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/software_image_decode_cache.h
diff --git a/cc/tiles/software_image_decode_cache.h b/cc/tiles/software_image_decode_cache.h
index 1d3e2ac75c40d603c8a3009edfce9d0885aac908..04aeb452ed4ff0b4fb50e30b8be8b47574c65ead 100644
--- a/cc/tiles/software_image_decode_cache.h
+++ b/cc/tiles/software_image_decode_cache.h
@@ -140,6 +140,7 @@ class CC_EXPORT SoftwareImageDecodeCache
void SetShouldAggressivelyFreeResources(
bool aggressively_free_resources) override {}
void ClearCache() override;
+ size_t GetMaximumMemoryLimitBytes() const override;
// Decode the given image and store it in the cache. This is only called by an
// image decode task from a worker thread.
@@ -220,7 +221,7 @@ class CC_EXPORT SoftwareImageDecodeCache
size_t GetCurrentUsageSafe() const;
private:
- size_t limit_bytes_;
+ const size_t limit_bytes_;
base::CheckedNumeric<size_t> current_usage_bytes_;
};
@@ -306,6 +307,8 @@ class CC_EXPORT SoftwareImageDecodeCache
// The members below this comment can only be accessed if the lock is held to
// ensure that they are safe to access on multiple threads.
+ // The exception is accessing |locked_images_budget_.total_limit_bytes()|,
+ // which is const and thread safe.
base::Lock lock_;
// Decoded images and ref counts (predecode path).
« no previous file with comments | « cc/tiles/image_decode_cache.h ('k') | cc/tiles/software_image_decode_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698