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

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

Issue 1311043016: Switch DRM platform to using a separate thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mv-drm-calls-on-thread2
Patch Set: . Created 5 years, 2 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 2015 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 "ui/ozone/platform/drm/gpu/proxy_helpers.h"
6
7 #include "base/synchronization/waitable_event.h"
8
9 namespace ui {
10
11 namespace {
12
13 void OnRunPostedTaskAndSignal(const base::Closure& callback,
14 base::WaitableEvent* wait) {
15 callback.Run();
16 wait->Signal();
17 }
18
19 } // namespace
20
21 void PostSyncTask(
22 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
23 const base::Closure& callback) {
24 base::WaitableEvent wait(false, false);
25 bool success = task_runner->PostTask(
26 FROM_HERE, base::Bind(OnRunPostedTaskAndSignal, callback, &wait));
27 if (success)
28 wait.Wait();
29 }
30
31 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698