Bug 134009 - [iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update
Summary: [iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-06-17 17:25 PDT by Benjamin Poulain
Modified: 2014-06-18 14:38 PDT (History)
14 users (show)

See Also:


Attachments
Patch (21.83 KB, patch)
2014-06-17 17:29 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (9.23 KB, patch)
2014-06-17 21:39 PDT, Benjamin Poulain
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-06-17 17:25:57 PDT
[iOS][WK2] Re-sync didCommitLoadForMainFrame with its corresponding tile update
Comment 1 Benjamin Poulain 2014-06-17 17:29:08 PDT
Created attachment 233274 [details]
Patch
Comment 2 Benjamin Poulain 2014-06-17 17:29:40 PDT
<rdar://problem/17352039>
Comment 3 WebKit Commit Bot 2014-06-17 17:30:30 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 Tim Horton 2014-06-17 17:45:37 PDT
Comment on attachment 233274 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=233274&action=review

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:705
> +- (void)_didCommitLoadForMainFrameWithNextDrawingTransactionID:(uint64_t)nextDrawingTransactionID

The transaction IDs are for the whole commit, which includes layer tree updates, scrolling updates, render tree size, scale factors, etc. Maybe just "TransactionID", instead of Drawing-?

> Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp:281
> +void PageClientImpl::didCommitLoadForMainFrame(const String& /* mimeType */, bool /* useCustomContentProvider */, uint64_t /* nextDrawingTransactionID */)

I really don't think we should propagate this RemoteLayerTreeDrawingArea-specific thing through everywhere, but I'm not sure how else to do this.
Comment 5 Benjamin Poulain 2014-06-17 21:39:18 PDT
Created attachment 233284 [details]
Patch
Comment 6 Tim Horton 2014-06-17 21:46:42 PDT
Comment on attachment 233284 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=233284&action=review

> Source/WebKit2/ChangeLog:8
> +        WKWebView assumed  the first _didCommitLayerTree: after _didCommitLoadForMainFrame

extra space between 'assumed' and 'the'

> Source/WebKit2/ChangeLog:11
> +        This is not always true. Sometimes, a set of tile can be rendered in the CoreAnimation thread

tile*s*, and it's not the CoreAnimation thread, it's our own layer flush thread (com.apple.WebKit.WebContent.RemoteLayerTreeDrawingArea.CommitQueue).

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:708
> +    _firstPaintAfterCommitLoadTransactionID = static_cast<WebKit::RemoteLayerTreeDrawingAreaProxy*>(_page->drawingArea())->nextLayerTreeIdTransactionID();

Don't we have toRemoteLayerTreeDrawingAreaProxy()? If not, maybe add the macros so we do?

> Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:52
> +    uint64_t nextLayerTreeIdTransactionID() const { return m_lastWillCommitLayerTreeTransactionID + 1; }

what's with the Id in the middle of this name? should just be nextLayerTreeTransactionID I think.

> Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:96
> +    uint64_t m_lastWillCommitLayerTreeTransactionID;

maybe this is m_pendingLayerTreeTransactionID?
Comment 7 Benjamin Poulain 2014-06-18 14:38:33 PDT
Committed r170115: <http://trac.webkit.org/changeset/170115>