| Index: components/nacl/loader/nonsfi/nonsfi_main.cc
|
| diff --git a/components/nacl/loader/nonsfi/nonsfi_main.cc b/components/nacl/loader/nonsfi/nonsfi_main.cc
|
| index 4fdb77a88a602c4e085ca5f7659f8df9557141d0..f016e1660faf15a66f73ad54c8bf38b4b9229fde 100644
|
| --- a/components/nacl/loader/nonsfi/nonsfi_main.cc
|
| +++ b/components/nacl/loader/nonsfi/nonsfi_main.cc
|
| @@ -8,17 +8,11 @@
|
| #include "base/threading/platform_thread.h"
|
| #include "base/threading/thread_restrictions.h"
|
| #include "native_client/src/include/elf_auxv.h"
|
| -
|
| -#if defined(OS_NACL_NONSFI)
|
| #include "native_client/src/public/nonsfi/elf_loader.h"
|
| #include "ppapi/nacl_irt/irt_interfaces.h"
|
| -#else
|
| -#include "base/memory/scoped_ptr.h"
|
| -#include "components/nacl/loader/nonsfi/elf_loader.h"
|
| -#include "components/nacl/loader/nonsfi/irt_interfaces.h"
|
| -#include "native_client/src/include/nacl_macros.h"
|
| -#include "native_client/src/public/nacl_desc.h"
|
| -#include "native_client/src/trusted/service_runtime/include/sys/fcntl.h"
|
| +
|
| +#if !defined(OS_NACL_NONSFI)
|
| +#error "nonsfi_main.cc must be built for nacl_helper_nonsfi."
|
| #endif
|
|
|
| namespace nacl {
|
| @@ -48,11 +42,7 @@ class PluginMainDelegate : public base::PlatformThread::Delegate {
|
| 0, // Null terminate for argv.
|
| 0, // Null terminate for envv.
|
| AT_SYSINFO,
|
| -#if defined(OS_NACL_NONSFI)
|
| reinterpret_cast<uintptr_t>(&chrome_irt_query),
|
| -#else
|
| - reinterpret_cast<uintptr_t>(&NaClIrtInterface),
|
| -#endif
|
| AT_NULL,
|
| 0, // Null terminate for auxv.
|
| };
|
| @@ -66,37 +56,11 @@ class PluginMainDelegate : public base::PlatformThread::Delegate {
|
| // Default stack size of the plugin main thread. We heuristically chose 16M.
|
| const size_t kStackSize = (16 << 20);
|
|
|
| -#if !defined(OS_NACL_NONSFI)
|
| -struct NaClDescUnrefer {
|
| - void operator()(struct NaClDesc* desc) const {
|
| - NaClDescUnref(desc);
|
| - }
|
| -};
|
| -#endif
|
| -
|
| } // namespace
|
|
|
| void MainStart(int nexe_file) {
|
| -#if defined(OS_NACL_NONSFI)
|
| EntryPointType entry_point =
|
| reinterpret_cast<EntryPointType>(NaClLoadElfFile(nexe_file));
|
| -#else
|
| - ::scoped_ptr<struct NaClDesc, NaClDescUnrefer> desc(
|
| - NaClDescIoMakeFromHandle(nexe_file, NACL_ABI_O_RDONLY));
|
| - ElfImage image;
|
| - if (image.Read(desc.get()) != LOAD_OK) {
|
| - LOG(ERROR) << "LoadModuleRpc: Failed to read binary.";
|
| - return;
|
| - }
|
| -
|
| - if (image.Load(desc.get()) != LOAD_OK) {
|
| - LOG(ERROR) << "LoadModuleRpc: Failed to load the image";
|
| - return;
|
| - }
|
| -
|
| - EntryPointType entry_point =
|
| - reinterpret_cast<EntryPointType>(image.entry_point());
|
| -#endif
|
| if (!base::PlatformThread::CreateNonJoinable(
|
| kStackSize, new PluginMainDelegate(entry_point))) {
|
| LOG(ERROR) << "LoadModuleRpc: Failed to create plugin main thread.";
|
|
|