Chromium Code Reviews| Index: components/nacl/loader/nacl_listener.cc |
| diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc |
| index 427dd8c1584ad486c4084714cd69d8ba8faa7361..faa1e1193bf5daa6313d422b5deef351461c85f7 100644 |
| --- a/components/nacl/loader/nacl_listener.cc |
| +++ b/components/nacl/loader/nacl_listener.cc |
| @@ -5,6 +5,7 @@ |
| #include "components/nacl/loader/nacl_listener.h" |
| #include <errno.h> |
| +#include <fcntl.h> |
| #include <stdlib.h> |
| #if defined(OS_POSIX) |
| @@ -27,6 +28,7 @@ |
| #include "native_client/src/public/chrome_main.h" |
| #include "native_client/src/public/nacl_app.h" |
| #include "native_client/src/public/nacl_file_info.h" |
| +#include "native_client/src/trusted/service_runtime/include/sys/fcntl.h" |
| #if defined(OS_POSIX) |
| #include "base/file_descriptor_posix.h" |
| @@ -37,7 +39,6 @@ |
| #include "components/nacl/loader/nonsfi/nonsfi_main.h" |
| #include "content/public/common/child_process_sandbox_support_linux.h" |
| #include "native_client/src/trusted/desc/nacl_desc_io.h" |
| -#include "native_client/src/trusted/service_runtime/include/sys/fcntl.h" |
| #include "ppapi/nacl_irt/plugin_startup.h" |
| #endif |
| @@ -390,6 +391,21 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| args->prereserved_sandbox_size = prereserved_sandbox_size_; |
| #endif |
| + NaClFileInfo nexe_file_info; |
| + // FIXME: Fix this on windows so that we turn this handle into an int. |
|
bbudge
2014/06/30 18:28:53
FIXME->TODO (or remove, it seems like you address
teravest
2014/06/30 22:04:56
Done.
|
| + base::PlatformFile nexe_file = IPC::PlatformFileForTransitToPlatformFile( |
| + params.nexe_file); |
| +#if defined(OS_WIN) |
| + nexe_file_info.desc = |
| + _open_osfhandle(reinterpret_cast<intptr_t>(nexe_file), |
| + _O_RDONLY | _O_BINARY); |
| +#else |
|
bbudge
2014/06/30 18:28:53
nit: #elif defined(OS_POSIX)
teravest
2014/06/30 22:04:56
Done.
|
| + nexe_file_info.desc = nexe_file; |
| +#endif |
| + nexe_file_info.file_token.lo = params.nexe_token_lo; |
|
Mark Seaborn
2014/06/30 20:01:03
FYI, having the browser pass the token through to
teravest
2014/06/30 22:04:56
I see what you mean. I've added a TODO here to add
|
| + nexe_file_info.file_token.hi = params.nexe_token_hi; |
| + args->nexe_desc = NaClDescIoFromFileInfo(nexe_file_info, NACL_ABI_O_RDONLY); |
| + |
| NaClChromeMainStartApp(nap, args); |
| NOTREACHED(); |
| } |