#ifndef MOJO_EXAMPLES_PEPPER_CONTAINER_APP_PLUGIN_MODULE_H_
#define MOJO_EXAMPLES_PEPPER_CONTAINER_APP_PLUGIN_MODULE_H_
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/native_library.h"
#include "base/scoped_native_library.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/ppp.h"
namespace ppapi {
class CallbackTracker;
}
namespace mojo {
namespace examples {
class PluginInstance;
class PluginModule : public base::RefCounted<PluginModule> {
public:
PluginModule();
scoped_ptr<PluginInstance> CreateInstance();
const void* GetPluginInterface(const char* name) const;
PP_Module pp_module() const { return 1; }
ppapi::CallbackTracker* callback_tracker() { return callback_tracker_.get(); }
private:
friend class base::RefCounted<PluginModule>;
struct EntryPoints {
EntryPoints();
PP_GetInterface_Func get_interface;
PP_InitializeModule_Func initialize_module;
PP_ShutdownModule_Func shutdown_module;
};
~PluginModule();
void Initialize();
base::ScopedNativeLibrary plugin_module_;
EntryPoints entry_points_;
scoped_refptr<ppapi::CallbackTracker> callback_tracker_;
DISALLOW_COPY_AND_ASSIGN(PluginModule);
};
}
}
#endif