OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/native_library.h" | 17 #include "base/native_library.h" |
18 #include "base/process.h" | 18 #include "base/process.h" |
19 #include "ppapi/c/pp_bool.h" | 19 #include "ppapi/c/pp_bool.h" |
20 #include "ppapi/c/pp_instance.h" | 20 #include "ppapi/c/pp_instance.h" |
21 #include "ppapi/c/pp_module.h" | 21 #include "ppapi/c/pp_module.h" |
22 #include "ppapi/c/ppb.h" | 22 #include "ppapi/c/ppb.h" |
23 #include "webkit/plugins/ppapi/plugin_delegate.h" | 23 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 24 #include "webkit/plugins/webkit_plugins_export.h" |
24 | 25 |
25 class FilePath; | 26 class FilePath; |
26 struct PPB_Core; | 27 struct PPB_Core; |
27 typedef void* NPIdentifier; | 28 typedef void* NPIdentifier; |
28 | 29 |
29 namespace ppapi { | 30 namespace ppapi { |
30 class WebKitForwarding; | 31 class WebKitForwarding; |
31 } // namespace ppapi | 32 } // namespace ppapi |
32 | 33 |
33 namespace webkit { | 34 namespace webkit { |
34 namespace ppapi { | 35 namespace ppapi { |
35 | 36 |
36 class CallbackTracker; | 37 class CallbackTracker; |
37 class PluginDelegate; | 38 class PluginDelegate; |
38 class PluginInstance; | 39 class PluginInstance; |
39 | 40 |
40 // Represents one plugin library loaded into one renderer. This library may | 41 // Represents one plugin library loaded into one renderer. This library may |
41 // have multiple instances. | 42 // have multiple instances. |
42 // | 43 // |
43 // Note: to get from a PP_Instance to a PluginInstance*, use the | 44 // Note: to get from a PP_Instance to a PluginInstance*, use the |
44 // ResourceTracker. | 45 // ResourceTracker. |
45 class PluginModule : public base::RefCounted<PluginModule>, | 46 class WEBKIT_PLUGINS_EXPORT PluginModule : |
46 public base::SupportsWeakPtr<PluginModule> { | 47 public base::RefCounted<PluginModule>, |
| 48 public base::SupportsWeakPtr<PluginModule> { |
47 public: | 49 public: |
48 typedef const void* (*GetInterfaceFunc)(const char*); | 50 typedef const void* (*GetInterfaceFunc)(const char*); |
49 typedef int (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface); | 51 typedef int (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface); |
50 typedef void (*PPP_ShutdownModuleFunc)(); | 52 typedef void (*PPP_ShutdownModuleFunc)(); |
51 | 53 |
52 struct EntryPoints { | 54 struct EntryPoints { |
53 // This structure is POD, with the constructor initializing to NULL. | 55 // This structure is POD, with the constructor initializing to NULL. |
54 EntryPoints(); | 56 WEBKIT_PLUGINS_EXPORT EntryPoints(); |
55 | 57 |
56 GetInterfaceFunc get_interface; | 58 GetInterfaceFunc get_interface; |
57 PPP_InitializeModuleFunc initialize_module; | 59 PPP_InitializeModuleFunc initialize_module; |
58 PPP_ShutdownModuleFunc shutdown_module; // Optional, may be NULL. | 60 PPP_ShutdownModuleFunc shutdown_module; // Optional, may be NULL. |
59 }; | 61 }; |
60 | 62 |
61 // You must call one of the Init functions after the constructor to create a | 63 // You must call one of the Init functions after the constructor to create a |
62 // module of the type you desire. | 64 // module of the type you desire. |
63 // | 65 // |
64 // The module lifetime delegate is a non-owning pointer that must outlive | 66 // The module lifetime delegate is a non-owning pointer that must outlive |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // Lazily created by GetWebKitForwarding. | 199 // Lazily created by GetWebKitForwarding. |
198 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; | 200 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; |
199 | 201 |
200 DISALLOW_COPY_AND_ASSIGN(PluginModule); | 202 DISALLOW_COPY_AND_ASSIGN(PluginModule); |
201 }; | 203 }; |
202 | 204 |
203 } // namespace ppapi | 205 } // namespace ppapi |
204 } // namespace webkit | 206 } // namespace webkit |
205 | 207 |
206 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 208 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
OLD | NEW |