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

Unified Diff: headless/public/headless_web_contents.h

Issue 2509813006: HeadlessWebContents:Observer to observe render process exit status (Closed)
Patch Set: Make it safe to call Shutdown() Created 4 years, 1 month 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: headless/public/headless_web_contents.h
diff --git a/headless/public/headless_web_contents.h b/headless/public/headless_web_contents.h
index 0ca6a588bb573334f336d73f1412c4ca8c002d45..74dc4df9049d83f4bdc1c8fd42ba83ce736d5cec 100644
--- a/headless/public/headless_web_contents.h
+++ b/headless/public/headless_web_contents.h
@@ -11,6 +11,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/process/kill.h"
#include "headless/public/headless_export.h"
#include "mojo/public/cpp/bindings/interface_request.h"
#include "ui/gfx/geometry/size.h"
@@ -39,6 +40,16 @@ class HEADLESS_EXPORT HeadlessWebContents {
// TODO(altimin): Support this event for pages that aren't created by us.
virtual void DevToolsTargetReady() {}
+ // This method is invoked when the process of the observed RenderProcessHost
+ // exits (either normally or with a crash). To determine if the process
+ // closed normally or crashed, examine the |status| parameter.
+ //
+ // If |status| is TERMINATION_STATUS_LAUNCH_FAILED then |exit_code| will
+ // contain a platform specific launch failure error code. Otherwise, it will
+ // contain the exit code for the process.
+ virtual void RenderProcessExited(base::TerminationStatus status,
+ int exit_code) {}
+
protected:
Observer() {}
virtual ~Observer() {}

Powered by Google App Engine
This is Rietveld 408576698