Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(929)

Unified Diff: components/nacl/browser/nacl_process_host.cc

Issue 332463003: Pepper: Remove LOAD_MODULE SRPC call in SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment to forward declaration Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | components/nacl/common/nacl_host_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/browser/nacl_process_host.cc
diff --git a/components/nacl/browser/nacl_process_host.cc b/components/nacl/browser/nacl_process_host.cc
index 0a3a0c936d3496e4c22ccd6f1f67e0862d917a55..4d1ed8c437887ec5c3adf8403a2aca600790c9ac 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -46,6 +46,7 @@
#include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_switches.h"
+#include "native_client/src/public/nacl_file_info.h"
#include "native_client/src/shared/imc/nacl_imc_c.h"
#include "net/base/net_util.h"
#include "net/socket/tcp_listen_socket.h"
@@ -250,6 +251,7 @@ unsigned NaClProcessHost::keepalive_throttle_interval_milliseconds_ =
NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
base::File nexe_file,
+ const NaClFileToken& nexe_token,
ppapi::PpapiPermissions permissions,
int render_view_id,
uint32 permission_bits,
@@ -262,6 +264,8 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
const base::FilePath& profile_directory)
: manifest_url_(manifest_url),
nexe_file_(nexe_file.Pass()),
+ nexe_token_lo_(nexe_token.lo),
+ nexe_token_hi_(nexe_token.hi),
permissions_(permissions),
#if defined(OS_WIN)
process_launched_by_broker_(false),
@@ -820,12 +824,6 @@ bool NaClProcessHost::StartNaClExecution() {
if (uses_nonsfi_mode_) {
// Currently, non-SFI mode is supported only on Linux.
#if defined(OS_LINUX)
- // nexe_file_ still keeps the ownership at this moment, because |params|
- // may just be destroyed before sending IPC is properly processed.
- // Note that although we set auto_close=true for FileDescriptor's
- // constructor, it is not automatically handled in its destructor as RAII.
- params.nexe_file =
- base::FileDescriptor(nexe_file_.GetPlatformFile(), true);
// In non-SFI mode, we do not use SRPC. Make sure that the socketpair is
// not created.
DCHECK_EQ(internal_->socket_for_sel_ldr, NACL_INVALID_HANDLE);
@@ -840,6 +838,11 @@ bool NaClProcessHost::StartNaClExecution() {
params.uses_irt = uses_irt_;
params.enable_dyncode_syscalls = enable_dyncode_syscalls_;
+ // TODO(teravest): Resolve the file tokens right now instead of making the
+ // loader send IPC to resolve them later.
+ params.nexe_token_lo = nexe_token_lo_;
+ params.nexe_token_hi = nexe_token_hi_;
+
const ChildProcessData& data = process_->GetData();
if (!ShareHandleToSelLdr(data.handle,
internal_->socket_for_sel_ldr, true,
@@ -891,14 +894,13 @@ bool NaClProcessHost::StartNaClExecution() {
#endif
}
- // Here we are about to send the IPC, so release file descriptors to delegate
- // the ownership to the message.
- if (uses_nonsfi_mode_) {
- nexe_file_.TakePlatformFile();
- } else {
+ if (!uses_nonsfi_mode_) {
internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE;
}
+ params.nexe_file = IPC::TakeFileHandleForProcess(nexe_file_.Pass(),
+ process_->GetData().handle);
+
process_->Send(new NaClProcessMsg_Start(params));
return true;
}
« no previous file with comments | « components/nacl/browser/nacl_process_host.h ('k') | components/nacl/common/nacl_host_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698