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

Unified Diff: cc/tiles/image_controller.h

Issue 2718243002: cc: Regenerate image decode requests tasks when cache switches. (Closed)
Patch Set: update Created 3 years, 10 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/decoded_image_tracker_unittest.cc ('k') | cc/tiles/image_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/image_controller.h
diff --git a/cc/tiles/image_controller.h b/cc/tiles/image_controller.h
index 4e8a57242342c44b8b0110c79b3b23c7dbf79d24..f62638a1c078679aa09597ebc75ec3f40395c7b5 100644
--- a/cc/tiles/image_controller.h
+++ b/cc/tiles/image_controller.h
@@ -86,6 +86,7 @@ class CC_EXPORT ImageController {
void ProcessNextImageDecodeOnWorkerThread();
void ImageDecodeCompleted(ImageDecodeRequestId id);
+ void GenerateTasksForOrphanedRequests();
ImageDecodeCache* cache_ = nullptr;
std::vector<DrawImage> predecode_locked_images_;
@@ -102,6 +103,12 @@ class CC_EXPORT ImageController {
std::map<ImageDecodeRequestId, ImageDecodeRequest>
requests_needing_completion_;
bool abort_tasks_ = false;
+ // Orphaned requests are requests that were either in queue or needed a
+ // completion callback when we set the decode cache to be nullptr. When a new
+ // decode cache is set, these requests are re-enqueued again with tasks
+ // generated by the new cache. Note that when the cache is set, then aside
+ // from generating new tasks, this vector should be empty.
+ std::vector<ImageDecodeRequest> orphaned_decode_requests_;
base::WeakPtrFactory<ImageController> weak_ptr_factory_;
« no previous file with comments | « cc/tiles/decoded_image_tracker_unittest.cc ('k') | cc/tiles/image_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698