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

Unified Diff: base/process/launch_posix.cc

Issue 831363002: Add the ability to run a callback between fork and exec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: base/process/launch_posix.cc
diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
index 3322d265785246e8076e8ddd9591701f57db7f5c..d538065ae4dec2f7dfa222a82663708810781192 100644
--- a/base/process/launch_posix.cc
+++ b/base/process/launch_posix.cc
@@ -20,6 +20,7 @@
#include <set>
#include "base/allocator/type_profiler_control.h"
+#include "base/callback.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/debug/debugger.h"
@@ -448,6 +449,12 @@ bool LaunchProcess(const std::vector<std::string>& argv,
}
#endif
+#if defined(OS_POSIX)
+ if (!options.pre_exec_hook.is_null()) {
+ options.pre_exec_hook.Run();
+ }
+#endif
+
for (size_t i = 0; i < argv.size(); i++)
argv_cstr[i] = const_cast<char*>(argv[i].c_str());
argv_cstr[argv.size()] = NULL;

Powered by Google App Engine
This is Rietveld 408576698