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

Unified Diff: cc/tile_manager.cc

Issue 12260033: cc: Limit the total number of uploads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_manager.cc
diff --git a/cc/tile_manager.cc b/cc/tile_manager.cc
index cdcff0a085c8ea2c60e97a7c0a53a9cbd387fbec..9c857a4dc2fb4dadd1319576f445b87cc7d376af 100644
--- a/cc/tile_manager.cc
+++ b/cc/tile_manager.cc
@@ -30,8 +30,11 @@ namespace {
// For reference, the Nexus10 can upload 1MB in about 2.5ms.
// Assuming a three frame deep pipeline this implies ~20MB.
const int kMaxPendingUploadBytes = 20 * 1024 * 1024;
+// TODO(epenner): We should remove this upload limit (crbug.com/176197)
+const int kMaxPendingUploads = 72;
#else
const int kMaxPendingUploadBytes = 100 * 1024 * 1024;
+const int kMaxPendingUploads = 1000;
#endif
// Determine bin based on three categories of tiles: things we need now,
@@ -630,7 +633,8 @@ bool TileManager::CanDispatchRasterTask(Tile* tile) {
return false;
size_t new_bytes_pending = bytes_pending_set_pixels_;
new_bytes_pending += tile->bytes_consumed_if_allocated();
- return new_bytes_pending <= kMaxPendingUploadBytes;
+ return new_bytes_pending <= kMaxPendingUploadBytes &&
+ tiles_with_pending_set_pixels_.size() < kMaxPendingUploads;
}
void TileManager::DispatchMoreTasks() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698