Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef CC_TEST_DELAYED_RASTER_TRIGGER_H_ | |
| 6 #define CC_TEST_DELAYED_RASTER_TRIGGER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/synchronization/lock.h" | |
| 11 #include "base/synchronization/waitable_event.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class RunLoop; | |
| 15 class SingleThreadTaskRunner; | |
|
reveman
2014/11/10 23:43:02
what are these for?
danakj
2014/11/12 20:19:39
Woops, from previous attempts to maket his go.
| |
| 16 } | |
| 17 | |
| 18 namespace cc { | |
| 19 | |
| 20 class DelayedRasterTrigger { | |
|
vmpstr
2014/11/10 22:47:04
nit: This is just a DelayedTrigger right? (I'm not
danakj
2014/11/12 20:19:40
Done. Renamed the class to ThreadBlocker, and rena
| |
| 21 public: | |
| 22 DelayedRasterTrigger(); | |
| 23 ~DelayedRasterTrigger(); | |
| 24 | |
| 25 void Delay(); | |
|
reveman
2014/11/10 23:43:02
The name of this confused me. How about Wait() ins
danakj
2014/11/12 20:19:39
Done.
| |
| 26 void BeginDelay(); | |
| 27 void EndDelay(); | |
| 28 | |
| 29 private: | |
| 30 base::Lock lock_; | |
| 31 bool should_delay_; | |
| 32 std::vector<base::WaitableEvent*> delayed_raster_tasks_; | |
|
reveman
2014/11/10 23:43:02
hm, wouldn't it be enough with one WaitableEvent t
danakj
2014/11/12 20:19:39
Right, thanks! Done.
| |
| 33 | |
| 34 DISALLOW_COPY_AND_ASSIGN(DelayedRasterTrigger); | |
| 35 }; | |
| 36 | |
| 37 } // namespace cc | |
| 38 | |
| 39 #endif // CC_TEST_DELAYED_RASTER_TRIGGER_H_ | |
| OLD | NEW |