diff options
author | jvoung <jvoung@chromium.org> | 2014-10-22 16:46:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-22 23:48:48 +0000 |
commit | a258e281a6a1cff9e1a4b4dc3bd44a455022fb42 (patch) | |
tree | d520a08a0c61ecd543fb39b6d0ab6b76d810a612 | |
parent | e467802dc7b7f556b109761bfc92bf0e433536d3 (diff) | |
download | chromium_src-a258e281a6a1cff9e1a4b4dc3bd44a455022fb42.zip chromium_src-a258e281a6a1cff9e1a4b4dc3bd44a455022fb42.tar.gz chromium_src-a258e281a6a1cff9e1a4b4dc3bd44a455022fb42.tar.bz2 |
Supply IRT file when launching PNaCl translators, and set irt_load_optional.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3914
Review URL: https://codereview.chromium.org/670233002
Cr-Commit-Position: refs/heads/master@{#300801}
-rw-r--r-- | components/nacl/browser/nacl_process_host.cc | 16 | ||||
-rw-r--r-- | components/nacl/loader/nacl_listener.cc | 31 |
2 files changed, 21 insertions, 26 deletions
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc index 1fdb09b..afb430a 100644 --- a/components/nacl/browser/nacl_process_host.cc +++ b/components/nacl/browser/nacl_process_host.cc @@ -831,16 +831,12 @@ bool NaClProcessHost::StartNaClExecution() { return false; } - // Currently, everything uses the IRT except for the PNaCl Translators. - bool uses_irt = process_type_ != kPNaClTranslatorProcessType; - if (uses_irt) { - const base::File& irt_file = nacl_browser->IrtFile(); - CHECK(irt_file.IsValid()); - // Send over the IRT file handle. We don't close our own copy! - if (!ShareHandleToSelLdr(data.handle, irt_file.GetPlatformFile(), false, - ¶ms.handles)) { - return false; - } + const base::File& irt_file = nacl_browser->IrtFile(); + CHECK(irt_file.IsValid()); + // Send over the IRT file handle. We don't close our own copy! + if (!ShareHandleToSelLdr(data.handle, irt_file.GetPlatformFile(), false, + ¶ms.handles)) { + return false; } #if defined(OS_MACOSX) diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc index 8562a28..0733bf8 100644 --- a/components/nacl/loader/nacl_listener.cc +++ b/components/nacl/loader/nacl_listener.cc @@ -386,26 +386,20 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { #endif DCHECK(params.process_type != nacl::kUnknownNaClProcessType); - bool uses_irt = params.process_type != nacl::kPNaClTranslatorProcessType; - if (uses_irt) { - CHECK(handles.size() >= 1); - NaClHandle irt_handle = nacl::ToNativeHandle(handles[handles.size() - 1]); - handles.pop_back(); + CHECK(handles.size() >= 1); + NaClHandle irt_handle = nacl::ToNativeHandle(handles[handles.size() - 1]); + handles.pop_back(); #if defined(OS_WIN) - args->irt_fd = _open_osfhandle(reinterpret_cast<intptr_t>(irt_handle), - _O_RDONLY | _O_BINARY); - if (args->irt_fd < 0) { - LOG(ERROR) << "_open_osfhandle() failed"; - return; - } + args->irt_fd = _open_osfhandle(reinterpret_cast<intptr_t>(irt_handle), + _O_RDONLY | _O_BINARY); + if (args->irt_fd < 0) { + LOG(ERROR) << "_open_osfhandle() failed"; + return; + } #else - args->irt_fd = irt_handle; + args->irt_fd = irt_handle; #endif - } else { - // Otherwise, the IRT handle is not even sent. - args->irt_fd = -1; - } if (params.validation_cache_enabled) { // SHA256 block size. @@ -439,6 +433,11 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { args->enable_dyncode_syscalls = 1; args->pnacl_mode = 0; args->initial_nexe_max_code_bytes = 0; + } else if (params.process_type == nacl::kPNaClTranslatorProcessType) { + // Transitioning the PNaCl translators to use the IRT again: + // https://code.google.com/p/nativeclient/issues/detail?id=3914. + // Once done, this can be removed. + args->irt_load_optional = 1; } #if defined(OS_LINUX) || defined(OS_MACOSX) |