Changeset 186586 in webkit


Ignore:
Timestamp:
Jul 9, 2015 12:01:49 AM (9 years ago)
Author:
mitz@apple.com
Message:

[Cocoa] Report the first paint after committing a load as a rendering progress event
https://bugs.webkit.org/show_bug.cgi?id=146765

Reviewed by Tim Horton.

  • Shared/API/Cocoa/_WKRenderingProgressEvents.h: Added _WKRenderingProgressEventFirstPaint.
  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _didCommitLayerTree:]): If this is the first layer tree commit since the load
was committed, and the delegate is observing _WKRenderingProgressEventFirstPaint, call
NavigationState::didFirstPaint.

  • UIProcess/Cocoa/NavigationState.h:
  • UIProcess/Cocoa/NavigationState.mm:

(WebKit::NavigationState::didFirstPaint): Added. Calls -_webView:renderingProgressDidChange:
with _WKRenderingProgressEventFirstPaint.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r186583 r186586  
     12015-07-09  Dan Bernstein  <mitz@apple.com>
     2
     3        [Cocoa] Report the first paint after committing a load as a rendering progress event
     4        https://bugs.webkit.org/show_bug.cgi?id=146765
     5
     6        Reviewed by Tim Horton.
     7
     8        * Shared/API/Cocoa/_WKRenderingProgressEvents.h: Added _WKRenderingProgressEventFirstPaint.
     9
     10        * UIProcess/API/Cocoa/WKWebView.mm:
     11        (-[WKWebView _didCommitLayerTree:]): If this is the first layer tree commit since the load
     12        was committed, and the delegate is observing _WKRenderingProgressEventFirstPaint, call
     13        NavigationState::didFirstPaint.
     14
     15        * UIProcess/Cocoa/NavigationState.h:
     16        * UIProcess/Cocoa/NavigationState.mm:
     17        (WebKit::NavigationState::didFirstPaint): Added. Calls -_webView:renderingProgressDidChange:
     18        with _WKRenderingProgressEventFirstPaint.
     19
    1202015-07-08  Jinwoo Song  <jinwoo7.song@samsung.com>
    221
  • trunk/Source/WebKit2/Shared/API/Cocoa/_WKRenderingProgressEvents.h

    r185880 r186586  
    3434    _WKRenderingProgressEventReachedSessionRestorationRenderTreeSizeThreshold WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) = 1 << 3,
    3535    _WKRenderingProgressEventFirstLayoutAfterSuppressedIncrementalRendering WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) = 1 << 4,
    36     _WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) = 1 << 5
     36    _WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) = 1 << 5,
     37    _WKRenderingProgressEventFirstPaint WK_ENUM_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA) = 1 << 6,
    3738} WK_ENUM_AVAILABLE(10_10, 8_0);
    3839
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r186371 r186586  
    972972        [_scrollView setContentOffset:[self _adjustedContentOffset:CGPointZero]];
    973973        [self _updateVisibleContentRects];
     974        if (_observedRenderingProgressEvents & _WKRenderingProgressEventFirstPaint)
     975            _navigationState->didFirstPaint();
    974976    }
    975977
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.h

    r185877 r186586  
    7373    void navigationGestureDidEnd(bool willNavigate, WebBackForwardListItem&);
    7474    void willRecordNavigationSnapshot(WebBackForwardListItem&);
     75
     76    void didFirstPaint();
    7577
    7678private:
  • trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm

    r186196 r186586  
    225225}
    226226
     227void NavigationState::didFirstPaint()
     228{
     229    if (!m_navigationDelegateMethods.webViewRenderingProgressDidChange)
     230        return;
     231
     232    auto navigationDelegate = m_navigationDelegate.get();
     233    if (!navigationDelegate)
     234        return;
     235
     236    [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate) _webView:m_webView renderingProgressDidChange:_WKRenderingProgressEventFirstPaint];
     237}
     238
    227239NavigationState::NavigationClient::NavigationClient(NavigationState& navigationState)
    228240    : m_navigationState(navigationState)
Note: See TracChangeset for help on using the changeset viewer.