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

Unified Diff: cc/trees/thread_proxy.cc

Issue 475483002: Revert "Make SingleThreadProxy a SchedulerClient" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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') | chrome/browser/ui/views/menu_view_drag_and_drop_test.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 ac8b4fdb3baab4e9afdcdc78736751514bf75332..a4a630ecdcd7d778ad84a77eafd32cecfe7f4f5f 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -25,7 +25,6 @@
#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"
@@ -38,6 +37,19 @@ 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 {
@@ -441,10 +453,9 @@ void ThreadProxy::SetNextCommitWaitsForActivation() {
void ThreadProxy::SetDeferCommits(bool defer_commits) {
DCHECK(IsMainThread());
- if (main().defer_commits == defer_commits)
- return;
-
+ DCHECK_NE(main().defer_commits, defer_commits);
main().defer_commits = defer_commits;
+
if (main().defer_commits)
TRACE_EVENT_ASYNC_BEGIN0("cc", "ThreadProxy::SetDeferCommits", this);
else
@@ -724,9 +735,9 @@ void ThreadProxy::BeginMainFrame(
}
// If the commit finishes, LayerTreeHost will transfer its swap promises to
- // LayerTreeImpl. The destructor of ScopedSwapPromiseChecker aborts the
- // remaining swap promises.
- ScopedAbortRemainingSwapPromises swap_promise_checker(layer_tree_host());
+ // LayerTreeImpl. The destructor of SwapPromiseChecker checks LayerTressHost's
+ // swap promises.
+ SwapPromiseChecker 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') | chrome/browser/ui/views/menu_view_drag_and_drop_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698