summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-21 06:07:53 +0000
committerloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-21 06:07:53 +0000
commit48977dbb85422ade0a5a488f3b9656d3c5d0bc80 (patch)
tree1eff283a23ca552e097ce6a4b7c96ace7e0011d4
parent3d41a2a63bbd307fcee6e6c5547ce5fe29e2f4a5 (diff)
downloadchromium_src-48977dbb85422ade0a5a488f3b9656d3c5d0bc80.zip
chromium_src-48977dbb85422ade0a5a488f3b9656d3c5d0bc80.tar.gz
chromium_src-48977dbb85422ade0a5a488f3b9656d3c5d0bc80.tar.bz2
Revert "Connect PPAPI IPC channels for non-SFI mode."
This reverts commit 3d41a2a63bbd307fcee6e6c5547ce5fe29e2f4a5. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252506 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--components/nacl.gyp5
-rw-r--r--components/nacl/loader/DEPS3
-rw-r--r--components/nacl/loader/nacl_listener.cc52
-rw-r--r--components/nacl/loader/nonsfi/DEPS3
-rw-r--r--components/nacl/loader/nonsfi/irt_interfaces.cc1
-rw-r--r--components/nacl/loader/nonsfi/irt_interfaces.h1
-rw-r--r--components/nacl/loader/nonsfi/irt_ppapi.cc44
-rw-r--r--components/nacl/loader/nonsfi/nonsfi_main.cc61
-rw-r--r--ipc/ipc_channel.h6
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h3
-rw-r--r--ppapi/ppapi_proxy.gypi3
-rw-r--r--ppapi/proxy/irt_ppapi.c2
-rw-r--r--ppapi/proxy/plugin_main_irt.h31
-rw-r--r--ppapi/proxy/plugin_main_nacl.cc (renamed from ppapi/proxy/plugin_main_irt.cc)57
14 files changed, 39 insertions, 233 deletions
diff --git a/components/nacl.gyp b/components/nacl.gyp
index 3f67983..8f0ff77f 100644
--- a/components/nacl.gyp
+++ b/components/nacl.gyp
@@ -181,11 +181,9 @@
'dependencies': [
'nacl',
'nacl_common',
- '../components/tracing.gyp:tracing',
'../crypto/crypto.gyp:crypto',
'../sandbox/sandbox.gyp:libc_urandom_override',
'../sandbox/sandbox.gyp:sandbox',
- '../ppapi/ppapi_internal.gyp:ppapi_proxy',
],
'defines': [
'<@(nacl_defines)',
@@ -208,7 +206,6 @@
'nacl/loader/nonsfi/irt_interfaces.cc',
'nacl/loader/nonsfi/irt_interfaces.h',
'nacl/loader/nonsfi/irt_memory.cc',
- 'nacl/loader/nonsfi/irt_ppapi.cc',
'nacl/loader/nonsfi/irt_thread.cc',
'nacl/loader/nonsfi/irt_util.h',
'nacl/loader/nonsfi/nonsfi_main.cc',
@@ -219,8 +216,6 @@
'../content/common/sandbox_linux/sandbox_init_linux.cc',
'../content/common/sandbox_linux/sandbox_seccomp_bpf_linux.cc',
'../content/public/common/content_switches.cc',
- '../ppapi/proxy/plugin_main_irt.cc',
- '../ppapi/proxy/plugin_main_irt.h',
],
'conditions': [
['toolkit_uses_gtk == 1', {
diff --git a/components/nacl/loader/DEPS b/components/nacl/loader/DEPS
index 6167777..8345fef 100644
--- a/components/nacl/loader/DEPS
+++ b/components/nacl/loader/DEPS
@@ -22,9 +22,6 @@ include_rules = [
"+ppapi/proxy/nacl_message_scanner.h",
"+ppapi/proxy/serialized_handle.h",
- # For setting FDs in non-SFI mode.
- "+ppapi/proxy/plugin_main_irt.h",
-
# For sending PpapiHostMsg_ChannelCreated in nacl_ipc_adapter.cc:
"+ppapi/proxy/ppapi_messages.h"
]
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc
index 4bafc8c..c35d946 100644
--- a/components/nacl/loader/nacl_listener.cc
+++ b/components/nacl/loader/nacl_listener.cc
@@ -35,7 +35,6 @@
#if defined(OS_LINUX)
#include "components/nacl/loader/nonsfi/nonsfi_main.h"
#include "content/public/common/child_process_sandbox_support_linux.h"
-#include "ppapi/proxy/plugin_main_irt.h"
#endif
#if defined(OS_WIN)
@@ -280,54 +279,19 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
}
if (params.enable_ipc_proxy) {
+ // Create the PPAPI IPC channels between the NaCl IRT and the hosts
+ // (browser/renderer) processes. The IRT uses these channels to communicate
+ // with the host and to initialize the IPC dispatchers.
IPC::ChannelHandle browser_handle =
IPC::Channel::GenerateVerifiedChannelID("nacl");
+ SetUpIPCAdapter(&browser_handle, io_thread_.message_loop_proxy(),
+ nap, NACL_CHROME_DESC_BASE);
+
IPC::ChannelHandle renderer_handle =
IPC::Channel::GenerateVerifiedChannelID("nacl");
+ SetUpIPCAdapter(&renderer_handle, io_thread_.message_loop_proxy(),
+ nap, NACL_CHROME_DESC_BASE + 1);
-#if defined(OS_LINUX)
- if (params.enable_nonsfi_mode) {
- // In non-SFI mode, we neither intercept nor rewrite the message using
- // NaClIPCAdapter, and the channels are connected between the plugin and
- // the hosts directly. So, the IPC::Channel instances will be created in
- // the plugin side, because the IPC::Listener needs to live on the
- // plugin's main thread. However, on initialization (i.e. before loading
- // the plugin binary), the FD needs to be passed to the hosts. So, here
- // we create raw FD pairs, and pass the client side FDs to the hosts,
- // and the server side FDs to the plugin.
- int browser_server_ppapi_fd;
- int browser_client_ppapi_fd;
- int renderer_server_ppapi_fd;
- int renderer_client_ppapi_fd;
- if (!IPC::SocketPair(
- &browser_server_ppapi_fd, &browser_client_ppapi_fd) ||
- !IPC::SocketPair(
- &renderer_server_ppapi_fd, &renderer_client_ppapi_fd)) {
- LOG(ERROR) << "Failed to create sockets for IPC.";
- return;
- }
-
- // Set the plugin IPC channel FDs.
- SetIPCFileDescriptors(
- browser_server_ppapi_fd, renderer_server_ppapi_fd);
-
- // Send back to the client side IPC channel FD to the host.
- browser_handle.socket =
- base::FileDescriptor(browser_client_ppapi_fd, true);
- renderer_handle.socket =
- base::FileDescriptor(renderer_client_ppapi_fd, true);
- } else {
-#endif
- // Create the PPAPI IPC channels between the NaCl IRT and the host
- // (browser/renderer) processes. The IRT uses these channels to
- // communicate with the host and to initialize the IPC dispatchers.
- SetUpIPCAdapter(&browser_handle, io_thread_.message_loop_proxy(),
- nap, NACL_CHROME_DESC_BASE);
- SetUpIPCAdapter(&renderer_handle, io_thread_.message_loop_proxy(),
- nap, NACL_CHROME_DESC_BASE + 1);
-#if defined(OS_LINUX)
- }
-#endif
if (!Send(new NaClProcessHostMsg_PpapiChannelsCreated(
browser_handle, renderer_handle)))
LOG(ERROR) << "Failed to send IPC channel handle to NaClProcessHost.";
diff --git a/components/nacl/loader/nonsfi/DEPS b/components/nacl/loader/nonsfi/DEPS
deleted file mode 100644
index fa6de5d..0000000
--- a/components/nacl/loader/nonsfi/DEPS
+++ /dev/null
@@ -1,3 +0,0 @@
-include_rules = [
- "+ppapi/nacl_irt",
-]
diff --git a/components/nacl/loader/nonsfi/irt_interfaces.cc b/components/nacl/loader/nonsfi/irt_interfaces.cc
index 4364bb8..c53c795 100644
--- a/components/nacl/loader/nonsfi/irt_interfaces.cc
+++ b/components/nacl/loader/nonsfi/irt_interfaces.cc
@@ -29,7 +29,6 @@ const NaClInterfaceTable kIrtInterfaces[] = {
NACL_INTERFACE_TABLE(NACL_IRT_FUTEX_v0_1, kIrtFutex),
NACL_INTERFACE_TABLE(NACL_IRT_TLS_v0_1, kIrtTls),
NACL_INTERFACE_TABLE(NACL_IRT_CLOCK_v0_1, kIrtClock),
- NACL_INTERFACE_TABLE(NACL_IRT_PPAPIHOOK_v0_1, kIrtPpapiHook),
};
#undef NACL_INTERFACE_TABLE
diff --git a/components/nacl/loader/nonsfi/irt_interfaces.h b/components/nacl/loader/nonsfi/irt_interfaces.h
index a2bf468..78c5bf0 100644
--- a/components/nacl/loader/nonsfi/irt_interfaces.h
+++ b/components/nacl/loader/nonsfi/irt_interfaces.h
@@ -21,7 +21,6 @@ extern const struct nacl_irt_thread kIrtThread;
extern const struct nacl_irt_futex kIrtFutex;
extern const struct nacl_irt_tls kIrtTls;
extern const struct nacl_irt_clock kIrtClock;
-extern const struct nacl_irt_ppapihook kIrtPpapiHook;
} // namespace nonsfi
} // namespace nacl
diff --git a/components/nacl/loader/nonsfi/irt_ppapi.cc b/components/nacl/loader/nonsfi/irt_ppapi.cc
deleted file mode 100644
index ebe2893..0000000
--- a/components/nacl/loader/nonsfi/irt_ppapi.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// 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 "ppapi/c/ppp.h"
-#include "ppapi/nacl_irt/irt_ppapi.h"
-#include "ppapi/proxy/plugin_main_irt.h"
-
-namespace nacl {
-namespace nonsfi {
-namespace {
-
-struct PP_StartFunctions g_pp_functions;
-
-int IrtPpapiStart(const struct PP_StartFunctions* funcs) {
- g_pp_functions = *funcs;
- return PpapiPluginMain();
-}
-
-} // namespace
-
-const struct nacl_irt_ppapihook kIrtPpapiHook = {
- IrtPpapiStart,
- PpapiPluginRegisterThreadCreator,
-};
-
-} // namespace nonsfi
-} // namespace nacl
-
-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) {
- return nacl::nonsfi::g_pp_functions.PPP_GetInterface(interface_name);
-}
diff --git a/components/nacl/loader/nonsfi/nonsfi_main.cc b/components/nacl/loader/nonsfi/nonsfi_main.cc
index 87fbc1b..d9847c52 100644
--- a/components/nacl/loader/nonsfi/nonsfi_main.cc
+++ b/components/nacl/loader/nonsfi/nonsfi_main.cc
@@ -4,10 +4,8 @@
#include "components/nacl/loader/nonsfi/nonsfi_main.h"
-#include "base/debug/leak_annotations.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/threading/platform_thread.h"
#include "components/nacl/loader/nonsfi/elf_loader.h"
#include "components/nacl/loader/nonsfi/irt_interfaces.h"
#include "native_client/src/include/elf_auxv.h"
@@ -24,41 +22,6 @@ namespace nacl {
namespace nonsfi {
namespace {
-typedef void (*EntryPointType)(uintptr_t*);
-
-class PluginMainDelegate : public base::PlatformThread::Delegate {
- public:
- explicit PluginMainDelegate(EntryPointType entry_point)
- : entry_point_(entry_point) {
- }
-
- virtual ~PluginMainDelegate() {
- }
-
- virtual void ThreadMain() OVERRIDE {
- base::PlatformThread::SetName("NaClMainThread");
-
- uintptr_t info[] = {
- 0, // Do not use fini.
- 0, // envc.
- 0, // argc.
- 0, // Null terminate for argv.
- 0, // Null terminate for envv.
- AT_SYSINFO,
- reinterpret_cast<uintptr_t>(&NaClIrtInterface),
- AT_NULL,
- 0, // Null terminate for auxv.
- };
- entry_point_(info);
- }
-
- private:
- EntryPointType entry_point_;
-};
-
-// Default stack size of the plugin main thread. We heuristically chose 16M.
-const size_t kStackSize = (16 << 20);
-
struct NaClDescUnrefer {
void operator()(struct NaClDesc* desc) const {
NaClDescUnref(desc);
@@ -83,16 +46,22 @@ void LoadModuleRpc(struct NaClSrpcRpc* rpc,
return;
}
- EntryPointType entry_point =
- reinterpret_cast<EntryPointType>(image.entry_point());
- if (!base::PlatformThread::CreateNonJoinable(
- kStackSize, new PluginMainDelegate(entry_point))) {
- LOG(ERROR) << "LoadModuleRpc: Failed to create plugin main thread.";
- return;
- }
-
+ uintptr_t entry_point = image.entry_point();
rpc->result = NACL_SRPC_RESULT_OK;
- (*done_cls->Run)(done_cls);
+
+ // Run for testing. TODO(hidehiko): Remove this.
+ uintptr_t info[] = {
+ 0, // Do not use fini.
+ 0, // envc.
+ 0, // argc.
+ 0, // Null terminate for argv.
+ 0, // Null terminate for envv.
+ AT_SYSINFO,
+ reinterpret_cast<uintptr_t>(&NaClIrtInterface),
+ AT_NULL,
+ 0, // Null terminate for auxv.
+ };
+ reinterpret_cast<void (*)(uintptr_t*)>(entry_point)(info);
}
const static struct NaClSrpcHandlerDesc kNonSfiServiceHandlers[] = {
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index bfa5ec6..7e09a80 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -217,12 +217,6 @@ class IPC_EXPORT Channel : public Sender {
ChannelImpl *channel_impl_;
};
-#if defined(OS_POSIX)
-// SocketPair() creates a pair of socket FDs suitable for using with
-// IPC::Channel.
-IPC_EXPORT bool SocketPair(int* fd1, int* fd2);
-#endif
-
} // namespace IPC
#endif // IPC_IPC_CHANNEL_H_
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h b/ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h
index ac23a34..c7fe8a0 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h
@@ -15,6 +15,9 @@ EXTERN_C_BEGIN
// The entry point for the main thread of the PPAPI plugin process.
int PpapiPluginMain(void);
+void PpapiPluginRegisterThreadCreator(
+ const struct PP_ThreadFunctions* new_funcs);
+
EXTERN_C_END
#endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_
diff --git a/ppapi/ppapi_proxy.gypi b/ppapi/ppapi_proxy.gypi
index d6fc604..f345414 100644
--- a/ppapi/ppapi_proxy.gypi
+++ b/ppapi/ppapi_proxy.gypi
@@ -112,6 +112,7 @@
'proxy/plugin_dispatcher.h',
'proxy/plugin_globals.cc',
'proxy/plugin_globals.h',
+ 'proxy/plugin_main_nacl.cc',
'proxy/plugin_message_filter.cc',
'proxy/plugin_message_filter.h',
'proxy/plugin_resource.cc',
@@ -243,8 +244,6 @@
['>(nacl_untrusted_build)==1', {
'sources': [
'proxy/irt_ppapi.c',
- 'proxy/plugin_main_irt.cc',
- 'proxy/plugin_main_irt.h',
],
'sources!': [
'proxy/audio_input_resource.cc',
diff --git a/ppapi/proxy/irt_ppapi.c b/ppapi/proxy/irt_ppapi.c
index 24dafdb..be6a216 100644
--- a/ppapi/proxy/irt_ppapi.c
+++ b/ppapi/proxy/irt_ppapi.c
@@ -8,7 +8,7 @@
#include "native_client/src/untrusted/irt/irt.h"
#include "native_client/src/untrusted/irt/irt_private.h"
#include "ppapi/nacl_irt/irt_ppapi.h"
-#include "ppapi/proxy/plugin_main_irt.h"
+#include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h"
struct PP_StartFunctions g_pp_functions;
diff --git a/ppapi/proxy/plugin_main_irt.h b/ppapi/proxy/plugin_main_irt.h
deleted file mode 100644
index f9a24cb..0000000
--- a/ppapi/proxy/plugin_main_irt.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// 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.
-
-#ifndef PPAPI_PROXY_PLUGIN_MAIN_IRT_H_
-#define PPAPI_PROXY_PLUGIN_MAIN_IRT_H_
-
-#include "ppapi/nacl_irt/irt_ppapi.h"
-#include "ppapi/proxy/ppapi_proxy_export.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// The entry point for the main thread of the PPAPI plugin process.
-PPAPI_PROXY_EXPORT int PpapiPluginMain(void);
-
-PPAPI_PROXY_EXPORT void PpapiPluginRegisterThreadCreator(
- const struct PP_ThreadFunctions* new_funcs);
-
-// Sets the IPC channels for the browser and the renderer by the given FD
-// numbers. This will be used for non-SFI mode. Must be called before
-// PpapiPluginMain is called.
-PPAPI_PROXY_EXPORT void SetIPCFileDescriptors(
- int browser_ipc_fd, int renderer_ipc_fd);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // PPAPI_PROXY_PLUGIN_MAIN_IRT_H_
diff --git a/ppapi/proxy/plugin_main_irt.cc b/ppapi/proxy/plugin_main_nacl.cc
index a3ea6c1..c84828d 100644
--- a/ppapi/proxy/plugin_main_irt.cc
+++ b/ppapi/proxy/plugin_main_nacl.cc
@@ -1,10 +1,9 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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 "ppapi/proxy/plugin_main_irt.h"
-
#include <unistd.h>
+
#include <map>
#include <set>
@@ -14,7 +13,6 @@
// IPC_MESSAGE_MACROS_LOG_ENABLED so ppapi_messages.h will generate the
// ViewMsgLog et al. functions.
-#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
@@ -25,8 +23,11 @@
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_message.h"
+#include "native_client/src/public/chrome_main.h"
+#include "native_client/src/shared/srpc/nacl_srpc.h"
#include "ppapi/c/ppp.h"
#include "ppapi/c/ppp_instance.h"
+#include "ppapi/native_client/src/shared/ppapi_proxy/ppruntime.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_globals.h"
#include "ppapi/proxy/plugin_message_filter.h"
@@ -35,11 +36,6 @@
#include "ppapi/shared_impl/ppapi_switches.h"
#include "ppapi/shared_impl/ppb_audio_shared.h"
-#if defined(__native_client__)
-#include "native_client/src/public/chrome_main.h"
-#include "native_client/src/shared/srpc/nacl_srpc.h"
-#endif
-
#if defined(IPC_MESSAGE_LOG_ENABLED)
#include "base/containers/hash_tables.h"
@@ -60,19 +56,6 @@ using ppapi::proxy::SerializedHandle;
namespace {
-#if defined(__native_client__)
-// In SFI mode, the FDs of IPC channels are NACL_CHROME_DESC_BASE and its
-// successor, which is set in nacl_listener.cc.
-int g_nacl_ipc_browser_fd = NACL_CHROME_DESC_BASE;
-int g_nacl_ipc_renderer_fd = NACL_CHROME_DESC_BASE + 1;
-#else
-// In non-SFI mode, the FDs of IPC channels are different from the hard coded
-// ones. These values will be set by SetIPCFileDescriptors() below.
-// At first, both are initialized to invalid FD number (-1).
-int g_nacl_ipc_browser_fd = -1;
-int g_nacl_ipc_renderer_fd = -1;
-#endif
-
// This class manages communication between the plugin and the browser, and
// manages the PluginDispatcher instances for communication between the plugin
// and the renderer.
@@ -130,10 +113,10 @@ PpapiDispatcher::PpapiDispatcher(scoped_refptr<base::MessageLoopProxy> io_loop)
: next_plugin_dispatcher_id_(0),
message_loop_(io_loop),
shutdown_event_(true, false) {
- DCHECK_NE(g_nacl_ipc_browser_fd, -1)
- << "g_nacl_ipc_browser_fd must be initialized before the plugin starts";
+ // The first FD (based on NACL_CHROME_DESC_BASE) is the IPC channel to the
+ // browser.
IPC::ChannelHandle channel_handle(
- "NaCl IPC", base::FileDescriptor(g_nacl_ipc_browser_fd, false));
+ "NaCl IPC", base::FileDescriptor(NACL_CHROME_DESC_BASE, false));
// Delay initializing the SyncChannel until after we add filters. This
// ensures that the filters won't miss any messages received by
@@ -266,10 +249,10 @@ void PpapiDispatcher::OnMsgInitializeNaClDispatcher(
new PluginDispatcher(::PPP_GetInterface, args.permissions,
args.off_the_record);
// The channel handle's true name is not revealed here.
- DCHECK_NE(g_nacl_ipc_renderer_fd, -1)
- << "g_nacl_ipc_renderer_fd must be initialized before the plugin starts";
+ // The second FD (based on NACL_CHROME_DESC_BASE) is the IPC channel to the
+ // renderer.
IPC::ChannelHandle channel_handle(
- "nacl", base::FileDescriptor(g_nacl_ipc_renderer_fd, false));
+ "nacl", base::FileDescriptor(NACL_CHROME_DESC_BASE + 1, false));
if (!dispatcher->InitPluginWithChannel(this, base::kNullProcessId,
channel_handle, false)) {
delete dispatcher;
@@ -308,41 +291,24 @@ void PpapiDispatcher::SetPpapiKeepAliveThrottleFromCommandLine() {
} // namespace
-void SetIPCFileDescriptors(int ipc_browser_fd, int ipc_renderer_fd) {
- g_nacl_ipc_browser_fd = ipc_browser_fd;
- g_nacl_ipc_renderer_fd = ipc_renderer_fd;
-}
-
void PpapiPluginRegisterThreadCreator(
const struct PP_ThreadFunctions* thread_functions) {
-#if defined(__native_client__)
- // TODO(hidehiko): The thread creation for the PPB_Audio is not yet
- // implemented on non-SFI mode. Support this. Now, this function invocation
- // is just ignored.
-
// Initialize all classes that need to create threads that call back into
// user code.
ppapi::PPB_Audio_Shared::SetThreadFunctions(thread_functions);
-#endif
}
int PpapiPluginMain() {
// Though it isn't referenced here, we must instantiate an AtExitManager.
base::AtExitManager exit_manager;
base::MessageLoop loop;
-#if defined(IPC_MESSAGE_LOG_ENABLED)
IPC::Logging::set_log_function_map(&g_log_function_mapping);
-#endif
ppapi::proxy::PluginGlobals plugin_globals;
base::Thread io_thread("Chrome_NaClIOThread");
base::Thread::Options options;
options.message_loop_type = base::MessageLoop::TYPE_IO;
io_thread.StartWithOptions(options);
-#if defined(__native_client__)
- // Currently on non-SFI mode, we don't use SRPC server on plugin.
- // TODO(hidehiko): Make sure this SRPC is actually used on SFI-mode.
-
// Start up the SRPC server on another thread. Otherwise, when it blocks
// on an RPC, the PPAPI proxy will hang. Do this before we initialize the
// module and start the PPAPI proxy so that the NaCl plugin can continue
@@ -351,7 +317,6 @@ int PpapiPluginMain() {
if (!NaClSrpcAcceptClientOnThread(srpc_methods)) {
return 1;
}
-#endif
PpapiDispatcher ppapi_dispatcher(io_thread.message_loop_proxy());
plugin_globals.set_plugin_proxy_delegate(&ppapi_dispatcher);