| Index: chrome/service/service_utility_process_host.cc
|
| ===================================================================
|
| --- chrome/service/service_utility_process_host.cc (revision 188735)
|
| +++ chrome/service/service_utility_process_host.cc (working copy)
|
| @@ -27,9 +27,30 @@
|
| #include "base/files/file_path.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/win/scoped_handle.h"
|
| +#include "content/public/common/sandbox_init.h"
|
| +#include "content/public/common/sandboxed_process_launcher_delegate.h"
|
| #include "printing/emf_win.h"
|
| -#endif
|
|
|
| +namespace {
|
| +class ServiceSandboxedProcessLauncherDelegate
|
| + : public content::SandboxedProcessLauncherDelegate {
|
| + public:
|
| + explicit ServiceSandboxedProcessLauncherDelegate(
|
| + const base::FilePath& exposed_dir)
|
| + : exposed_dir_(exposed_dir) {
|
| + }
|
| +
|
| + virtual void PreSandbox(bool* disable_sandbox, base::FilePath* exposed_dir) {
|
| + *exposed_dir = exposed_dir_;
|
| + }
|
| +
|
| + private:
|
| + base::FilePath exposed_dir_;
|
| +};
|
| +}
|
| +
|
| +#endif // OS_WIN
|
| +
|
| using content::ChildProcessHost;
|
|
|
| ServiceUtilityProcessHost::ServiceUtilityProcessHost(
|
| @@ -138,7 +159,8 @@
|
| cmd_line->AppendSwitch(switches::kNoSandbox);
|
| base::LaunchProcess(*cmd_line, base::LaunchOptions(), &handle_);
|
| } else {
|
| - handle_ = content::StartProcessWithAccess(cmd_line, exposed_dir);
|
| + ServiceSandboxedProcessLauncherDelegate delegate(exposed_dir);
|
| + handle_ = content::StartSandboxedProcess(&delegate, cmd_line);
|
| }
|
| return (handle_ != base::kNullProcessHandle);
|
| #endif // !defined(OS_WIN)
|
|
|