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

Unified Diff: headless/lib/browser/headless_devtools_client_impl.cc

Issue 2509813006: HeadlessWebContents:Observer to observe render process exit status (Closed)
Patch Set: Added a comment 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/lib/browser/headless_devtools_client_impl.cc
diff --git a/headless/lib/browser/headless_devtools_client_impl.cc b/headless/lib/browser/headless_devtools_client_impl.cc
index 833b9dc49afb1d85c386d64865b20448c98cfa57..cd52cbb31dad3e84085ee32cc56f81481b14c931 100644
--- a/headless/lib/browser/headless_devtools_client_impl.cc
+++ b/headless/lib/browser/headless_devtools_client_impl.cc
@@ -133,6 +133,11 @@ bool HeadlessDevToolsClientImpl::DispatchEvent(
return false;
EventHandlerMap::const_iterator it = event_handlers_.find(method);
if (it == event_handlers_.end()) {
+ // Silently swallow errors related to the target crashing. This can be
+ // observed via HeadlessWebContents::Observer::RenderProcessExited.
+ if (method == "Inspector.targetCrashed")
+ return true;
+
NOTREACHED() << "Unknown event: " << method;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698