Index: cc/test/delayed_raster_trigger.h |
diff --git a/cc/test/delayed_raster_trigger.h b/cc/test/delayed_raster_trigger.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..4a969d66dc61b1f0399c4396844c979d753f3ea4 |
--- /dev/null |
+++ b/cc/test/delayed_raster_trigger.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CC_TEST_DELAYED_RASTER_TRIGGER_H_ |
+#define CC_TEST_DELAYED_RASTER_TRIGGER_H_ |
+ |
+#include <vector> |
+ |
+#include "base/synchronization/lock.h" |
+#include "base/synchronization/waitable_event.h" |
+ |
+namespace base { |
+class RunLoop; |
+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.
|
+} |
+ |
+namespace cc { |
+ |
+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
|
+ public: |
+ DelayedRasterTrigger(); |
+ ~DelayedRasterTrigger(); |
+ |
+ 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.
|
+ void BeginDelay(); |
+ void EndDelay(); |
+ |
+ private: |
+ base::Lock lock_; |
+ bool should_delay_; |
+ 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.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(DelayedRasterTrigger); |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_TEST_DELAYED_RASTER_TRIGGER_H_ |