| Index: content/renderer/pepper/plugin_module.h
|
| ===================================================================
|
| --- content/renderer/pepper/plugin_module.h (revision 213482)
|
| +++ content/renderer/pepper/plugin_module.h (working copy)
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_
|
| -#define WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_
|
| +#ifndef CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_
|
| +#define CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_
|
|
|
| #include <map>
|
| #include <set>
|
| @@ -16,15 +16,14 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/native_library.h"
|
| #include "base/process.h"
|
| +#include "content/common/content_export.h"
|
| +#include "content/public/common/pepper_plugin_info.h"
|
| +#include "content/renderer/pepper/plugin_delegate.h"
|
| #include "ppapi/c/pp_bool.h"
|
| #include "ppapi/c/pp_instance.h"
|
| -#include "ppapi/c/pp_module.h"
|
| -#include "ppapi/c/ppb.h"
|
| #include "ppapi/c/ppb_core.h"
|
| #include "ppapi/c/private/ppb_instance_private.h"
|
| #include "ppapi/shared_impl/ppapi_permissions.h"
|
| -#include "webkit/plugins/ppapi/plugin_delegate.h"
|
| -#include "webkit/plugins/webkit_plugins_export.h"
|
|
|
| typedef void* NPIdentifier;
|
|
|
| @@ -56,23 +55,10 @@
|
| //
|
| // Note: to get from a PP_Instance to a PluginInstance*, use the
|
| // ResourceTracker.
|
| -class WEBKIT_PLUGINS_EXPORT PluginModule :
|
| +class CONTENT_EXPORT PluginModule :
|
| public base::RefCounted<PluginModule>,
|
| public base::SupportsWeakPtr<PluginModule> {
|
| public:
|
| - typedef const void* (*GetInterfaceFunc)(const char*);
|
| - typedef int (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface);
|
| - typedef void (*PPP_ShutdownModuleFunc)();
|
| -
|
| - struct EntryPoints {
|
| - // This structure is POD, with the constructor initializing to NULL.
|
| - WEBKIT_PLUGINS_EXPORT EntryPoints();
|
| -
|
| - GetInterfaceFunc get_interface;
|
| - PPP_InitializeModuleFunc initialize_module;
|
| - PPP_ShutdownModuleFunc shutdown_module; // Optional, may be NULL.
|
| - };
|
| -
|
| // Allows the embedder to associate a class with this module. This is opaque
|
| // from the PluginModule's perspective (see Set/GetEmbedderState below) but
|
| // the module is in charge of deleting the class.
|
| @@ -91,11 +77,8 @@
|
| // tracks which modules are alive.
|
| PluginModule(const std::string& name,
|
| const base::FilePath& path,
|
| - PluginDelegate::ModuleLifetime* lifetime_delegate,
|
| const ::ppapi::PpapiPermissions& perms);
|
|
|
| - ~PluginModule();
|
| -
|
| // Sets the given class as being associated with this module. It will be
|
| // deleted when the module is destroyed. You can only set it once, subsequent
|
| // sets will assert.
|
| @@ -107,7 +90,8 @@
|
| // Initializes this module as an internal plugin with the given entrypoints.
|
| // This is used for "plugins" compiled into Chrome. Returns true on success.
|
| // False means that the plugin can not be used.
|
| - bool InitAsInternalPlugin(const EntryPoints& entry_points);
|
| + bool InitAsInternalPlugin(
|
| + const content::PepperPluginInfo::EntryPoints& entry_points);
|
|
|
| // Initializes this module using the given library path as the plugin.
|
| // Returns true on success. False means that the plugin can not be used.
|
| @@ -146,7 +130,7 @@
|
|
|
| // Returns a pointer to the local GetInterface function for retrieving
|
| // PPB interfaces.
|
| - static GetInterfaceFunc GetLocalGetInterfaceFunc();
|
| + static content::PepperPluginInfo::GetInterfaceFunc GetLocalGetInterfaceFunc();
|
|
|
| // Returns whether an interface is supported. This method can be called from
|
| // the browser process and used for interface matching before plugin
|
| @@ -218,14 +202,14 @@
|
| static void ResetHostGlobalsForTest();
|
|
|
| private:
|
| + friend class base::RefCounted<PluginModule>;
|
| + ~PluginModule();
|
| // Calls the InitializeModule entrypoint. The entrypoint must have been
|
| // set and the plugin must not be out of process (we don't maintain
|
| // entrypoints in that case).
|
| - bool InitializeModule(const EntryPoints& entry_points);
|
| + bool InitializeModule(
|
| + const content::PepperPluginInfo::EntryPoints& entry_points);
|
|
|
| - // Note: This may be null.
|
| - PluginDelegate::ModuleLifetime* lifetime_delegate_;
|
| -
|
| // See EmbedderState above.
|
| scoped_ptr<EmbedderState> embedder_state_;
|
|
|
| @@ -260,7 +244,7 @@
|
| // Contains pointers to the entry points of the actual plugin implementation.
|
| // These will be NULL for out-of-process plugins, which is indicated by the
|
| // presence of the out_of_process_proxy_ value.
|
| - EntryPoints entry_points_;
|
| + content::PepperPluginInfo::EntryPoints entry_points_;
|
|
|
| // The name and file location of the module.
|
| const std::string name_;
|
| @@ -280,4 +264,4 @@
|
| } // namespace ppapi
|
| } // namespace webkit
|
|
|
| -#endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_
|
| +#endif // CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_
|
|
|