protected override void OnRenderProcessTerminated(IWebBrowser chromiumWebBrowser, IBrowser browser, CefTerminationStatus status) { OwnerWebView.RenderProcessCrashed?.Invoke(); const string ExceptionPrefix = "WebView render process "; Exception exception; switch (status) { case CefTerminationStatus.ProcessCrashed: exception = new RenderProcessCrashedException(ExceptionPrefix + "crashed"); break; case CefTerminationStatus.ProcessWasKilled: exception = new RenderProcessKilledException(ExceptionPrefix + "was killed", OwnerWebView.IsDisposing); break; case CefTerminationStatus.OutOfMemory: exception = new RenderProcessOutOfMemoryException(ExceptionPrefix + "ran out-of-memory"); break; default: exception = new RenderProcessCrashedException(ExceptionPrefix + "terminated with an unknown reason"); break; } OwnerWebView.ForwardUnhandledAsyncException(exception); }
void IRequestHandler.OnRenderProcessTerminated(IWebBrowser browserControl, IBrowser browser, CefTerminationStatus status) { OwnerWebView.RenderProcessCrashed?.Invoke(); const string ExceptionPrefix = "WebView render process "; Exception exception; switch (status) { case CefTerminationStatus.ProcessCrashed: exception = new RenderProcessCrashedException(ExceptionPrefix + "crashed"); break; case CefTerminationStatus.ProcessWasKilled: exception = new RenderProcessKilledException(ExceptionPrefix + "was killed"); break; default: exception = new RenderProcessCrashedException(ExceptionPrefix + "terminated with an unknown reason"); break; } OwnerWebView.ExecuteWithAsyncErrorHandling(() => throw exception); }