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

Unified Diff: remoting/client/plugin/pepper_util.cc

Issue 3038001: Reapply r51857 to start building chromoting plugin. Update for ppapi changes. (Closed)
Patch Set: rebased correctly. Created 10 years, 5 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 | « remoting/client/plugin/pepper_util.h ('k') | remoting/client/plugin/pepper_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/pepper_util.cc
diff --git a/remoting/client/plugin/pepper_util.cc b/remoting/client/plugin/pepper_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7c912338cb8d192cc3f3d665dd2b1d867a613916
--- /dev/null
+++ b/remoting/client/plugin/pepper_util.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 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 "remoting/client/plugin/pepper_util.h"
+
+#include "base/task.h"
+#include "third_party/ppapi/c/pp_completion_callback.h"
+#include "third_party/ppapi/cpp/module.h"
+
+namespace remoting {
+
+void CompletionCallbackTaskAdapter(void* user_data, int32_t not_used) {
+ Task* task = reinterpret_cast<Task*>(user_data);
+ task->Run();
+ delete task;
+}
+
+pp::CompletionCallback TaskToCompletionCallback(Task* task) {
+ return pp::CompletionCallback(&CompletionCallbackTaskAdapter, task);
+}
+
+void RunTaskOnPluginThread(Task* task) {
+ pp::Module::Get()->core()->CallOnMainThread(
+ 0 /* run immediately */,
+ TaskToCompletionCallback(task),
+ 0 /* unused value */
+ );
+}
+
+} // namespace remoting
« no previous file with comments | « remoting/client/plugin/pepper_util.h ('k') | remoting/client/plugin/pepper_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698