New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use WKDataTask for SystemPreview downloads #13171
Use WKDataTask for SystemPreview downloads #13171
Conversation
EWS run on previous version of this PR (hash 608e61e) |
return; | ||
} | ||
|
||
[_data.get() appendData:data]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no .get()
@@ -59,6 +61,8 @@ + (void)launchPreviewApplicationWithURLs:(NSArray *)urls completion:(void (^)(NS | |||
|
|||
static NSString * const _WKARQLWebsiteURLParameterKey = @"ARQLWebsiteURLParameterKey"; | |||
|
|||
const int64_t SystemPreviewMaximumSize = 40 * 1024 * 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems awfully tiny
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove the limit.
auto filePath = FileSystem::openTemporaryFile("SystemPreview"_s, fileHandle, ".usdz"_s); | ||
ASSERT(FileSystem::isHandleValid(fileHandle)); | ||
|
||
size_t byteCount = FileSystem::writeToFile(fileHandle, _data.get().bytes, _data.get().length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would [_data bytes] (etc.), but I know some people like this instead?
@interface _WKSystemPreviewDataTaskDelegate : NSObject <_WKDataTaskDelegate> { | ||
WebKit::SystemPreviewController* _previewController; | ||
long long _expectedContentLength; | ||
long long _receivedLength; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this variable used anywhere?
608e61e
to
f7acd1d
Compare
f7acd1d
to
adb2bc1
Compare
EWS run on previous version of this PR (hash adb2bc1)
|
adb2bc1
to
65b5f69
Compare
EWS run on current version of this PR (hash 65b5f69)
|
65b5f69
to
369b7ba
Compare
https://bugs.webkit.org/show_bug.cgi?id=255954 rdar://108524222 Reviewed by Tim Horton. Migrate away from LegacyDownloadClient and instead handle System Previews directly. This will allow us to remove the horrible code in the download client, as well eventually allow 3rd-party engines to use ARQL. The fix is to intercept the HTMLAnchorElement click for a system preview, and send that directly to the SystemPreviewController in the UI Process. That object then creates a WKDataTask for the download and presents ARQL as normal. A followup patch will remove the old code. * Source/WebCore/html/HTMLAnchorElement.cpp: * Source/WebCore/page/ChromeClient.h: * Source/WebCore/page/Page.cpp: * Source/WebCore/page/Page.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm: * Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: * Source/WebKit/UIProcess/SystemPreviewController.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebPageProxy.messages.in: * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/SystemPreview.mm: (-[TestSystemPreviewUIDelegate _presentingViewControllerForWebView:]): (TestWebKitAPI::TEST): * Tools/TestWebKitAPI/Tests/WebKitCocoa/UnitBox.usdz: Added. * Tools/TestWebKitAPI/Tests/WebKitCocoa/system-preview-trigger.html: * Tools/TestWebKitAPI/Tests/WebKitCocoa/system-preview.html: Added. Canonical link: https://commits.webkit.org/263393@main
369b7ba
to
d55e3ca
Compare
Committed 263393@main (d55e3ca): https://commits.webkit.org/263393@main Reviewed commits have been landed. Closing PR #13171 and removing active labels. |
d55e3ca
65b5f69
π iosπ wincairoπ§ͺ bindingsπ ios-simπ mac-AS-debugπ§ͺ wpe-wk2π§ͺ webkitperlπ§ͺ ios-wk2π§ͺ api-macπ§ͺ ios-wk2-wptπ§ͺ mac-wk1π§ͺ gtk-wk2π§ͺ api-iosπ§ͺ mac-wk2π§ͺ api-gtkπ tvπ§ͺ mac-AS-debug-wk2π tv-simπ§ͺ mac-wk2-stressπ watchπ watch-sim