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

Unified Diff: content/browser/child_process_launcher.cc

Issue 1346923006: Refactor the bootstrap sandbox process launching integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/browser/child_process_launcher.cc
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index 262e6a8ac90ea0c0e6b4097dd90b0f32382257b6..10ce311d4145ea6af4d7357c61cb3365a3abaf80 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -30,6 +30,7 @@
#include "content/browser/browser_io_surface_manager_mac.h"
#include "content/browser/mach_broker_mac.h"
#include "sandbox/mac/bootstrap_sandbox.h"
+#include "sandbox/mac/pre_exec_delegate.h"
#elif defined(OS_ANDROID)
#include "base/android/jni_android.h"
#include "content/browser/android/child_process_launcher_android.h"
@@ -244,23 +245,18 @@ void LaunchOnLauncherThread(const NotifyCallback& callback,
BrowserIOSurfaceManager::GetInstance()->EnsureRunning();
const int bootstrap_sandbox_policy = delegate->GetSandboxType();
+ scoped_ptr<sandbox::PreExecDelegate> pre_exec_delegate;
if (ShouldEnableBootstrapSandbox() &&
bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) {
- options.replacement_bootstrap_name =
- GetBootstrapSandbox()->server_bootstrap_name();
- GetBootstrapSandbox()->PrepareToForkWithPolicy(
- bootstrap_sandbox_policy);
+ pre_exec_delegate =
+ GetBootstrapSandbox()->NewClient(bootstrap_sandbox_policy).Pass();
}
+ options.pre_exec_delegate = pre_exec_delegate.get();
#endif // defined(OS_MACOSX)
process = base::LaunchProcess(*cmd_line, options);
#if defined(OS_MACOSX)
- if (ShouldEnableBootstrapSandbox() &&
- bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) {
- GetBootstrapSandbox()->FinishedFork(process.Handle());
- }
-
if (process.IsValid())
broker->AddPlaceholderForPid(process.Pid(), child_process_id);

Powered by Google App Engine
This is Rietveld 408576698