Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: webkit/glue/plugins/pepper_plugin_module.h

Issue 2843018: Add in support for internal pepper plugins into the PepperPluginRegistry and pepper::PluginModule. (Closed) Base URL: git://codf21.jail.google.com/chromium.git
Patch Set: Add new entrypoint to match ToT ppapi Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/remoting.gyp ('k') | webkit/glue/plugins/pepper_plugin_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_plugin_module.h
diff --git a/webkit/glue/plugins/pepper_plugin_module.h b/webkit/glue/plugins/pepper_plugin_module.h
index 0498c451d6a289f2f66a0ff2e6fd629e4ddac755..1b2d9fb60ad075a6d18b00ad8a9806942e117423 100644
--- a/webkit/glue/plugins/pepper_plugin_module.h
+++ b/webkit/glue/plugins/pepper_plugin_module.h
@@ -12,6 +12,7 @@
#include "base/native_library.h"
#include "base/ref_counted.h"
#include "third_party/ppapi/c/pp_module.h"
+#include "third_party/ppapi/c/ppb.h"
namespace pepper {
@@ -20,9 +21,27 @@ class PluginInstance;
class PluginModule : public base::RefCounted<PluginModule> {
public:
+ typedef const void* (*PPP_GetInterfaceFunc)(const char*);
+ typedef int (*PPP_InitializeModuleFunc)(PP_Module, PPB_GetInterface);
+ typedef void (*PPP_ShutdownModuleFunc)();
+
+ struct EntryPoints {
+ EntryPoints()
+ : get_interface(NULL),
+ initialize_module(NULL),
+ shutdown_module(NULL) {
+ }
+
+ PPP_GetInterfaceFunc get_interface;
+ PPP_InitializeModuleFunc initialize_module;
+ PPP_ShutdownModuleFunc shutdown_module;
+ };
+
~PluginModule();
- static scoped_refptr<PluginModule> CreateModule(const FilePath& filename);
+ static scoped_refptr<PluginModule> CreateModule(const FilePath& path);
+ static scoped_refptr<PluginModule> CreateInternalModule(
+ EntryPoints entry_points);
// Converts the given module ID to an actual module object. Will return NULL
// if the module is invalid.
@@ -47,18 +66,24 @@ class PluginModule : public base::RefCounted<PluginModule> {
void InstanceDeleted(PluginInstance* instance);
private:
- typedef const void* (*PPP_GetInterfaceFunc)(const char*);
-
- explicit PluginModule(const FilePath& filename);
+ PluginModule();
- bool Load();
-
- FilePath filename_;
+ bool InitFromEntryPoints(const EntryPoints& entry_points);
+ bool InitFromFile(const FilePath& path);
+ static bool LoadEntryPoints(const base::NativeLibrary& library,
+ EntryPoints* entry_points);
bool initialized_;
+
+ // Holds a reference to the base::NativeLibrary handle if this PluginModule
+ // instance wraps functions loaded from a library. Can be NULL. If
+ // |library_| is non-NULL, PluginModule will attempt to unload the library
+ // during destruction.
base::NativeLibrary library_;
- PPP_GetInterfaceFunc ppp_get_interface_;
+ // Contains pointers to the entry points of the actual plugin
+ // implementation.
+ EntryPoints entry_points_;
// Non-owning pointers to all instances associated with this module. When
// there are no more instances, this object should be deleted.
« no previous file with comments | « remoting/remoting.gyp ('k') | webkit/glue/plugins/pepper_plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698