Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index 2e41ea7d0ef34800fe4d12c9009d79cc71892015..4a95140226db8fd2c72da44e632ebdd880bf1f5e 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -25,6 +25,7 @@ |
#include "cc/trees/blocking_task_runner.h" |
#include "cc/trees/layer_tree_host.h" |
#include "cc/trees/layer_tree_impl.h" |
+#include "cc/trees/scoped_abort_remaining_swap_promises.h" |
#include "gpu/command_buffer/client/gles2_interface.h" |
#include "ui/gfx/frame_time.h" |
@@ -37,19 +38,6 @@ const double kSmoothnessTakesPriorityExpirationDelay = 0.25; |
unsigned int nextBeginFrameId = 0; |
-class SwapPromiseChecker { |
- public: |
- explicit SwapPromiseChecker(LayerTreeHost* layer_tree_host) |
- : layer_tree_host_(layer_tree_host) {} |
- |
- ~SwapPromiseChecker() { |
- layer_tree_host_->BreakSwapPromises(SwapPromise::COMMIT_FAILS); |
- } |
- |
- private: |
- LayerTreeHost* layer_tree_host_; |
-}; |
- |
} // namespace |
struct ThreadProxy::SchedulerStateRequest { |
@@ -453,9 +441,10 @@ void ThreadProxy::SetNextCommitWaitsForActivation() { |
void ThreadProxy::SetDeferCommits(bool defer_commits) { |
DCHECK(IsMainThread()); |
- DCHECK_NE(main().defer_commits, defer_commits); |
- main().defer_commits = defer_commits; |
+ if (main().defer_commits == defer_commits) |
+ return; |
+ main().defer_commits = defer_commits; |
if (main().defer_commits) |
TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this); |
else |
@@ -735,9 +724,9 @@ void ThreadProxy::BeginMainFrame( |
} |
// If the commit finishes, LayerTreeHost will transfer its swap promises to |
- // LayerTreeImpl. The destructor of SwapPromiseChecker checks LayerTressHost's |
- // swap promises. |
- SwapPromiseChecker swap_promise_checker(layer_tree_host()); |
+ // LayerTreeImpl. The destructor of ScopedSwapPromiseChecker aborts the |
+ // remaining swap promises. |
+ ScopedAbortRemainingSwapPromises swap_promise_checker(layer_tree_host()); |
main().commit_requested = false; |
main().commit_request_sent_to_impl_thread = false; |