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

Side by Side Diff: third_party/webrtc_overrides/webrtc/rtc_base/event.cc

Issue 2981863002: Revert of Override rtc::Event with Chromium's implementation (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « third_party/webrtc_overrides/webrtc/rtc_base/event.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #include "third_party/webrtc_overrides/webrtc/rtc_base/event.h"
6
7 #include "base/time/time.h"
8
9 namespace rtc {
10
11 using base::WaitableEvent;
12
13 Event::Event(bool manual_reset, bool initially_signaled)
14 : event_(manual_reset ? WaitableEvent::ResetPolicy::MANUAL
15 : WaitableEvent::ResetPolicy::AUTOMATIC,
16 initially_signaled ? WaitableEvent::InitialState::SIGNALED
17 : WaitableEvent::InitialState::NOT_SIGNALED) {}
18
19 Event::~Event() {}
20
21 void Event::Set() {
22 event_.Signal();
23 }
24
25 void Event::Reset() {
26 event_.Reset();
27 }
28
29 bool Event::Wait(int milliseconds) {
30 if (milliseconds == kForever) {
31 event_.Wait();
32 return true;
33 }
34
35 return event_.TimedWait(base::TimeDelta::FromMilliseconds(milliseconds));
36 }
37
38 } // namespace rtc
OLDNEW
« no previous file with comments | « third_party/webrtc_overrides/webrtc/rtc_base/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698