| Index: third_party/webrtc_overrides/webrtc/rtc_base/event.cc
|
| diff --git a/third_party/webrtc_overrides/webrtc/rtc_base/event.cc b/third_party/webrtc_overrides/webrtc/rtc_base/event.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..091c69414000dd8fa8961d08692e946bdc29ad10
|
| --- /dev/null
|
| +++ b/third_party/webrtc_overrides/webrtc/rtc_base/event.cc
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2017 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.
|
| +
|
| +#include "third_party/webrtc_overrides/webrtc/rtc_base/event.h"
|
| +
|
| +#include "base/time/time.h"
|
| +
|
| +namespace rtc {
|
| +
|
| +using base::WaitableEvent;
|
| +
|
| +Event::Event(bool manual_reset, bool initially_signaled)
|
| + : event_(manual_reset ? WaitableEvent::ResetPolicy::MANUAL
|
| + : WaitableEvent::ResetPolicy::AUTOMATIC,
|
| + initially_signaled ? WaitableEvent::InitialState::SIGNALED
|
| + : WaitableEvent::InitialState::NOT_SIGNALED) {}
|
| +
|
| +Event::~Event() {}
|
| +
|
| +void Event::Set() {
|
| + event_.Signal();
|
| +}
|
| +
|
| +void Event::Reset() {
|
| + event_.Reset();
|
| +}
|
| +
|
| +bool Event::Wait(int milliseconds) {
|
| + if (milliseconds == kForever) {
|
| + event_.Wait();
|
| + return true;
|
| + }
|
| +
|
| + return event_.TimedWait(base::TimeDelta::FromMilliseconds(milliseconds));
|
| +}
|
| +
|
| +} // namespace rtc
|
|
|