| 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 0e5f8e7eccc23c1a44a5a718c34164aa1271385e..e20234cee9c244256cfc488999dafe597ebebbd0 100644
|
| --- a/components/nacl/zygote/nacl_fork_delegate_linux.cc
|
| +++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc
|
| @@ -108,9 +108,9 @@ bool SendIPCRequestAndReadReply(int ipc_channel,
|
|
|
| } // namespace.
|
|
|
| -NaClForkDelegate::NaClForkDelegate()
|
| - : status_(kNaClHelperUnused),
|
| - fd_(-1) {}
|
| +NaClForkDelegate::NaClForkDelegate(bool nonsfi_mode)
|
| + : nonsfi_mode_(nonsfi_mode), status_(kNaClHelperUnused), fd_(-1) {
|
| +}
|
|
|
| void NaClForkDelegate::Init(const int sandboxdesc,
|
| const bool enable_layer1_sandbox) {
|
| @@ -262,7 +262,8 @@ void NaClForkDelegate::Init(const int sandboxdesc,
|
| void NaClForkDelegate::InitialUMA(std::string* uma_name,
|
| int* uma_sample,
|
| int* uma_boundary_value) {
|
| - *uma_name = "NaCl.Client.Helper.InitState";
|
| + *uma_name = nonsfi_mode_ ? "NaCl.Client.HelperNonSFI.InitState"
|
| + : "NaCl.Client.Helper.InitState";
|
| *uma_sample = status_;
|
| *uma_boundary_value = kNaClHelperStatusBoundary;
|
| }
|
| @@ -279,10 +280,14 @@ bool NaClForkDelegate::CanHelp(const std::string& process_type,
|
| std::string* uma_name,
|
| int* uma_sample,
|
| int* uma_boundary_value) {
|
| - if (process_type != switches::kNaClLoaderProcess &&
|
| - process_type != switches::kNaClLoaderNonSfiProcess)
|
| + // We can only help with a specific process type depending on nonsfi_mode_.
|
| + const char* helpable_process_type = nonsfi_mode_
|
| + ? switches::kNaClLoaderNonSfiProcess
|
| + : switches::kNaClLoaderProcess;
|
| + if (process_type != helpable_process_type)
|
| return false;
|
| - *uma_name = "NaCl.Client.Helper.StateOnFork";
|
| + *uma_name = nonsfi_mode_ ? "NaCl.Client.HelperNonSFI.StateOnFork"
|
| + : "NaCl.Client.Helper.StateOnFork";
|
| *uma_sample = status_;
|
| *uma_boundary_value = kNaClHelperStatusBoundary;
|
| return true;
|
| @@ -303,11 +308,7 @@ pid_t NaClForkDelegate::Fork(const std::string& process_type,
|
| // First, send a remote fork request.
|
| Pickle write_pickle;
|
| write_pickle.WriteInt(nacl::kNaClForkRequest);
|
| - // 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);
|
| + write_pickle.WriteBool(nonsfi_mode_);
|
| write_pickle.WriteString(channel_id);
|
|
|
| char reply_buf[kNaClMaxIPCMessageLength];
|
|
|