| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "cc/output/context_cache_controller.h" | 5 #include "cc/output/context_cache_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 current_idle_generation), | 132 current_idle_generation), |
| 133 base::TimeDelta::FromSeconds(kIdleCleanupDelaySeconds)); | 133 base::TimeDelta::FromSeconds(kIdleCleanupDelaySeconds)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 void ContextCacheController::InvalidatePendingIdleCallbacks() { | 136 void ContextCacheController::InvalidatePendingIdleCallbacks() { |
| 137 base::AutoLock hold(current_idle_generation_lock_); | 137 base::AutoLock hold(current_idle_generation_lock_); |
| 138 ++current_idle_generation_; | 138 ++current_idle_generation_; |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ContextCacheController::OnIdle(uint32_t idle_generation) { | 141 void ContextCacheController::OnIdle(uint32_t idle_generation) { |
| 142 // TODO(ericrk): Temporarily disabling this to investigate whether this |
| 143 // code regressed scroll latency on Android. crbug.com/664181 |
| 144 #if defined(OS_ANDROID) |
| 145 return; |
| 146 #endif |
| 147 |
| 142 // First check if we should run our idle callback at all. If we have become | 148 // First check if we should run our idle callback at all. If we have become |
| 143 // busy since scheduling, just schedule another idle callback and return. | 149 // busy since scheduling, just schedule another idle callback and return. |
| 144 { | 150 { |
| 145 base::AutoLock hold(current_idle_generation_lock_); | 151 base::AutoLock hold(current_idle_generation_lock_); |
| 146 if (current_idle_generation_ != idle_generation) { | 152 if (current_idle_generation_ != idle_generation) { |
| 147 PostIdleCallback(current_idle_generation_); | 153 PostIdleCallback(current_idle_generation_); |
| 148 return; | 154 return; |
| 149 } | 155 } |
| 150 } | 156 } |
| 151 | 157 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 165 context_support_->SetAggressivelyFreeResources(true); | 171 context_support_->SetAggressivelyFreeResources(true); |
| 166 context_support_->SetAggressivelyFreeResources(false); | 172 context_support_->SetAggressivelyFreeResources(false); |
| 167 | 173 |
| 168 callback_pending_ = false; | 174 callback_pending_ = false; |
| 169 | 175 |
| 170 if (context_lock_) | 176 if (context_lock_) |
| 171 context_lock_->Release(); | 177 context_lock_->Release(); |
| 172 } | 178 } |
| 173 | 179 |
| 174 } // namespace cc | 180 } // namespace cc |
| OLD | NEW |