aw_render_process_gone_delegate.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ANDROID_WEBVIEW_BROWSER_AW_RENDER_PROCESS_GONE_DELEGATE_H_
  5. #define ANDROID_WEBVIEW_BROWSER_AW_RENDER_PROCESS_GONE_DELEGATE_H_
  6. namespace content {
  7. class WebContents;
  8. }
  9. namespace android_webview {
  10. // Delegate interface to handle the events that render process was gone.
  11. class AwRenderProcessGoneDelegate {
  12. public:
  13. enum class RenderProcessGoneResult { kHandled, kUnhandled, kException };
  14. // Returns the AwRenderProcessGoneDelegate instance associated with
  15. // the given |web_contents|.
  16. static AwRenderProcessGoneDelegate* FromWebContents(
  17. content::WebContents* web_contents);
  18. // Notify if render process crashed or was killed.
  19. virtual RenderProcessGoneResult OnRenderProcessGone(int child_process_id,
  20. bool crashed) = 0;
  21. protected:
  22. AwRenderProcessGoneDelegate() {}
  23. };
  24. } // namespace android_webview
  25. #endif // ANDROID_WEBVIEW_BROWSER_AW_RENDER_PROCESS_GONE_DELEGATE_H_