diff options
author | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 15:24:28 +0000 |
---|---|---|
committer | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-14 15:24:28 +0000 |
commit | 387b36435f0ca05a922558d1e577748cbf1a8786 (patch) | |
tree | a8e5fc51ddbc99b7be93016bb55376f8f1bee07e /components/nacl | |
parent | 911807d9bccc8bbfba1fe8033bdc7b0adadb1484 (diff) | |
download | chromium_src-387b36435f0ca05a922558d1e577748cbf1a8786.zip chromium_src-387b36435f0ca05a922558d1e577748cbf1a8786.tar.gz chromium_src-387b36435f0ca05a922558d1e577748cbf1a8786.tar.bz2 |
Add very simple loading test for non-SFI NaCl.
This is the first step to add test cases for non-SFI NaCl.
The testee binary is build by a new target rule introduced by this CL, which is relocatable/libc-free binary. The code has a minimum set of handlers for irt_ppapi, to load the plugin successfully done with communicating hosts (browser/renderer processes).
Along this change, some DCHECK errors are found. So they're fixed, too.
1) AtExitManager is conflicting. In non-SFI mode, AtExitManager is already instantiated in nacl_helper. To avoid the conflicting, skip to create it in plugin_main_irt.cc.
2) Allowed creating Singleton on the plugin's main thread.
3) SRPC may be successfully done, and then NOTREACHED catch it in nacl_listener. It is false alarm, so removed it.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3734
TEST=run ./browser_tests --gtest_filter=NaCl*NonSFI* locally. Run trybots.
Review URL: https://codereview.chromium.org/189553005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/nacl')
-rw-r--r-- | components/nacl/loader/nacl_listener.cc | 1 | ||||
-rw-r--r-- | components/nacl/loader/nonsfi/nonsfi_main.cc | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc index 4a4efef..b5ee5f7 100644 --- a/components/nacl/loader/nacl_listener.cc +++ b/components/nacl/loader/nacl_listener.cc @@ -423,7 +423,6 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { #if defined(OS_LINUX) if (params.uses_nonsfi_mode) { nacl::nonsfi::MainStart(args->imc_bootstrap_handle); - NOTREACHED(); return; } #endif diff --git a/components/nacl/loader/nonsfi/nonsfi_main.cc b/components/nacl/loader/nonsfi/nonsfi_main.cc index 87fbc1b..5293498e 100644 --- a/components/nacl/loader/nonsfi/nonsfi_main.cc +++ b/components/nacl/loader/nonsfi/nonsfi_main.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/threading/platform_thread.h" +#include "base/threading/thread_restrictions.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" @@ -38,6 +39,9 @@ class PluginMainDelegate : public base::PlatformThread::Delegate { virtual void ThreadMain() OVERRIDE { base::PlatformThread::SetName("NaClMainThread"); + // This will only happen once per process, so we give the permission to + // create Singletons. + base::ThreadRestrictions::SetSingletonAllowed(true); uintptr_t info[] = { 0, // Do not use fini. 0, // envc. |