Chromium Code Reviews| 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..9ae9d87ebea267bf0f05fed2acfdce5db4c91aa2 100644 |
| --- a/components/nacl/loader/nonsfi/nonsfi_main.cc |
| +++ b/components/nacl/loader/nonsfi/nonsfi_main.cc |
| @@ -8,19 +8,14 @@ |
| #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 |
| + |
|
Mark Seaborn
2015/10/15 18:10:10
Nit: don't add extra empty line
hidehiko
2015/10/19 04:39:17
Done.
|
| namespace nacl { |
| namespace nonsfi { |
| namespace { |
| @@ -48,11 +43,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 +57,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."; |