OLD | NEW |
(Empty) | |
| 1 // Copyright 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. |
| 4 |
| 5 #include "base/logging.h" |
| 6 |
| 7 #include "components/nacl/loader/nonsfi/irt_interfaces.h" |
| 8 #include "native_client/src/untrusted/irt/irt_ppapi.h" |
| 9 #include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h" |
| 10 |
| 11 namespace nacl { |
| 12 namespace nonsfi { |
| 13 namespace { |
| 14 |
| 15 struct PP_StartFunctions g_pp_functions; |
| 16 |
| 17 int IrtPpapiStart(const struct PP_StartFunctions* funcs) { |
| 18 LOG(ERROR) << "NACL-PLUGIN: IrtPpapiStart"; |
| 19 g_pp_functions = *funcs; |
| 20 // TODO: g_is_main_thread = 1 ? |
| 21 return PpapiPluginMain(); |
| 22 } |
| 23 |
| 24 } // namespace |
| 25 |
| 26 const struct nacl_irt_ppapihook kIrtPpapiHook = { |
| 27 IrtPpapiStart, |
| 28 PpapiPluginRegisterThreadCreator, |
| 29 }; |
| 30 |
| 31 } // namespace nonsfi |
| 32 } // namespace nacl |
| 33 |
| 34 extern "C" { |
| 35 int32_t PPP_InitializeModule(PP_Module module_id, |
| 36 PPB_GetInterface get_browser_interface) { |
| 37 return nacl::nonsfi::g_pp_functions.PPP_InitializeModule( |
| 38 module_id, get_browser_interface); |
| 39 } |
| 40 |
| 41 void PPP_ShutdownModule(void) { |
| 42 nacl::nonsfi::g_pp_functions.PPP_ShutdownModule(); |
| 43 } |
| 44 |
| 45 const void *PPP_GetInterface(const char *interface_name) { |
| 46 LOG(ERROR) << "NACL-PLUGIN: PPP_GetInterface: " << interface_name; |
| 47 const void* result = nacl::nonsfi::g_pp_functions.PPP_GetInterface( |
| 48 interface_name); |
| 49 LOG(ERROR) << "NACL-PLUGIN: PPP_GetInterface done: " << (uintptr_t)(result); |
| 50 return result; |
| 51 } |
| 52 } // extern "C" |
OLD | NEW |