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

Unified 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, 11 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 side-by-side diff with in-line comments
Download patch
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..e208f901c3e28fb2690b11b6712fb6a1067f2cde
--- /dev/null
+++ b/components/nacl/loader/nonsfi/irt_ppapi.cc
@@ -0,0 +1,62 @@
+// 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"
+#include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h"
+#include "ppapi/shared_impl/ppb_audio_shared.h"
+
+
+namespace nacl {
+namespace nonsfi {
+namespace {
+
+struct PP_StartFunctions g_pp_functions;
+
+int IrtPpapiStart(const struct PP_StartFunctions* funcs) {
+ LOG(ERROR) << "NACL-PLUGIN: IrtPpapiStart";
+ g_pp_functions = *funcs;
+ // TODO: g_is_main_thread = 1 ?
+ return PpapiPluginMain();
+}
+
+void PpapiPluginRegisterThreadCreator(
+ const struct PP_ThreadFunctions* thread_functions) {
+ // TODO
+#if 0
+ ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions);
+#endif
+}
+
+} // namespace
+
+const struct nacl_irt_ppapihook kIrtPpapiHook = {
+ IrtPpapiStart,
+ PpapiPluginRegisterThreadCreator,
+};
+
+} // namespace nonsfi
+} // namespace nacl
+
+extern "C" {
+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) {
+ LOG(ERROR) << "NACL-PLUGIN: PPP_GetInterface: " << interface_name;
+ const void* result = nacl::nonsfi::g_pp_functions.PPP_GetInterface(
+ interface_name);
+ LOG(ERROR) << "NACL-PLUGIN: PPP_GetInterface done: " << (uintptr_t)(result);
+ return result;
+}
+} // extern "C"

Powered by Google App Engine
This is Rietveld 408576698