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

Unified Diff: third_party/webrtc_overrides/webrtc/rtc_base/event.cc

Issue 2975553002: Override rtc::Event with Chromium's implementation (Closed)
Patch Set: Move and update files 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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