OLD | NEW |
| (Empty) |
1 // Copyright 2017 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 THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_EVENT_H_ | |
6 #define THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_EVENT_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/synchronization/waitable_event.h" | |
10 | |
11 namespace rtc { | |
12 | |
13 // Overrides WebRTC's internal event implementation to use Chromium's. | |
14 class Event { | |
15 public: | |
16 static const int kForever = -1; | |
17 | |
18 Event(bool manual_reset, bool initially_signaled); | |
19 ~Event(); | |
20 | |
21 void Set(); | |
22 void Reset(); | |
23 | |
24 // Wait for the event to become signaled, for the specified number of | |
25 // |milliseconds|. To wait indefinetly, pass kForever. | |
26 bool Wait(int milliseconds); | |
27 | |
28 private: | |
29 base::WaitableEvent event_; | |
30 DISALLOW_IMPLICIT_CONSTRUCTORS(Event); | |
31 }; | |
32 | |
33 } // namespace rtc | |
34 | |
35 #endif // THIRD_PARTY_WEBRTC_OVERRIDES_WEBRTC_RTC_BASE_EVENT_H_ | |
OLD | NEW |