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 WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ | 6 #define WEBKIT_PLUGINS_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 "webkit/plugins/npapi/plugin_list.h" | 15 #include "webkit/plugins/npapi/plugin_list.h" |
16 #include "webkit/plugins/npapi/webplugin.h" | 16 #include "webkit/plugins/npapi/webplugin.h" |
17 #include "webkit/plugins/webkit_plugins_export.h" | 17 #include "webkit/plugins/webkit_plugins_export.h" |
18 | 18 |
| 19 namespace base { |
19 class FilePath; | 20 class FilePath; |
| 21 } |
20 | 22 |
21 namespace webkit { | 23 namespace webkit { |
22 namespace npapi { | 24 namespace npapi { |
23 | 25 |
24 class PluginInstance; | 26 class PluginInstance; |
25 | 27 |
26 // A PluginLib is a single NPAPI Plugin Library, and is the lifecycle | 28 // A PluginLib is a single NPAPI Plugin Library, and is the lifecycle |
27 // manager for new PluginInstances. | 29 // manager for new PluginInstances. |
28 class WEBKIT_PLUGINS_EXPORT PluginLib : public base::RefCounted<PluginLib> { | 30 class WEBKIT_PLUGINS_EXPORT PluginLib : public base::RefCounted<PluginLib> { |
29 public: | 31 public: |
30 static PluginLib* CreatePluginLib(const FilePath& filename); | 32 static PluginLib* CreatePluginLib(const base::FilePath& filename); |
31 | 33 |
32 // Creates a WebPluginInfo structure given a plugin's path. On success | 34 // Creates a WebPluginInfo structure given a plugin's path. On success |
33 // returns true, with the information being put into "info". | 35 // returns true, with the information being put into "info". |
34 // Returns false if the library couldn't be found, or if it's not a plugin. | 36 // Returns false if the library couldn't be found, or if it's not a plugin. |
35 static bool ReadWebPluginInfo(const FilePath& filename, | 37 static bool ReadWebPluginInfo(const base::FilePath& filename, |
36 webkit::WebPluginInfo* info); | 38 webkit::WebPluginInfo* info); |
37 | 39 |
38 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 40 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
39 // Parse the result of an NP_GetMIMEDescription() call. | 41 // Parse the result of an NP_GetMIMEDescription() call. |
40 // This API is only used on Unixes, and is exposed here for testing. | 42 // This API is only used on Unixes, and is exposed here for testing. |
41 static void ParseMIMEDescription(const std::string& description, | 43 static void ParseMIMEDescription(const std::string& description, |
42 std::vector<webkit::WebPluginMimeType>* mime_types); | 44 std::vector<webkit::WebPluginMimeType>* mime_types); |
43 | 45 |
44 // Extract a version number from a description string. | 46 // Extract a version number from a description string. |
45 // This API is only used on Unixes, and is exposed here for testing. | 47 // This API is only used on Unixes, and is exposed here for testing. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Set to true if unloading of the plugin dll is to be deferred. | 136 // Set to true if unloading of the plugin dll is to be deferred. |
135 bool defer_unload_; | 137 bool defer_unload_; |
136 | 138 |
137 DISALLOW_COPY_AND_ASSIGN(PluginLib); | 139 DISALLOW_COPY_AND_ASSIGN(PluginLib); |
138 }; | 140 }; |
139 | 141 |
140 } // namespace npapi | 142 } // namespace npapi |
141 } // namespace webkit | 143 } // namespace webkit |
142 | 144 |
143 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ | 145 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIB_H_ |
OLD | NEW |