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

Unified Diff: content/browser/child_process_launcher.h

Issue 1923653002: Wire up process launch error codes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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.h
diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h
index 710247778bbfb56b16e971fd2f69d7e21c40375e..0147ea5807c86956ba79128c9f4760c0cb76f394 100644
--- a/content/browser/child_process_launcher.h
+++ b/content/browser/child_process_launcher.h
@@ -18,12 +18,32 @@
#include "content/public/common/sandboxed_process_launcher_delegate.h"
#include "mojo/edk/embedder/platform_channel_pair.h"
+#if defined(OS_WIN)
+#include "sandbox/win/src/sandbox_types.h"
+#endif
+
namespace base {
class CommandLine;
}
namespace content {
+enum LaunchResultCode {
+ // Launch start code, to not overlap with sandbox::ResultCode.
+ LAUNCH_RESULT_START = 1001,
+ // Launch success.
+ LAUNCH_RESULT_SUCCESS,
+ // Generic launch failure.
+ LAUNCH_RESULT_FAILURE,
+ // Placeholder for last item of the enum.
+ LAUNCH_RESULT_CODE_LAST_CODE
+};
+
+#if defined(OS_WIN)
+static_assert(LAUNCH_RESULT_START > sandbox::SBOX_ERROR_LAST,
+ "LaunchResultCode must not overlap with sandbox::ResultCode");
+#endif
+
// Launches a process asynchronously and notifies the client of the process
// handle when it's available. It's used to avoid blocking the calling thread
// on the OS since often it can take > 100 ms to create the process.
@@ -35,7 +55,7 @@ class CONTENT_EXPORT ChildProcessLauncher : public base::NonThreadSafe {
// constructed on.
virtual void OnProcessLaunched() = 0;
- virtual void OnProcessLaunchFailed() {};
+ virtual void OnProcessLaunchFailed(int error_code) {};
protected:
virtual ~Client() {}
@@ -101,14 +121,16 @@ class CONTENT_EXPORT ChildProcessLauncher : public base::NonThreadSafe {
base::ScopedFD ipcfd,
base::ScopedFD mojo_fd,
#endif
- base::Process process);
+ base::Process process,
+ int error_code);
// Notifies the client about the result of the operation.
void Notify(ZygoteHandle zygote,
#if defined(OS_ANDROID)
base::ScopedFD ipcfd,
#endif
- base::Process process);
+ base::Process process,
+ int error_code);
#if defined(MOJO_SHELL_CLIENT)
// When this process is run from an external Mojo shell, this function will

Powered by Google App Engine
This is Rietveld 408576698