OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 #ifndef REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_ |
| 6 #define REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 |
| 10 #include "third_party/ppapi/cpp/completion_callback.h" |
| 11 |
| 12 class Task; |
| 13 |
| 14 namespace remoting { |
| 15 |
| 16 // Function for adapting a Chromium style Task into a |
| 17 // PP_CompletionCallback friendly function. The Task object should be passed |
| 18 // as |user_data|. This function will invoke Task::Run() on |user_data| when |
| 19 // called, and then delete |user_data|. |
| 20 void CompletionCallbackTaskAdapter(void* user_data, int32_t not_used); |
| 21 |
| 22 // Converts a Task* to a pp::CompletionCallback suitable for use with ppapi C++ |
| 23 // APIs that require a pp::CompletionCallback. Takes ownership of |task|. |
| 24 pp::CompletionCallback TaskToCompletionCallback(Task* task); |
| 25 |
| 26 // Posts the current task to the plugin's main thread. Takes ownership of |
| 27 // |task|. |
| 28 void RunTaskOnPluginThread(Task* task); |
| 29 |
| 30 } // namespace remoting |
| 31 |
| 32 #endif // REMOTING_CLIENT_PLUGIN_PLUGIN_UTIL_H_ |
OLD | NEW |