Add ObjC SPI corresponding to WKPageLoaderClient's webGLLoadPolicy and resolveWebGLLoadPolicy
Created attachment 318659 [details] Patch
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.
Created attachment 318670 [details] Patch
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?
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
Created attachment 319561 [details] Patch
http://trac.webkit.org/r221465
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
Fixing in https://bugs.webkit.org/show_bug.cgi?id=176233 If EWS ran API tests, this never would've been an issue.
<rdar://problem/34694350>