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