[webkit-reviews] review granted: [Bug 176000] Add WKUIDelegatePrivate equivalent of WKPageUIClient's saveDataToFileInDownloadsFolder : [Attachment 319109] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 25 16:17:16 PDT 2017


Andy Estes <aestes at apple.com> has granted Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 176000: Add WKUIDelegatePrivate equivalent of WKPageUIClient's
saveDataToFileInDownloadsFolder
https://bugs.webkit.org/show_bug.cgi?id=176000

Attachment 319109: Patch

https://bugs.webkit.org/attachment.cgi?id=319109&action=review




--- Comment #2 from Andy Estes <aestes at apple.com> ---
Comment on attachment 319109
  --> https://bugs.webkit.org/attachment.cgi?id=319109
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:6126
> +    saveDataToFileInDownloadsFolder(WTFMove(suggestedFilename),
"application/pdf", WTFMove(originatingURL),

Can you use ASCIILiteral() for "application/pdf"?

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/UIDelegate.mm:178
> +    EXPECT_EQ(webView, saveDataToFileArguments.webView);
> +    EXPECT_TRUE([saveDataToFileArguments.data isEqualToData:[NSData
dataWithContentsOfURL:pdfURL]]);
> +    EXPECT_STREQ([saveDataToFileArguments.suggestedFilename UTF8String],
"test.pdf");
> +    EXPECT_STREQ([saveDataToFileArguments.mimeType UTF8String],
"application/pdf");
> +    EXPECT_STREQ([[saveDataToFileArguments.url absoluteString] UTF8String],
[[pdfURL absoluteString] UTF8String]);

This is fine, but you could just move these EXPECTs into
-_webView:saveDataToFile:suggestedFilename:mimeType:originatingURL: and avoid
creating a struct.


More information about the webkit-reviews mailing list