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

Side by Side Diff: ui/ozone/platform/drm/gpu/proxy_helpers.cc

Issue 2043303004: More WaitableEvent stragglers migrated to enum-based constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_4_misc
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
« no previous file with comments | « media/gpu/v4l2_slice_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/ozone/platform/drm/gpu/proxy_helpers.h" 5 #include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
6 6
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
11 namespace { 11 namespace {
12 12
13 void OnRunPostedTaskAndSignal(const base::Closure& callback, 13 void OnRunPostedTaskAndSignal(const base::Closure& callback,
14 base::WaitableEvent* wait) { 14 base::WaitableEvent* wait) {
15 callback.Run(); 15 callback.Run();
16 wait->Signal(); 16 wait->Signal();
17 } 17 }
18 18
19 } // namespace 19 } // namespace
20 20
21 void PostSyncTask( 21 void PostSyncTask(
22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, 22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
23 const base::Closure& callback) { 23 const base::Closure& callback) {
24 base::WaitableEvent wait(false, false); 24 base::WaitableEvent wait(base::WaitableEvent::ResetPolicy::AUTOMATIC,
25 base::WaitableEvent::InitialState::NOT_SIGNALED);
25 bool success = task_runner->PostTask( 26 bool success = task_runner->PostTask(
26 FROM_HERE, base::Bind(OnRunPostedTaskAndSignal, callback, &wait)); 27 FROM_HERE, base::Bind(OnRunPostedTaskAndSignal, callback, &wait));
27 if (success) 28 if (success)
28 wait.Wait(); 29 wait.Wait();
29 } 30 }
30 31
31 } // namespace ui 32 } // namespace ui
OLDNEW
« no previous file with comments | « media/gpu/v4l2_slice_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698