1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/native_client/src/trusted/plugin/ppapi_entrypoints.h"
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/pp_module.h"
9 #include "ppapi/c/ppb.h"
10 #include "ppapi/cpp/module.h"
11 #include "ppapi/cpp/private/internal_module.h"
12 #include "ppapi/native_client/src/trusted/plugin/module_ppapi.h"
14 namespace nacl_plugin
{
16 int32_t PPP_InitializeModule(PP_Module module_id
,
17 PPB_GetInterface get_browser_interface
) {
18 plugin::ModulePpapi
* module
= new plugin::ModulePpapi();
19 if (!module
->InternalInit(module_id
, get_browser_interface
)) {
21 return PP_ERROR_FAILED
;
24 pp::InternalSetModuleSingleton(module
);
28 void PPP_ShutdownModule() {
29 delete pp::Module::Get();
30 pp::InternalSetModuleSingleton(NULL
);
33 const void* PPP_GetInterface(const char* interface_name
) {
34 if (!pp::Module::Get())
36 return pp::Module::Get()->GetPluginInterface(interface_name
);
39 } // namespace nacl_plugin