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

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: fix debug and clang 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
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d5efc1e4dd6e7415568541f5bbe091671ac101c6 100644
--- a/content/browser/child_process_launcher.h
+++ b/content/browser/child_process_launcher.h
@@ -18,12 +18,35 @@
#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 {
+// Note: These codes are listed in a histogram and any new codes should be added
+// at the end.
+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(static_cast<int>(LAUNCH_RESULT_START) >
+ static_cast<int>(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 +58,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 +124,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
« no previous file with comments | « content/browser/browser_child_process_host_impl.cc ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698