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

Unified Diff: sandbox/mac/pre_exec_delegate.h

Issue 1346923006: Refactor the bootstrap sandbox process launching integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RevokeToken Created 5 years, 3 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 | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/pre_exec_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/pre_exec_delegate.h
diff --git a/sandbox/mac/pre_exec_delegate.h b/sandbox/mac/pre_exec_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..61a16552ee0cd857d772cfb21e0e887ba8d6931c
--- /dev/null
+++ b/sandbox/mac/pre_exec_delegate.h
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SANDBOX_MAC_PRE_EXEC_DELEGATE_H_
+#define SANDBOX_MAC_PRE_EXEC_DELEGATE_H_
+
+#include "base/process/launch.h"
+
+namespace sandbox {
+
+// This PreExecDelegate will communicate with the BootstrapSandbox running
+// the Mach server registered under |sandbox_server_bootstrap_name|. It will
+// check in with th BootstrapSandbox using the |sandbox_token| and will
+// replace the task's bootstrap port with one provided by the sandbox.
+class PreExecDelegate : public base::LaunchOptions::PreExecDelegate {
+ public:
+ PreExecDelegate(const std::string& sandbox_server_bootstrap_name,
+ uint64_t sandbox_token);
+ ~PreExecDelegate() override;
+
+ void RunAsyncSafe() override;
+
+ uint64_t sandbox_token() const { return sandbox_token_; }
+
+ private:
+ const std::string sandbox_server_bootstrap_name_;
+ const char* const sandbox_server_bootstrap_name_ptr_;
+ const uint64_t sandbox_token_;
+ const bool is_yosemite_or_later_;
+
+ DISALLOW_COPY_AND_ASSIGN(PreExecDelegate);
+};
+
+} // namespace sandbox
+
+#endif // SANDBOX_MAC_PRE_EXEC_DELEGATE_H_
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/pre_exec_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698