RESOLVED FIXED 175779
Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
https://bugs.webkit.org/show_bug.cgi?id=175779
Summary Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolv...
Alex Christensen
Reported 2017-08-21 12:22:45 PDT
Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
Attachments
Patch (33.29 KB, patch)
2017-08-21 12:26 PDT, Alex Christensen
no flags
Patch (34.04 KB, patch)
2017-08-21 14:22 PDT, Alex Christensen
no flags
Patch (34.01 KB, patch)
2017-08-31 18:43 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2017-08-21 12:26:21 PDT
mitz
Comment 2 2017-08-21 13:58:33 PDT
Comment on attachment 318659 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318659&action=review > Source/WebKit/UIProcess/Cocoa/NavigationState.mm:324 > +void NavigationState::NavigationClient::webGLLoadPolicy(WebPageProxy&, const WebCore::URL& url, WTF::Function<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const > +{ > + if (!m_navigationState.m_navigationDelegateMethods.webViewWebGLLoadPolicyForURL) > + completionHandler(WebGLAllowCreation); > + > + [(id <WKNavigationDelegatePrivate>)m_navigationState.m_navigationDelegate _webView:m_navigationState.m_webView webGLLoadPolicyForURL:(NSURL *)url decisionHandler:BlockPtr<void(_WKWebGLLoadPolicy)>::fromCallable([completionHandler = WTFMove(completionHandler)](_WKWebGLLoadPolicy policy) { > + completionHandler(toWebCoreWebGLLoadPolicy(policy)); > + }).get()]; > +} > + > +void NavigationState::NavigationClient::resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL& url, WTF::Function<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const > +{ > + if (!m_navigationState.m_navigationDelegateMethods.webViewResolveWebGLLoadPolicyForURL) > + completionHandler(WebGLAllowCreation); > + > + [(id <WKNavigationDelegatePrivate>)m_navigationState.m_navigationDelegate _webView:m_navigationState.m_webView resolveWebGLLoadPolicyForURL:(NSURL *)url decisionHandler:BlockPtr<void(_WKWebGLLoadPolicy)>::fromCallable([completionHandler = WTFMove(completionHandler)](_WKWebGLLoadPolicy policy) { > + completionHandler(toWebCoreWebGLLoadPolicy(policy)); > + }).get()]; > +} Might be good to use a CompletionHandlerCallChecker in each of these functions.
Alex Christensen
Comment 3 2017-08-21 14:22:53 PDT
Tim Horton
Comment 4 2017-08-31 17:42:28 PDT
Comment on attachment 318670 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318670&action=review > Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebGLPolicy.mm:100 > + return [[a absoluteString] isEqualToString:[b absoluteString]]; Why not NSURL equality?
WebKit Commit Bot
Comment 5 2017-08-31 18:00:13 PDT
Comment on attachment 318670 [details] Patch Rejecting attachment 318670 [details] from commit-queue. Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 318670, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit Last 500 characters of output: .xcodeproj/project.pbxproj Hunk #1 FAILED at 231. Hunk #2 FAILED at 1302. Hunk #3 succeeded at 1972 (offset 23 lines). Hunk #4 succeeded at 3362 (offset 32 lines). 2 out of 4 hunks FAILED -- saving rejects to file Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj.rej patching file Tools/TestWebKitAPI/Tests/WebKit2Cocoa/WebGLPolicy.mm Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Tim Horton']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit Full output: http://webkit-queues.webkit.org/results/4420648
Alex Christensen
Comment 6 2017-08-31 18:43:39 PDT
Alex Christensen
Comment 7 2017-08-31 18:46:40 PDT
Ryan Haddad
Comment 8 2017-09-01 08:52:29 PDT
The API test added with this change is failing on iOS simulator. Should it be disabled there? https://build.webkit.org/builders/Apple%20iOS%2010%20Simulator%20Release%20WK2%20(Tests)/builds/4026
Alex Christensen
Comment 9 2017-09-01 10:58:22 PDT
Fixing in https://bugs.webkit.org/show_bug.cgi?id=176233 If EWS ran API tests, this never would've been an issue.
Radar WebKit Bug Importer
Comment 10 2017-09-27 12:56:21 PDT
Note You need to log in before you can comment on or make changes to this bug.