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

Unified Diff: cc/resources/pixel_buffer_raster_worker_pool.cc

Issue 489293002: cc: Don't infinitely throttle large raster tasks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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
« no previous file with comments | « no previous file | cc/resources/raster_worker_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/pixel_buffer_raster_worker_pool.cc
diff --git a/cc/resources/pixel_buffer_raster_worker_pool.cc b/cc/resources/pixel_buffer_raster_worker_pool.cc
index d7554736942a66ee541c065c99320385c42d0234..67ae593bde0a5625dc36d2d14a4fd782f442750a 100644
--- a/cc/resources/pixel_buffer_raster_worker_pool.cc
+++ b/cc/resources/pixel_buffer_raster_worker_pool.cc
@@ -515,10 +515,13 @@ void PixelBufferRasterWorkerPool::ScheduleMoreTasks() {
continue;
}
- // All raster tasks need to be throttled by bytes of pending uploads.
+ // All raster tasks need to be throttled by bytes of pending uploads,
+ // but if it's the only task allow it to complete no matter what its size,
+ // to prevent starvation of the task queue.
size_t new_bytes_pending_upload = bytes_pending_upload;
new_bytes_pending_upload += task->resource()->bytes();
- if (new_bytes_pending_upload > max_bytes_pending_upload_) {
+ if (new_bytes_pending_upload > max_bytes_pending_upload_ &&
+ bytes_pending_upload) {
did_throttle_raster_tasks = true;
if (item.required_for_activation)
did_throttle_raster_tasks_required_for_activation = true;
« no previous file with comments | « no previous file | cc/resources/raster_worker_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698