diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 21:49:54 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-15 21:49:54 +0000 |
commit | ae4e20ac9d99988fb5b522acfaae08cb469a2ab7 (patch) | |
tree | ede89baf7be0f91f2fc9c1734a6060ce75fe648f /webkit/glue/plugins/plugin_lib.h | |
parent | 022f42453b737577e9175eb279d507981ef40b30 (diff) | |
download | chromium_src-ae4e20ac9d99988fb5b522acfaae08cb469a2ab7.zip chromium_src-ae4e20ac9d99988fb5b522acfaae08cb469a2ab7.tar.gz chromium_src-ae4e20ac9d99988fb5b522acfaae08cb469a2ab7.tar.bz2 |
New implementations of core plugin libraries.
Review URL: http://codereview.chromium.org/17427
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/plugin_lib.h')
-rw-r--r-- | webkit/glue/plugins/plugin_lib.h | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/webkit/glue/plugins/plugin_lib.h b/webkit/glue/plugins/plugin_lib.h index 3882da9..7878766 100644 --- a/webkit/glue/plugins/plugin_lib.h +++ b/webkit/glue/plugins/plugin_lib.h @@ -50,7 +50,7 @@ struct InternalPluginInfo { // manager for new PluginInstances. class PluginLib : public base::RefCounted<PluginLib> { public: - static PluginLib* PluginLib::CreatePluginLib(const FilePath& filename); + static PluginLib* CreatePluginLib(const FilePath& filename); virtual ~PluginLib(); // Creates a WebPluginInfo structure given a plugin's path. On success @@ -88,16 +88,10 @@ class PluginLib : public base::RefCounted<PluginLib> { // NPAPI method to shutdown a Plugin. void NP_Shutdown(void); -#if defined(OS_WIN) - // Helper function to load a plugin. - // Returns the module handle on success. - static HMODULE LoadPluginHelper(const FilePath plugin_file); -#endif - int instance_count() const { return instance_count_; } private: - // Creates a new PluginLib + // Creates a new PluginLib. PluginLib(const WebPluginInfo& info); // Attempts to load the plugin from the library. @@ -109,17 +103,42 @@ class PluginLib : public base::RefCounted<PluginLib> { // Shutdown the plugin library. void Shutdown(); - - // Creates WebPluginInfo structure based on read in or built in - // PluginVersionInfo. - static bool CreateWebPluginInfo(const PluginVersionInfo& pvi, - WebPluginInfo* info); - + + // + // Platform functions + // + + // Gets the list of internal plugins. + static void GetInternalPlugins(const InternalPluginInfo** plugins, + size_t* count); + + public: +#if defined(OS_WIN) + typedef HMODULE NativeLibrary; + typedef char* NativeLibraryFunctionNameType; +#define FUNCTION_NAME(x) x +#elif defined(OS_MACOSX) + typedef CFBundleRef NativeLibrary; + typedef CFStringRef NativeLibraryFunctionNameType; +#define FUNCTION_NAME(x) CFSTR(x) +#endif // OS_* + + // Loads a native library from disk. NOTE: You must release it with + // UnloadNativeLibrary when you're done. + static NativeLibrary LoadNativeLibrary(const FilePath& library_path); + + // Unloads a native library. + static void UnloadNativeLibrary(NativeLibrary library); + + private: + // Gets a function pointer from a native library. + static void* GetFunctionPointerFromNativeLibrary( + NativeLibrary library, + NativeLibraryFunctionNameType name); + bool internal_; // Whether this an internal plugin. WebPluginInfo web_plugin_info_; // supported mime types, description -#if defined(OS_WIN) - HMODULE module_; // the opened DLL handle -#endif + NativeLibrary library_; // the opened library reference NPPluginFuncs plugin_funcs_; // the struct of plugin side functions bool initialized_; // is the plugin initialized NPSavedData *saved_data_; // persisted plugin info for NPAPI |