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

Unified Diff: src/trusted/nonnacl_util/win/sel_ldr_launcher_win.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 | « src/trusted/nonnacl_util/sel_ldr_launcher_chrome.cc ('k') | src/trusted/sel_universal/reverse_emulate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc
diff --git a/src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc b/src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc
index 1f42283bc116ccb058b915a5393b0e542228e0b2..1627b83805b9208f30744dfbb7a1feac75fb021d 100644
--- a/src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc
+++ b/src/trusted/nonnacl_util/win/sel_ldr_launcher_win.cc
@@ -23,9 +23,8 @@ using std::vector;
namespace nacl {
-SelLdrLauncher::~SelLdrLauncher() {
+SelLdrLauncherStandalone::~SelLdrLauncherStandalone() {
CloseHandlesAfterLaunch();
-#if defined(NACL_STANDALONE)
if (kInvalidHandle != child_process_) {
// Ensure child process (service runtime) is kaput. NB: we might
// close the command channel (or use the hard_shutdown RPC) rather
@@ -38,23 +37,19 @@ SelLdrLauncher::~SelLdrLauncher() {
KillChildProcess();
CloseHandle(child_process_);
}
-#endif
- if (kInvalidHandle != channel_) {
- Close(channel_);
- }
}
-nacl::string SelLdrLauncher::GetSelLdrPathName() {
+nacl::string SelLdrLauncherStandalone::GetSelLdrPathName() {
char buffer[FILENAME_MAX];
- // Currently only the Chrome build uses the gyp-generated binaries, and
- // Chrome does not start sel_ldr by means of SelLdrLauncher. So we only
- // refer to sel_ldr.exe here.
+ // Currently only the Chrome build uses the gyp-generated binaries,
+ // and Chrome does not start sel_ldr by means of
+ // SelLdrLauncherStandalone. So we only refer to sel_ldr.exe here.
const char* const kSelLdrBasename = "\\sel_ldr.exe";
GetPluginDirectory(buffer, sizeof(buffer));
return nacl::string(buffer) + kSelLdrBasename;
}
-nacl::string SelLdrLauncher::GetSelLdrBootstrapPathName() {
+nacl::string SelLdrLauncherStandalone::GetSelLdrBootstrapPathName() {
return nacl::string(NACL_NO_FILE_PATH);
}
@@ -76,7 +71,7 @@ static nacl::string Escape(nacl::string s) {
return result;
}
-Handle SelLdrLauncher::CreateBootstrapSocket(nacl::string* dest_fd) {
+Handle SelLdrLauncherStandalone::CreateBootstrapSocket(nacl::string* dest_fd) {
Handle pair[2];
if (SocketPair(pair) == -1) {
return kInvalidHandle;
@@ -102,8 +97,7 @@ Handle SelLdrLauncher::CreateBootstrapSocket(nacl::string* dest_fd) {
return pair[0];
}
-#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) {
@@ -141,18 +135,13 @@ bool SelLdrLauncher::StartViaCommandLine(
child_process_ = process_infomation.hProcess;
return true;
}
-#endif
-bool SelLdrLauncher::KillChildProcess() {
-#if defined(NACL_STANDALONE)
+bool SelLdrLauncherStandalone::KillChildProcess() {
if (kInvalidHandle == child_process_)
return false;
return 0 != TerminateProcess(child_process_, 9);
// 9 is the exit code for the child_process_. The value is actually not
// material, since (currently) the launcher does not collect/report it.
-#else
- return false;
-#endif
}
void PluginSelLdrLocator::GetDirectory(char* buffer, size_t len) {
« no previous file with comments | « src/trusted/nonnacl_util/sel_ldr_launcher_chrome.cc ('k') | src/trusted/sel_universal/reverse_emulate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698