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

Unified Diff: components/nacl/zygote/nacl_fork_delegate_linux.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
Index: components/nacl/zygote/nacl_fork_delegate_linux.cc
diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.cc b/components/nacl/zygote/nacl_fork_delegate_linux.cc
index 1b9c7af7765f0a855966baba96b32765784c6f3f..34cc629f6511302de141b09c3b2ad84f88189700 100644
--- a/components/nacl/zygote/nacl_fork_delegate_linux.cc
+++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc
@@ -106,7 +106,8 @@ bool SendIPCRequestAndReadReply(int ipc_channel,
NaClForkDelegate::NaClForkDelegate()
: status_(kNaClHelperUnused),
- fd_(-1) {}
+ fd_(-1),
+ uses_nonsfi_mode_(false) {}
Mark Seaborn 2014/03/31 17:19:59 Not used
hamaji 2014/04/01 06:53:09 Oops, removed.
void NaClForkDelegate::Init(const int sandboxdesc) {
VLOG(1) << "NaClForkDelegate::Init()";
@@ -252,15 +253,18 @@ bool NaClForkDelegate::CanHelp(const std::string& process_type,
std::string* uma_name,
int* uma_sample,
int* uma_boundary_value) {
- if (process_type != switches::kNaClLoaderProcess)
+ if (process_type != switches::kNaClLoaderProcess &&
+ process_type != switches::kNaClLoaderNonSfiProcess)
return false;
+ uses_nonsfi_mode_ = process_type == switches::kNaClLoaderNonSfiProcess;
Mark Seaborn 2014/03/31 17:19:59 Ditto
hamaji 2014/04/01 06:53:09 Done.
*uma_name = "NaCl.Client.Helper.StateOnFork";
*uma_sample = status_;
*uma_boundary_value = kNaClHelperStatusBoundary;
return true;
}
-pid_t NaClForkDelegate::Fork(const std::vector<int>& fds) {
+pid_t NaClForkDelegate::Fork(const std::string& process_type,
+ const std::vector<int>& fds) {
VLOG(1) << "NaClForkDelegate::Fork";
DCHECK(fds.size() == kNumPassedFDs);
@@ -273,6 +277,13 @@ pid_t NaClForkDelegate::Fork(const std::vector<int>& fds) {
// First, send a remote fork request.
Pickle write_pickle;
write_pickle.WriteInt(nacl::kNaClForkRequest);
+ // We decide whether we will use SFI mode or non-SFI based on the
Mark Seaborn 2014/03/31 17:19:59 This might be considered obvious from the code, so
hamaji 2014/04/01 06:53:09 Done.
+ // process type.
+ // TODO(hamaji): When we split the helper binary for non-SFI mode
+ // from nacl_helper, stop sending this information.
+ const bool uses_nonsfi_mode =
+ process_type == switches::kNaClLoaderNonSfiProcess;
+ write_pickle.WriteBool(uses_nonsfi_mode);
char reply_buf[kNaClMaxIPCMessageLength];
ssize_t reply_size = 0;

Powered by Google App Engine
This is Rietveld 408576698