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

Side by Side Diff: third_party/WebKit/Source/platform/WaitableEvent.cpp

Issue 1682423002: Remove WebWaitableEvent and replace it with WaitableEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android build Created 4 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2016 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 "platform/WaitableEvent.h"
6
7 #include "base/synchronization/waitable_event.h"
8 #include "wtf/PassOwnPtr.h"
9
10 #include <vector>
11
12 namespace blink {
13
14 WaitableEvent::WaitableEvent(ResetPolicy policy, InitialState state)
15 {
16 bool manualReset = policy == ResetPolicy::Manual;
17 bool initiallySignaled = state == InitialState::Signaled;
18 m_impl = adoptPtr(new base::WaitableEvent(manualReset, initiallySignaled));
19 }
20
21 WaitableEvent::~WaitableEvent() {}
22
23 void WaitableEvent::reset()
24 {
25 m_impl->Reset();
26 }
27
28 void WaitableEvent::wait()
29 {
30 m_impl->Wait();
31 }
32
33 void WaitableEvent::signal()
34 {
35 m_impl->Signal();
36 }
37
38 size_t WaitableEvent::waitMultiple(const WTF::Vector<WaitableEvent*>& events)
39 {
40 std::vector<base::WaitableEvent*> baseEvents;
41 for (size_t i = 0; i < events.size(); ++i)
42 baseEvents.push_back(events[i]->m_impl.get());
43 size_t idx = base::WaitableEvent::WaitMany(baseEvents.data(), baseEvents.siz e());
44 DCHECK_LT(idx, events.size());
45 return idx;
46 }
47
48 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/WaitableEvent.h ('k') | third_party/WebKit/Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698