Index: components/nacl/nacl/nacl_fork_delegate_linux.cc |
diff --git a/chrome/app/nacl_fork_delegate_linux.cc b/components/nacl/nacl/nacl_fork_delegate_linux.cc |
similarity index 90% |
rename from chrome/app/nacl_fork_delegate_linux.cc |
rename to components/nacl/nacl/nacl_fork_delegate_linux.cc |
index c16603daeeb3e4e86d2de3ec6e87ea6273c6a816..2cafef42eab001630fbe48630d825f7380307efd 100644 |
--- a/chrome/app/nacl_fork_delegate_linux.cc |
+++ b/components/nacl/nacl/nacl_fork_delegate_linux.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/app/nacl_fork_delegate_linux.h" |
+#include "components/nacl/common/nacl_fork_delegate_linux.h" |
#include <signal.h> |
#include <stdlib.h> |
@@ -20,9 +20,8 @@ |
#include "base/posix/unix_domain_socket_linux.h" |
#include "base/process_util.h" |
#include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
-#include "chrome/common/chrome_paths.h" |
-#include "chrome/common/chrome_switches.h" |
-#include "chrome/common/nacl_helper_linux.h" |
+#include "components/nacl/common/nacl_delegate.h" |
+#include "components/nacl/common/nacl_helper_linux.h" |
NaClForkDelegate::NaClForkDelegate() |
: status_(kNaClHelperUnused), |
@@ -39,7 +38,7 @@ void NaClForkDelegate::Init(const int sandboxdesc) { |
int fds[2]; |
// Confirm a hard-wired assumption. |
- // The NaCl constant is from chrome/nacl/nacl_linux_helper.h |
+ // The NaCl constant is from components/nacl/nacl/nacl_linux_helper.h |
DCHECK(kNaClSandboxDescriptor == sandboxdesc); |
CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); |
@@ -50,10 +49,11 @@ void NaClForkDelegate::Init(const int sandboxdesc) { |
status_ = kNaClHelperUnused; |
base::FilePath helper_exe; |
base::FilePath helper_bootstrap_exe; |
- if (!PathService::Get(chrome::FILE_NACL_HELPER, &helper_exe)) { |
+ if (!GetNaClDelegate()->GetFilePath( |
+ NaClDelegate::kFileNaClHelper, &helper_exe)) { |
status_ = kNaClHelperMissing; |
- } else if (!PathService::Get(chrome::FILE_NACL_HELPER_BOOTSTRAP, |
- &helper_bootstrap_exe)) { |
+ } else if (!GetNaClDelegate()->GetFilePath( |
+ NaClDelegate::kFileNaClHelperBootstrap, &helper_bootstrap_exe)) { |
status_ = kNaClHelperBootstrapMissing; |
} else if (RunningOnValgrind()) { |
status_ = kNaClHelperValgrind; |
@@ -126,7 +126,8 @@ 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 != GetNaClDelegate()->GetSwitch( |
+ NaClDelegate::kNaClLoaderProcess)) |
return false; |
*uma_name = "NaCl.Client.Helper.StateOnFork"; |
*uma_sample = status_; |