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

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

Issue 337463002: Remove LoadModule SRPC for non-SFI mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
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 cbb716c9197524929435a25d6e14e3fcdc3013b2..2b053fa27b28454ea3f94a1ae17d4e16a88645aa 100644
--- a/components/nacl/browser/nacl_process_host.cc
+++ b/components/nacl/browser/nacl_process_host.cc
@@ -257,6 +257,7 @@ unsigned NaClProcessHost::keepalive_throttle_interval_milliseconds_ =
ppapi::kKeepaliveThrottleIntervalDefaultMilliseconds;
NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
+ base::File nexe_file,
int render_view_id,
uint32 permission_bits,
bool uses_irt,
@@ -267,6 +268,7 @@ NaClProcessHost::NaClProcessHost(const GURL& manifest_url,
bool off_the_record,
const base::FilePath& profile_directory)
: manifest_url_(manifest_url),
+ nexe_file_(nexe_file.Pass()),
permissions_(GetNaClPermissions(permission_bits)),
#if defined(OS_WIN)
process_launched_by_broker_(false),
@@ -455,6 +457,9 @@ void NaClProcessHost::Launch(
}
}
+ // TODO(hidehiko): We no longer use imc socket channel for non-SFI mode.
+ // Do not create them.
Mark Seaborn 2014/06/18 19:53:12 Nit: 'them' -> 'it', since you're referring to one
hidehiko 2014/06/19 07:01:59 Done.
+
// Rather than creating a socket pair in the renderer, and passing
// one side through the browser to sel_ldr, socket pairs are created
// in the browser and then passed to the renderer and sel_ldr.
@@ -819,9 +824,19 @@ bool NaClProcessHost::StartNaClExecution() {
NaClBrowser* nacl_browser = NaClBrowser::GetInstance();
NaClStartParams params;
+
// Enable PPAPI proxy channel creation only for renderer processes.
params.enable_ipc_proxy = enable_ppapi_proxy();
- if (!uses_nonsfi_mode_) {
+ if (uses_nonsfi_mode_) {
+ // Currently, non-SFI mode is supported only on Linux.
+#if defined(OS_LINUX)
+ // Note: nexe_file_ still keeps the ownership at this moment, because
Mark Seaborn 2014/06/18 19:53:12 Is this because a base::File can't be used as a pa
hidehiko 2014/06/19 07:01:59 Done.
+ // this params may just be destructed before sending IPC is properly
Mark Seaborn 2014/06/18 19:53:12 Nit: 'destroyed' rather than 'destructed'? Also "
hidehiko 2014/06/19 07:01:59 Done.
+ // processed.
+ params.nexe_file =
+ base::FileDescriptor(nexe_file_.GetPlatformFile(), true);
+#endif
+ } else {
params.validation_cache_enabled = nacl_browser->ValidationCacheIsEnabled();
params.validation_cache_key = nacl_browser->GetValidationCacheKey();
params.version = NaClBrowser::GetDelegate()->GetVersionString();
@@ -884,6 +899,10 @@ bool NaClProcessHost::StartNaClExecution() {
process_->Send(new NaClProcessMsg_Start(params));
+ if (uses_nonsfi_mode_) {
+ // Send() is processed, so we release the ownership of the nexe_file_ here.
+ nexe_file_.TakePlatformFile();
Mark Seaborn 2014/06/18 19:53:11 Wouldn't it be cleaner to do this immediately befo
hidehiko 2014/06/19 07:01:59 Done.
+ }
internal_->socket_for_sel_ldr = NACL_INVALID_HANDLE;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698