|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * vim: sw=2 ts=8 et : |
|
3 */ |
|
4 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
5 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
7 |
|
8 #ifndef mozilla_plugins_ChildAsyncCall_h |
|
9 #define mozilla_plugins_ChildAsyncCall_h |
|
10 |
|
11 #include "PluginMessageUtils.h" |
|
12 #include "base/task.h" |
|
13 |
|
14 namespace mozilla { |
|
15 namespace plugins { |
|
16 |
|
17 typedef void (*PluginThreadCallback)(void*); |
|
18 |
|
19 class PluginInstanceChild; |
|
20 |
|
21 class ChildAsyncCall : public CancelableTask |
|
22 { |
|
23 public: |
|
24 ChildAsyncCall(PluginInstanceChild* instance, |
|
25 PluginThreadCallback aFunc, void* aUserData); |
|
26 |
|
27 void Run() MOZ_OVERRIDE; |
|
28 void Cancel() MOZ_OVERRIDE; |
|
29 |
|
30 protected: |
|
31 PluginInstanceChild* mInstance; |
|
32 PluginThreadCallback mFunc; |
|
33 void* mData; |
|
34 |
|
35 void RemoveFromAsyncList(); |
|
36 }; |
|
37 |
|
38 } // namespace plugins |
|
39 } // namespace mozilla |
|
40 |
|
41 #endif // mozilla_plugins_ChildAsyncCall_h |