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

Side by Side Diff: cc/tiles/software_image_decode_cache.h

Issue 2795803002: Clear Image Decode Cache on Navigation (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ 5 #ifndef CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_
6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ 6 #define CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 const DrawImage& image, 123 const DrawImage& image,
124 scoped_refptr<TileTask>* task) override; 124 scoped_refptr<TileTask>* task) override;
125 void UnrefImage(const DrawImage& image) override; 125 void UnrefImage(const DrawImage& image) override;
126 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override; 126 DecodedDrawImage GetDecodedImageForDraw(const DrawImage& image) override;
127 void DrawWithImageFinished(const DrawImage& image, 127 void DrawWithImageFinished(const DrawImage& image,
128 const DecodedDrawImage& decoded_image) override; 128 const DecodedDrawImage& decoded_image) override;
129 void ReduceCacheUsage() override; 129 void ReduceCacheUsage() override;
130 // Software doesn't keep outstanding images pinned, so this is a no-op. 130 // Software doesn't keep outstanding images pinned, so this is a no-op.
131 void SetShouldAggressivelyFreeResources( 131 void SetShouldAggressivelyFreeResources(
132 bool aggressively_free_resources) override {} 132 bool aggressively_free_resources) override {}
133 void ClearCache() override;
133 134
134 // Decode the given image and store it in the cache. This is only called by an 135 // Decode the given image and store it in the cache. This is only called by an
135 // image decode task from a worker thread. 136 // image decode task from a worker thread.
136 void DecodeImage(const ImageKey& key, 137 void DecodeImage(const ImageKey& key,
137 const DrawImage& image, 138 const DrawImage& image,
138 DecodeTaskType task_type); 139 DecodeTaskType task_type);
139 140
140 void RemovePendingTask(const ImageKey& key, DecodeTaskType task_type); 141 void RemovePendingTask(const ImageKey& key, DecodeTaskType task_type);
141 142
142 // MemoryDumpProvider overrides. 143 // MemoryDumpProvider overrides.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 ResourceFormat format_; 310 ResourceFormat format_;
310 size_t max_items_in_cache_; 311 size_t max_items_in_cache_;
311 312
312 // Used to uniquely identify DecodedImages for memory traces. 313 // Used to uniquely identify DecodedImages for memory traces.
313 base::AtomicSequenceNumber next_tracing_id_; 314 base::AtomicSequenceNumber next_tracing_id_;
314 }; 315 };
315 316
316 } // namespace cc 317 } // namespace cc
317 318
318 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_ 319 #endif // CC_TILES_SOFTWARE_IMAGE_DECODE_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698