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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/WaitableEvent.h" 5 #include "platform/WaitableEvent.h"
6 6
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "wtf/PtrUtil.h" 8 #include "wtf/PassOwnPtr.h"
9
9 #include <vector> 10 #include <vector>
10 11
11 namespace blink { 12 namespace blink {
12 13
13 WaitableEvent::WaitableEvent(ResetPolicy policy, InitialState state) 14 WaitableEvent::WaitableEvent(ResetPolicy policy, InitialState state)
14 { 15 {
15 m_impl = wrapUnique(new base::WaitableEvent( 16 m_impl = adoptPtr(new base::WaitableEvent(
16 policy == ResetPolicy::Manual 17 policy == ResetPolicy::Manual
17 ? base::WaitableEvent::ResetPolicy::MANUAL 18 ? base::WaitableEvent::ResetPolicy::MANUAL
18 : base::WaitableEvent::ResetPolicy::AUTOMATIC, 19 : base::WaitableEvent::ResetPolicy::AUTOMATIC,
19 state == InitialState::Signaled 20 state == InitialState::Signaled
20 ? base::WaitableEvent::InitialState::SIGNALED 21 ? base::WaitableEvent::InitialState::SIGNALED
21 : base::WaitableEvent::InitialState::NOT_SIGNALED)); 22 : base::WaitableEvent::InitialState::NOT_SIGNALED));
22 } 23 }
23 24
24 WaitableEvent::~WaitableEvent() {} 25 WaitableEvent::~WaitableEvent() {}
25 26
(...skipping 16 matching lines...) Expand all
42 { 43 {
43 std::vector<base::WaitableEvent*> baseEvents; 44 std::vector<base::WaitableEvent*> baseEvents;
44 for (size_t i = 0; i < events.size(); ++i) 45 for (size_t i = 0; i < events.size(); ++i)
45 baseEvents.push_back(events[i]->m_impl.get()); 46 baseEvents.push_back(events[i]->m_impl.get());
46 size_t idx = base::WaitableEvent::WaitMany(baseEvents.data(), baseEvents.siz e()); 47 size_t idx = base::WaitableEvent::WaitMany(baseEvents.data(), baseEvents.siz e());
47 DCHECK_LT(idx, events.size()); 48 DCHECK_LT(idx, events.size());
48 return idx; 49 return idx;
49 } 50 }
50 51
51 } // namespace blink 52 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/WaitableEvent.h ('k') | third_party/WebKit/Source/platform/WebScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698