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

Unified 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: update & fix clang 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/gpu/proxy_helpers.h ('k') | ui/ozone/platform/drm/gpu/screen_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/proxy_helpers.cc
diff --git a/ui/ozone/platform/drm/gpu/proxy_helpers.cc b/ui/ozone/platform/drm/gpu/proxy_helpers.cc
new file mode 100644
index 0000000000000000000000000000000000000000..556280d9b625fd59bb0c5fa6d54dc0f17c82b7a6
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/proxy_helpers.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
+
+#include "base/synchronization/waitable_event.h"
+
+namespace ui {
+
+namespace {
+
+void OnRunPostedTaskAndSignal(const base::Closure& callback,
+ base::WaitableEvent* wait) {
+ callback.Run();
+ wait->Signal();
+}
+
+} // namespace
+
+void PostSyncTask(
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+ const base::Closure& callback) {
+ base::WaitableEvent wait(false, false);
+ bool success = task_runner->PostTask(
+ FROM_HERE, base::Bind(OnRunPostedTaskAndSignal, callback, &wait));
+ if (success)
+ wait.Wait();
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/platform/drm/gpu/proxy_helpers.h ('k') | ui/ozone/platform/drm/gpu/screen_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698