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_NPAPI_PLUGIN_LIB_H_ | 5 #ifndef CONTENT_CHILD_NPAPI_PLUGIN_LIB_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ | 6 #define CONTENT_CHILD_NPAPI_PLUGIN_LIB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/native_library.h" | 13 #include "base/native_library.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/child/npapi/webplugin.h" |
| 16 #include "content/common/content_export.h" |
15 #include "third_party/npapi/bindings/nphostapi.h" | 17 #include "third_party/npapi/bindings/nphostapi.h" |
16 #include "webkit/plugins/npapi/webplugin.h" | |
17 #include "webkit/plugins/webkit_plugins_export.h" | |
18 #include "webkit/plugins/webplugininfo.h" | 18 #include "webkit/plugins/webplugininfo.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 class FilePath; | 21 class FilePath; |
22 } | 22 } |
23 | 23 |
24 namespace webkit { | 24 namespace content { |
25 namespace npapi { | |
26 | 25 |
27 class PluginInstance; | 26 class PluginInstance; |
28 | 27 |
29 // This struct holds entry points into a plugin. The entry points are | 28 // This struct holds entry points into a plugin. The entry points are |
30 // slightly different between Win/Mac and Unixes. Note that the interface for | 29 // slightly different between Win/Mac and Unixes. Note that the interface for |
31 // querying plugins is synchronous and it is preferable to use a higher-level | 30 // querying plugins is synchronous and it is preferable to use a higher-level |
32 // asynchronous information to query information. | 31 // asynchronous information to query information. |
33 struct PluginEntryPoints { | 32 struct PluginEntryPoints { |
34 #if !defined(OS_POSIX) || defined(OS_MACOSX) | 33 #if !defined(OS_POSIX) || defined(OS_MACOSX) |
35 NP_GetEntryPointsFunc np_getentrypoints; | 34 NP_GetEntryPointsFunc np_getentrypoints; |
36 #endif | 35 #endif |
37 NP_InitializeFunc np_initialize; | 36 NP_InitializeFunc np_initialize; |
38 NP_ShutdownFunc np_shutdown; | 37 NP_ShutdownFunc np_shutdown; |
39 }; | 38 }; |
40 | 39 |
41 // A PluginLib is a single NPAPI Plugin Library, and is the lifecycle | 40 // A PluginLib is a single NPAPI Plugin Library, and is the lifecycle |
42 // manager for new PluginInstances. | 41 // manager for new PluginInstances. |
43 class WEBKIT_PLUGINS_EXPORT PluginLib : public base::RefCounted<PluginLib> { | 42 class CONTENT_EXPORT PluginLib : public base::RefCounted<PluginLib> { |
44 public: | 43 public: |
45 static PluginLib* CreatePluginLib(const base::FilePath& filename); | 44 static PluginLib* CreatePluginLib(const base::FilePath& filename); |
46 | 45 |
47 // Unloads all the loaded plugin libraries and cleans up the plugin map. | 46 // Unloads all the loaded plugin libraries and cleans up the plugin map. |
48 static void UnloadAllPlugins(); | 47 static void UnloadAllPlugins(); |
49 | 48 |
50 // Shuts down all loaded plugin instances. | 49 // Shuts down all loaded plugin instances. |
51 static void ShutdownAllPlugins(); | 50 static void ShutdownAllPlugins(); |
52 | 51 |
53 // Get the Plugin's function pointer table. | 52 // Get the Plugin's function pointer table. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 121 |
123 // Function pointers to entry points into the plugin. | 122 // Function pointers to entry points into the plugin. |
124 PluginEntryPoints entry_points_; | 123 PluginEntryPoints entry_points_; |
125 | 124 |
126 // Set to true if unloading of the plugin dll is to be deferred. | 125 // Set to true if unloading of the plugin dll is to be deferred. |
127 bool defer_unload_; | 126 bool defer_unload_; |
128 | 127 |
129 DISALLOW_COPY_AND_ASSIGN(PluginLib); | 128 DISALLOW_COPY_AND_ASSIGN(PluginLib); |
130 }; | 129 }; |
131 | 130 |
132 } // namespace npapi | 131 } // namespace content |
133 } // namespace webkit | |
134 | 132 |
135 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ | 133 #endif // CONTENT_CHILD_NPAPI_PLUGIN_LIB_H_ |
OLD | NEW |