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

Side by Side Diff: cc/test/thread_blocker.cc

Issue 671653005: SetNeedsRedraw directly when updating a visible tile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pinchblurmerge-test: testfix Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/test/thread_blocker.h"
6
7 #include "base/bind.h"
8
9 namespace cc {
10
11 ThreadBlocker::ThreadBlocker()
12 : should_delay_(false),
13 waiter_(false /* manual_reset */, false /* initially_signaled */) {
14 }
15
16 ThreadBlocker::~ThreadBlocker() {
17 }
18
19 void ThreadBlocker::Wait() {
20 {
21 base::AutoLock lock(lock_);
22 if (!should_delay_)
23 return;
24 }
25 waiter_.Wait();
26 }
27
28 void ThreadBlocker::BlockWait() {
29 base::AutoLock lock(lock_);
30 should_delay_ = true;
31 }
32
33 void ThreadBlocker::UnblockWait() {
34 base::AutoLock lock(lock_);
35 should_delay_ = false;
36 waiter_.Signal();
37 }
38
39 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698