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

Unified Diff: src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc

Issue 10180015: Split SelLdrLauncher into SelLdrLauncher{Standalone,Chrome} classes (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Copyright Created 8 years, 8 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 | « no previous file | src/trusted/nonnacl_util/sel_ldr_launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc
diff --git a/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc b/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc
index e5e61202d5135d2da757be815a083f42f8a26c8a..805263a818206290a52c308c51ef424f842be624 100644
--- a/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc
+++ b/src/trusted/nonnacl_util/posix/sel_ldr_launcher_posix.cc
@@ -30,9 +30,8 @@ using std::vector;
namespace nacl {
-SelLdrLauncher::~SelLdrLauncher() {
+SelLdrLauncherStandalone::~SelLdrLauncherStandalone() {
CloseHandlesAfterLaunch();
-#if defined(NACL_STANDALONE)
if (kInvalidHandle != child_process_) {
int status;
// Ensure child process (service runtime) is kaput. NB: we might
@@ -46,20 +45,16 @@ SelLdrLauncher::~SelLdrLauncher() {
KillChildProcess();
waitpid(child_process_, &status, 0);
}
-#endif
- if (kInvalidHandle != channel_) {
- Close(channel_);
- }
}
-nacl::string SelLdrLauncher::GetSelLdrPathName() {
+nacl::string SelLdrLauncherStandalone::GetSelLdrPathName() {
char buffer[FILENAME_MAX];
GetPluginDirectory(buffer, sizeof(buffer));
return nacl::string(buffer) + "/sel_ldr";
}
-nacl::string SelLdrLauncher::GetSelLdrBootstrapPathName() {
+nacl::string SelLdrLauncherStandalone::GetSelLdrBootstrapPathName() {
#if NACL_LINUX
char buffer[FILENAME_MAX];
GetPluginDirectory(buffer, sizeof(buffer));
@@ -69,7 +64,7 @@ nacl::string SelLdrLauncher::GetSelLdrBootstrapPathName() {
#endif
}
-Handle SelLdrLauncher::CreateBootstrapSocket(nacl::string* dest_fd) {
+Handle SelLdrLauncherStandalone::CreateBootstrapSocket(nacl::string* dest_fd) {
Handle pair[2];
if (SocketPair(pair) == -1) {
return kInvalidHandle;
@@ -85,8 +80,7 @@ Handle SelLdrLauncher::CreateBootstrapSocket(nacl::string* dest_fd) {
const size_t kMaxExecArgs = 64;
-#if defined(NACL_STANDALONE)
-bool SelLdrLauncher::StartViaCommandLine(
+bool SelLdrLauncherStandalone::StartViaCommandLine(
const vector<nacl::string>& prefix,
const vector<nacl::string>& sel_ldr_argv,
const vector<nacl::string>& app_argv) {
@@ -129,10 +123,8 @@ bool SelLdrLauncher::StartViaCommandLine(
CloseHandlesAfterLaunch();
return true;
}
-#endif
-bool SelLdrLauncher::KillChildProcess() {
-#if defined(NACL_STANDALONE)
+bool SelLdrLauncherStandalone::KillChildProcess() {
if (kInvalidHandle == child_process_) {
// It is incorrect to use the kill syscall on kInvalidHandle as
// the pid, since using -1 as pid is defined by POSIX.1-2001 to
@@ -144,9 +136,6 @@ bool SelLdrLauncher::KillChildProcess() {
return 0 == kill(child_process_, SIGKILL);
// We cannot set child_process_ to kInvalidHandle since we will want to wait
// on its exit status.
-#else
- return false;
-#endif
}
} // namespace nacl
« no previous file with comments | « no previous file | src/trusted/nonnacl_util/sel_ldr_launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698