Add objC delegate callback for webProcessDidBecomeResponsive and webProcessDidBecomeU...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 18:26:39 +0000 (18:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 18:26:39 +0000 (18:26 +0000)
commit9e3fd0e6f8b23052427277c5ad435c7721085f9a
tree225089686fa6b65cb9697089c7adeaff0e9c4748
parentc6250d4150c3d095a97ef28abc6bed5b7449e9b0
Add objC delegate callback for webProcessDidBecomeResponsive and webProcessDidBecomeUnresponsive.
https://bugs.webkit.org/show_bug.cgi?id=150778

Add methods into WKNavigationDelegatePrivate to notify WebKit client when web process becomes unresponsive
or responsive, which is reported by WebKit::ResponsivenessTimer.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2015-11-02
Reviewed by Darin Adler.

* UIProcess/API/APINavigationClient.h: Add two new method processDidBecomeResponsive and processDidBecomeUnresponsive
    to NavigationClient; they are called when WebKit::ResponsivenessTimer update its client's state.
(API::NavigationClient::processDidBecomeResponsive):
(API::NavigationClient::processDidBecomeUnresponsive):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Add two new delegate method to WKNavigationDelegatePrivate:
    _webViewWebProcessDidBecomeResponsive: and _webViewWebProcessDidBecomeUnresponsive:
* UIProcess/Cocoa/NavigationState.h: Add new overriding methods processDidBecomeResponsive and processDidBecomeUnresponsive.
    Also add a bool member for each method to indicate if the delegate has implement the related method.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate): Update the new bool members based on the delegate.
(WebKit::NavigationState::NavigationClient::processDidBecomeResponsive): Send the delegate message to navigationDelegate
    if _webViewWebProcessDidBecomeResponsive: is implemented.
(WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive): Ditto.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidBecomeUnresponsive): Call navigationClient's processDidBecomeUnresponsive if the page proxy
    has navigationClient.
(WebKit::WebPageProxy::processDidBecomeResponsive):  Call navigationClient's processDidBecomeResponsive if the page proxy
    has navigationClient.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/APINavigationClient.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h
Source/WebKit2/UIProcess/Cocoa/NavigationState.h
Source/WebKit2/UIProcess/Cocoa/NavigationState.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp