Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: components/nacl/loader/nonsfi/irt_ppapi.cc

Issue 139993009: [WIP] Yet another demo for BMM NaCl ppapi connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include "ppapi/shared_impl/ppb_audio_shared.h"
11
12
13 namespace nacl {
14 namespace nonsfi {
15 namespace {
16
17 struct PP_StartFunctions g_pp_functions;
18
19 int IrtPpapiStart(const struct PP_StartFunctions* funcs) {
20 LOG(ERROR) << "NACL-PLUGIN: IrtPpapiStart";
21 g_pp_functions = *funcs;
22 // TODO: g_is_main_thread = 1 ?
23 return PpapiPluginMain();
24 }
25
26 void PpapiPluginRegisterThreadCreator(
27 const struct PP_ThreadFunctions* thread_functions) {
28 // TODO
29 #if 0
30 ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions);
31 #endif
32 }
33
34 } // namespace
35
36 const struct nacl_irt_ppapihook kIrtPpapiHook = {
37 IrtPpapiStart,
38 PpapiPluginRegisterThreadCreator,
39 };
40
41 } // namespace nonsfi
42 } // namespace nacl
43
44 extern "C" {
45 int32_t PPP_InitializeModule(PP_Module module_id,
46 PPB_GetInterface get_browser_interface) {
47 return nacl::nonsfi::g_pp_functions.PPP_InitializeModule(
48 module_id, get_browser_interface);
49 }
50
51 void PPP_ShutdownModule(void) {
52 nacl::nonsfi::g_pp_functions.PPP_ShutdownModule();
53 }
54
55 const void *PPP_GetInterface(const char *interface_name) {
56 LOG(ERROR) << "NACL-PLUGIN: PPP_GetInterface: " << interface_name;
57 const void* result = nacl::nonsfi::g_pp_functions.PPP_GetInterface(
58 interface_name);
59 LOG(ERROR) << "NACL-PLUGIN: PPP_GetInterface done: " << (uintptr_t)(result);
60 return result;
61 }
62 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698