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

Unified Diff: chrome/service/service_utility_process_host.cc

Issue 12805004: Remove mention of the nacl process in content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add comments that changes to sandbox policy need to be reviewed by security team Created 7 years, 9 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
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,32 @@
#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 {
+// NOTE: changes to this class need to be reviewed by the security team.
+class ServiceSandboxedProcessLauncherDelegate
+ : public content::SandboxedProcessLauncherDelegate {
+ public:
+ explicit ServiceSandboxedProcessLauncherDelegate(
+ const base::FilePath& exposed_dir)
+ : exposed_dir_(exposed_dir) {
+ }
+
+ virtual void PreSandbox(bool* disable_default_policy,
+ base::FilePath* exposed_dir) {
+ *exposed_dir = exposed_dir_;
+ }
+
+ private:
+ base::FilePath exposed_dir_;
+};
+}
+
+#endif // OS_WIN
+
using content::ChildProcessHost;
ServiceUtilityProcessHost::ServiceUtilityProcessHost(
@@ -138,7 +161,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)

Powered by Google App Engine
This is Rietveld 408576698