- Revision
- 241128
- Author
- [email protected]
- Date
- 2019-02-07 10:53:21 -0800 (Thu, 07 Feb 2019)
Log Message
[macOS] API test times out after r241026
https://bugs.webkit.org/show_bug.cgi?id=194372
Reviewed by Alex Christensen.
The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
for clients to decide which milestones they would like to listen for.
* WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(layoutMilestones):
(setUpPageLoaderClient):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (241127 => 241128)
--- trunk/Source/WebKit/ChangeLog 2019-02-07 18:52:54 UTC (rev 241127)
+++ trunk/Source/WebKit/ChangeLog 2019-02-07 18:53:21 UTC (rev 241128)
@@ -1,3 +1,22 @@
+2019-02-07 Per Arne Vollan <[email protected]>
+
+ [macOS] API test times out after r241026
+ https://bugs.webkit.org/show_bug.cgi?id=194372
+
+ Reviewed by Alex Christensen.
+
+ The API test TestWebKitAPI.RenderingProgress.FirstMeaningfulPaint times out after r241026.
+ A new function pointer, layoutMilestones, is added to WKBundlePageLoaderClient, in order
+ for clients to decide which milestones they would like to listen for.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
+ * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
+ (layoutMilestones):
+ (setUpPageLoaderClient):
+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
+ (WebKit::InjectedBundlePageLoaderClient::layoutMilestones const):
+ * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
+
2019-02-07 Alex Christensen <[email protected]>
Deprecate WKBundlePageSetDefersLoading
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h (241127 => 241128)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h 2019-02-07 18:52:54 UTC (rev 241127)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h 2019-02-07 18:53:21 UTC (rev 241128)
@@ -63,6 +63,7 @@
typedef void (*WKBundlePageWillLoadURLRequestCallback)(WKBundlePageRef page, WKURLRequestRef request, WKTypeRef userData, const void *clientInfo);
typedef void (*WKBundlePageWillLoadDataRequestCallback)(WKBundlePageRef page, WKURLRequestRef request, WKDataRef data, WKStringRef MIMEType, WKStringRef encodingName, WKURLRef unreachableURL, WKTypeRef userData, const void *clientInfo);
typedef WKStringRef (*WKBundlePageUserAgentForURLCallback)(WKBundleFrameRef frame, WKURLRef url, const void *clientInfo);
+typedef WKLayoutMilestones (*WKBundlePageLayoutMilestonesCallback)(const void* clientInfo);
typedef struct WKBundlePageLoaderClientBase {
int version;
@@ -526,4 +527,68 @@
WKBundlePageWillInjectUserScriptForFrameCallback willInjectUserScriptForFrame;
} WKBundlePageLoaderClientV9;
+typedef struct WKBundlePageLoaderClientV10 {
+ WKBundlePageLoaderClientBase base;
+
+ // Version 0.
+ WKBundlePageDidStartProvisionalLoadForFrameCallback didStartProvisionalLoadForFrame;
+ WKBundlePageDidReceiveServerRedirectForProvisionalLoadForFrameCallback didReceiveServerRedirectForProvisionalLoadForFrame;
+ WKBundlePageDidFailProvisionalLoadWithErrorForFrameCallback didFailProvisionalLoadWithErrorForFrame;
+ WKBundlePageDidCommitLoadForFrameCallback didCommitLoadForFrame;
+ WKBundlePageDidFinishDocumentLoadForFrameCallback didFinishDocumentLoadForFrame;
+ WKBundlePageDidFinishLoadForFrameCallback didFinishLoadForFrame;
+ WKBundlePageDidFailLoadWithErrorForFrameCallback didFailLoadWithErrorForFrame;
+ WKBundlePageDidSameDocumentNavigationForFrameCallback didSameDocumentNavigationForFrame;
+ WKBundlePageDidReceiveTitleForFrameCallback didReceiveTitleForFrame;
+ WKBundlePageDidFirstLayoutForFrameCallback didFirstLayoutForFrame;
+ WKBundlePageDidFirstVisuallyNonEmptyLayoutForFrameCallback didFirstVisuallyNonEmptyLayoutForFrame;
+ WKBundlePageDidRemoveFrameFromHierarchyCallback didRemoveFrameFromHierarchy;
+ WKBundlePageDidDisplayInsecureContentForFrameCallback didDisplayInsecureContentForFrame;
+ WKBundlePageDidRunInsecureContentForFrameCallback didRunInsecureContentForFrame;
+ WKBundlePageDidClearWindowObjectForFrameCallback didClearWindowObjectForFrame;
+ WKBundlePageDidCancelClientRedirectForFrameCallback didCancelClientRedirectForFrame;
+ WKBundlePageWillPerformClientRedirectForFrameCallback willPerformClientRedirectForFrame;
+ WKBundlePageDidHandleOnloadEventsForFrameCallback didHandleOnloadEventsForFrame;
+
+ // Version 1.
+ WKBundlePageDidLayoutForFrameCallback didLayoutForFrame;
+ void * didNewFirstVisuallyNonEmptyLayout_unavailable;
+ WKBundlePageDidDetectXSSForFrameCallback didDetectXSSForFrame;
+ WKBundlePageShouldGoToBackForwardListItemCallback shouldGoToBackForwardListItem;
+ WKBundlePageGlobalObjectIsAvailableForFrameCallback globalObjectIsAvailableForFrame;
+ WKBundlePageWillDisconnectDOMWindowExtensionFromGlobalObjectCallback willDisconnectDOMWindowExtensionFromGlobalObject;
+ WKBundlePageDidReconnectDOMWindowExtensionToGlobalObjectCallback didReconnectDOMWindowExtensionToGlobalObject;
+ WKBundlePageWillDestroyGlobalObjectForDOMWindowExtensionCallback willDestroyGlobalObjectForDOMWindowExtension;
+
+ // Version 2
+ WKBundlePageDidFinishProgressCallback didFinishProgress;
+ WKBundlePageShouldForceUniversalAccessFromLocalURLCallback shouldForceUniversalAccessFromLocalURL;
+
+ // Version 3
+ void * didReceiveIntentForFrame_unavailable;
+ void * registerIntentServiceForFrame_unavailable;
+
+ // Version 4
+ WKBundlePageDidLayoutCallback didLayout;
+
+ // Version 5
+ WKBundlePageFeaturesUsedInPageCallback featuresUsedInPage;
+
+ // Version 6
+ WKBundlePageWillLoadURLRequestCallback willLoadURLRequest;
+ WKBundlePageWillLoadDataRequestCallback willLoadDataRequest;
+
+ // Version 7
+ void * willDestroyFrame_unavailable;
+
+ // Version 8
+ WKBundlePageUserAgentForURLCallback userAgentForURL;
+
+ // Version 9
+ WKBundlePageWillInjectUserScriptForFrameCallback willInjectUserScriptForFrame;
+
+ // Version 10
+ WKBundlePageLayoutMilestonesCallback layoutMilestones;
+} WKBundlePageLoaderClientV10;
+
#endif // WKBundlePageLoaderClient_h
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (241127 => 241128)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2019-02-07 18:52:54 UTC (rev 241127)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2019-02-07 18:53:21 UTC (rev 241128)
@@ -192,6 +192,18 @@
[loadDelegate webProcessPlugInBrowserContextController:pluginContextController renderingProgressDidChange:renderingProgressEvents(WebKit::toLayoutMilestones(milestones))];
}
+static WKLayoutMilestones layoutMilestones(const void *clientInfo)
+{
+ auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
+ auto loadDelegate = pluginContextController->_loadDelegate.get();
+
+ if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextControllerRenderingProgressEvents:)]) {
+ _WKRenderingProgressEvents milestones = [loadDelegate webProcessPlugInBrowserContextControllerRenderingProgressEvents:pluginContextController];
+ return static_cast<WKLayoutMilestones>(milestones);
+ }
+ return { };
+}
+
static void didFirstVisuallyNonEmptyLayoutForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef* userData, const void *clientInfo)
{
auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;
@@ -229,10 +241,10 @@
static void setUpPageLoaderClient(WKWebProcessPlugInBrowserContextController *contextController, WebKit::WebPage& page)
{
- WKBundlePageLoaderClientV9 client;
+ WKBundlePageLoaderClientV10 client;
memset(&client, 0, sizeof(client));
- client.base.version = 8;
+ client.base.version = 10;
client.base.clientInfo = (__bridge void*)contextController;
client.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
client.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
@@ -250,6 +262,7 @@
client.didLayoutForFrame = didLayoutForFrame;
client.didLayout = didReachLayoutMilestone;
+ client.layoutMilestones = layoutMilestones;
WKBundlePageSetPageLoaderClient(toAPI(&page), &client.base);
}
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp (241127 => 241128)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp 2019-02-07 18:52:54 UTC (rev 241127)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp 2019-02-07 18:53:21 UTC (rev 241128)
@@ -365,6 +365,11 @@
OptionSet<WebCore::LayoutMilestone> InjectedBundlePageLoaderClient::layoutMilestones() const
{
+ if (m_client.layoutMilestones) {
+ auto milestones = m_client.layoutMilestones(m_client.base.clientInfo);
+ return toLayoutMilestones(milestones);
+ }
+
OptionSet<WebCore::LayoutMilestone> milestones;
if (m_client.didFirstLayoutForFrame)
milestones.add(WebCore::DidFirstLayout);
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h (241127 => 241128)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h 2019-02-07 18:52:54 UTC (rev 241127)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h 2019-02-07 18:53:21 UTC (rev 241128)
@@ -36,7 +36,7 @@
class String;
template<> struct ClientTraits<WKBundlePageLoaderClientBase> {
- typedef std::tuple<WKBundlePageLoaderClientV0, WKBundlePageLoaderClientV1, WKBundlePageLoaderClientV2, WKBundlePageLoaderClientV3, WKBundlePageLoaderClientV4, WKBundlePageLoaderClientV5, WKBundlePageLoaderClientV6, WKBundlePageLoaderClientV7, WKBundlePageLoaderClientV8, WKBundlePageLoaderClientV9> Versions;
+ typedef std::tuple<WKBundlePageLoaderClientV0, WKBundlePageLoaderClientV1, WKBundlePageLoaderClientV2, WKBundlePageLoaderClientV3, WKBundlePageLoaderClientV4, WKBundlePageLoaderClientV5, WKBundlePageLoaderClientV6, WKBundlePageLoaderClientV7, WKBundlePageLoaderClientV8, WKBundlePageLoaderClientV9, WKBundlePageLoaderClientV10> Versions;
};
}