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

Unified Diff: cc/trees/thread_proxy.cc

Issue 134623005: Make SingleThreadProxy a SchedulerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add scoped_abort_remaining_swap_promises.h 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 | « cc/trees/single_thread_proxy.cc ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « cc/trees/single_thread_proxy.cc ('k') | content/browser/renderer_host/compositor_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698