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

Unified Diff: components/nacl/loader/nacl_listener.cc

Issue 216603002: Tell nacl_helper to use non SFI mode in HandleForkRequest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/loader/nacl_listener.h ('k') | components/nacl/zygote/nacl_fork_delegate_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nacl_listener.cc
diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc
index b5ee5f74fa0039b76c9bd1d75a347bd203df3bec..4a08ae5652abc236ebadd9508c8309923fa4fc54 100644
--- a/components/nacl/loader/nacl_listener.cc
+++ b/components/nacl/loader/nacl_listener.cc
@@ -200,6 +200,7 @@ class BrowserValidationDBProxy : public NaClValidationDB {
NaClListener::NaClListener() : shutdown_event_(true, false),
io_thread_("NaCl_IOThread"),
+ uses_nonsfi_mode_(false),
#if defined(OS_LINUX)
prereserved_sandbox_size_(0),
#endif
@@ -257,6 +258,9 @@ bool NaClListener::OnMessageReceived(const IPC::Message& msg) {
}
void NaClListener::OnStart(const nacl::NaClStartParams& params) {
+#if !defined(OS_LINUX)
+ CHECK(!uses_nonsfi_mode_) << "Non-SFI NaCl is only supported on Linux";
+#endif
#if defined(OS_LINUX) || defined(OS_MACOSX)
int urandom_fd = dup(base::GetUrandomFD());
if (urandom_fd < 0) {
@@ -286,8 +290,7 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
browser_handle = IPC::Channel::GenerateVerifiedChannelID("nacl");
ppapi_renderer_handle = IPC::Channel::GenerateVerifiedChannelID("nacl");
-#if defined(OS_LINUX)
Mark Seaborn 2014/04/02 00:22:22 You can't remove these #ifs. This code won't comp
hamaji 2014/04/02 03:20:44 Ah, I forgot sending a try job. Thanks for checkin
- if (params.uses_nonsfi_mode) {
+ if (uses_nonsfi_mode_) {
// In non-SFI mode, we neither intercept nor rewrite the message using
// NaClIPCAdapter, and the channels are connected between the plugin and
// the hosts directly. So, the IPC::Channel instances will be created in
@@ -318,7 +321,6 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
ppapi_renderer_handle.socket =
base::FileDescriptor(renderer_client_ppapi_fd, true);
} else {
-#endif
// Create the PPAPI IPC channels between the NaCl IRT and the host
// (browser/renderer) processes. The IRT uses these channels to
// communicate with the host and to initialize the IPC dispatchers.
@@ -326,9 +328,7 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
nap, NACL_CHROME_DESC_BASE);
SetUpIPCAdapter(&ppapi_renderer_handle, io_thread_.message_loop_proxy(),
nap, NACL_CHROME_DESC_BASE + 1);
-#if defined(OS_LINUX)
}
-#endif
}
// The argument passed to GenerateVerifiedChannelID() here MUST be "nacl".
@@ -420,12 +420,10 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) {
args->prereserved_sandbox_size = prereserved_sandbox_size_;
#endif
-#if defined(OS_LINUX)
- if (params.uses_nonsfi_mode) {
+ if (uses_nonsfi_mode_) {
nacl::nonsfi::MainStart(args->imc_bootstrap_handle);
return;
}
-#endif
NaClChromeMainStartApp(nap, args);
NOTREACHED();
}
« no previous file with comments | « components/nacl/loader/nacl_listener.h ('k') | components/nacl/zygote/nacl_fork_delegate_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698