This source file includes following definitions.
- PSGetInstanceId
- PSGetInterface
- CreateInstance
- CreateModule
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/module.h"
#include "ppapi_simple/ps.h"
static pp::Instance* s_Instance = NULL;
PP_Instance PSGetInstanceId() {
return s_Instance->pp_instance();
}
const void* PSGetInterface(const char *name) {
return pp::Module::Get()->GetBrowserInterface(name);
}
class PSModule : public pp::Module {
public:
PSModule() : pp::Module() {}
virtual ~PSModule() {}
virtual pp::Instance* CreateInstance(PP_Instance instance) {
s_Instance = static_cast<pp::Instance*>(PSUserCreateInstance(instance));
return s_Instance;
}
};
namespace pp {
Module* CreateModule() {
return new PSModule();
}
}