summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_child_process_host.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-22 00:01:55 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-22 00:01:55 +0000
commit574c7bb72cdc18bc52b69a10aad1287c85a57c70 (patch)
treeb52524b1ad81c3311603d421af4b3587a22320c8 /chrome/service/service_child_process_host.cc
parent3ab6796d3645a13a56a2fc311fc36c66d31089d6 (diff)
downloadchromium_src-574c7bb72cdc18bc52b69a10aad1287c85a57c70.zip
chromium_src-574c7bb72cdc18bc52b69a10aad1287c85a57c70.tar.gz
chromium_src-574c7bb72cdc18bc52b69a10aad1287c85a57c70.tar.bz2
As the first step in an effort to improve robustness of the cloud print proxy, we fetch printer capabilities and defaults in a child process so that printer driver crashes do not crash the entire proxy.
BUG=None TEST=Registration of printers, printer update in Cloud Print Proxy. Review URL: http://codereview.chromium.org/5947002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69899 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_child_process_host.cc')
-rw-r--r--chrome/service/service_child_process_host.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/service/service_child_process_host.cc b/chrome/service/service_child_process_host.cc
index 00dfacc..472b18b 100644
--- a/chrome/service/service_child_process_host.cc
+++ b/chrome/service/service_child_process_host.cc
@@ -4,8 +4,10 @@
#include "chrome/service/service_child_process_host.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/process_util.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/result_codes.h"
#if defined(OS_WIN)
@@ -23,13 +25,22 @@ ServiceChildProcessHost::~ServiceChildProcessHost() {
}
bool ServiceChildProcessHost::Launch(CommandLine* cmd_line,
+ bool no_sandbox,
const FilePath& exposed_dir) {
#if !defined(OS_WIN)
// TODO(sanjeevr): Implement for non-Windows OSes.
NOTIMPLEMENTED();
return false;
#else // !defined(OS_WIN)
- set_handle(sandbox::StartProcessWithAccess(cmd_line, exposed_dir));
+
+ if (no_sandbox) {
+ base::ProcessHandle process = base::kNullProcessHandle;
+ cmd_line->AppendSwitch(switches::kNoSandbox);
+ base::LaunchApp(*cmd_line, false, false, &process);
+ set_handle(process);
+ } else {
+ set_handle(sandbox::StartProcessWithAccess(cmd_line, exposed_dir));
+ }
return (handle() != base::kNullProcessHandle);
#endif // !defined(OS_WIN)
}