Chromium Code Reviews| Index: components/nacl/loader/nonsfi/irt_ppapi.cc |
| diff --git a/components/nacl/loader/nonsfi/irt_ppapi.cc b/components/nacl/loader/nonsfi/irt_ppapi.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5102b75c996b9638618ac2638f2439b3646f87d9 |
| --- /dev/null |
| +++ b/components/nacl/loader/nonsfi/irt_ppapi.cc |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/logging.h" |
| + |
| +#include "components/nacl/loader/nonsfi/irt_interfaces.h" |
| +#include "native_client/src/untrusted/irt/irt_ppapi.h" |
|
Mark Seaborn
2014/02/13 06:18:25
I've moved this to ppapi/nacl_irt/irt_ppapi.h in a
hidehiko
2014/02/13 10:18:05
Oh, I didn't notice it. Done.
|
| +#include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h" |
| + |
| +namespace nacl { |
| +namespace nonsfi { |
| +namespace { |
| + |
| +struct PP_StartFunctions g_pp_functions; |
| + |
| +int IrtPpapiStart(const struct PP_StartFunctions* funcs) { |
| + g_pp_functions = *funcs; |
| + // TODO(hidehiko): Register this thread as main. (g_is_main_thread = 1.) |
| + return PpapiPluginMain(); |
| +} |
| + |
| +} // namespace |
| + |
| +const struct nacl_irt_ppapihook kIrtPpapiHook = { |
| + IrtPpapiStart, |
| + PpapiPluginRegisterThreadCreator, |
| +}; |
| + |
| +} // namespace nonsfi |
| +} // namespace nacl |
| + |
| +extern "C" { |
|
Mark Seaborn
2014/02/13 06:18:25
Nit: You shouldn't need this 'extern' if you #incl
hidehiko
2014/02/13 10:18:05
Done.
|
| + |
| +int32_t PPP_InitializeModule(PP_Module module_id, |
| + PPB_GetInterface get_browser_interface) { |
| + return nacl::nonsfi::g_pp_functions.PPP_InitializeModule( |
| + module_id, get_browser_interface); |
| +} |
| + |
| +void PPP_ShutdownModule(void) { |
| + nacl::nonsfi::g_pp_functions.PPP_ShutdownModule(); |
| +} |
| + |
| +const void *PPP_GetInterface(const char *interface_name) { |
| + const void* result = |
| + nacl::nonsfi::g_pp_functions.PPP_GetInterface(interface_name); |
| + return result; |
| +} |
| + |
| +} // extern "C" |