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

Unified Diff: cc/resources/resource_update_controller.cc

Issue 190543012: cc: Don't call ReadyToFinalizeTextureUpdates multiple times (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 9 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/resources/resource_update_controller.h ('k') | cc/resources/resource_update_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_update_controller.cc
diff --git a/cc/resources/resource_update_controller.cc b/cc/resources/resource_update_controller.cc
index 868133596bec362c2292a4af59097a2cf7d6ac22..bd6d21df61267c13e1591238c87bdee7d76a2557 100644
--- a/cc/resources/resource_update_controller.cc
+++ b/cc/resources/resource_update_controller.cc
@@ -47,6 +47,7 @@ ResourceUpdateController::ResourceUpdateController(
first_update_attempt_(true),
task_runner_(task_runner),
task_posted_(false),
+ ready_to_finalize_(false),
weak_factory_(this) {}
ResourceUpdateController::~ResourceUpdateController() {}
@@ -55,8 +56,8 @@ void ResourceUpdateController::PerformMoreUpdates(
base::TimeTicks time_limit) {
time_limit_ = time_limit;
- // Update already in progress.
- if (task_posted_)
+ // Update already in progress or we are already done.
+ if (task_posted_ || ready_to_finalize_)
return;
// Call UpdateMoreTexturesNow() directly unless it's the first update
@@ -105,8 +106,10 @@ void ResourceUpdateController::Finalize() {
void ResourceUpdateController::OnTimerFired() {
task_posted_ = false;
- if (!UpdateMoreTexturesIfEnoughTimeRemaining())
+ if (!UpdateMoreTexturesIfEnoughTimeRemaining()) {
+ ready_to_finalize_ = true;
client_->ReadyToFinalizeTextureUpdates();
+ }
}
base::TimeTicks ResourceUpdateController::UpdateMoreTexturesCompletionTime() {
« no previous file with comments | « cc/resources/resource_update_controller.h ('k') | cc/resources/resource_update_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698