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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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/PassOwnPtr.h" 8 #include "wtf/PtrUtil.h"
9
10 #include <vector> 9 #include <vector>
11 10
12 namespace blink { 11 namespace blink {
13 12
14 WaitableEvent::WaitableEvent(ResetPolicy policy, InitialState state) 13 WaitableEvent::WaitableEvent(ResetPolicy policy, InitialState state)
15 { 14 {
16 m_impl = adoptPtr(new base::WaitableEvent( 15 m_impl = wrapUnique(new base::WaitableEvent(
17 policy == ResetPolicy::Manual 16 policy == ResetPolicy::Manual
18 ? base::WaitableEvent::ResetPolicy::MANUAL 17 ? base::WaitableEvent::ResetPolicy::MANUAL
19 : base::WaitableEvent::ResetPolicy::AUTOMATIC, 18 : base::WaitableEvent::ResetPolicy::AUTOMATIC,
20 state == InitialState::Signaled 19 state == InitialState::Signaled
21 ? base::WaitableEvent::InitialState::SIGNALED 20 ? base::WaitableEvent::InitialState::SIGNALED
22 : base::WaitableEvent::InitialState::NOT_SIGNALED)); 21 : base::WaitableEvent::InitialState::NOT_SIGNALED));
23 } 22 }
24 23
25 WaitableEvent::~WaitableEvent() {} 24 WaitableEvent::~WaitableEvent() {}
26 25
(...skipping 16 matching lines...) Expand all
43 { 42 {
44 std::vector<base::WaitableEvent*> baseEvents; 43 std::vector<base::WaitableEvent*> baseEvents;
45 for (size_t i = 0; i < events.size(); ++i) 44 for (size_t i = 0; i < events.size(); ++i)
46 baseEvents.push_back(events[i]->m_impl.get()); 45 baseEvents.push_back(events[i]->m_impl.get());
47 size_t idx = base::WaitableEvent::WaitMany(baseEvents.data(), baseEvents.siz e()); 46 size_t idx = base::WaitableEvent::WaitMany(baseEvents.data(), baseEvents.siz e());
48 DCHECK_LT(idx, events.size()); 47 DCHECK_LT(idx, events.size());
49 return idx; 48 return idx;
50 } 49 }
51 50
52 } // namespace blink 51 } // 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