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

Unified Diff: cc/trees/thread_proxy.cc

Issue 462803002: Fix failing (flaky) LayerTreeHostTestLCDNotification test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: flakylcd: reordertests 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/thread_proxy.h ('k') | no next file » | 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 d5301eea136c1d194acbcabc54b1ba37a2ff4392..731e236c3c80df30681b13042e9e5b64a70cba4e 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -40,11 +40,6 @@ unsigned int nextBeginFrameId = 0;
} // namespace
-struct ThreadProxy::CommitPendingRequest {
- CompletionEvent completion;
- bool commit_pending;
-};
-
struct ThreadProxy::SchedulerStateRequest {
CompletionEvent completion;
scoped_ptr<base::Value> state;
@@ -1298,29 +1293,33 @@ void ThreadProxy::AsValueOnImplThread(CompletionEvent* completion,
completion->Signal();
}
-bool ThreadProxy::CommitPendingForTesting() {
+bool ThreadProxy::MainFrameWillHappenForTesting() {
DCHECK(IsMainThread());
- CommitPendingRequest commit_pending_request;
+ CompletionEvent completion;
+ bool main_frame_will_happen = false;
{
DebugScopedSetMainThreadBlocked main_thread_blocked(this);
Proxy::ImplThreadTaskRunner()->PostTask(
FROM_HERE,
- base::Bind(&ThreadProxy::CommitPendingOnImplThreadForTesting,
+ base::Bind(&ThreadProxy::MainFrameWillHappenOnImplThreadForTesting,
impl_thread_weak_ptr_,
- &commit_pending_request));
- commit_pending_request.completion.Wait();
+ &completion,
+ &main_frame_will_happen));
+ completion.Wait();
}
- return commit_pending_request.commit_pending;
+ return main_frame_will_happen;
}
-void ThreadProxy::CommitPendingOnImplThreadForTesting(
- CommitPendingRequest* request) {
+void ThreadProxy::MainFrameWillHappenOnImplThreadForTesting(
+ CompletionEvent* completion,
+ bool* main_frame_will_happen) {
DCHECK(IsImplThread());
- if (impl().layer_tree_host_impl->output_surface())
- request->commit_pending = impl().scheduler->CommitPending();
- else
- request->commit_pending = false;
- request->completion.Signal();
+ if (impl().layer_tree_host_impl->output_surface()) {
+ *main_frame_will_happen = impl().scheduler->MainFrameForTestingWillHappen();
+ } else {
+ *main_frame_will_happen = false;
+ }
+ completion->Signal();
}
void ThreadProxy::RenewTreePriority() {
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698