RESOLVED FIXED 176166
Implement FileSystemFileEntry.file()
https://bugs.webkit.org/show_bug.cgi?id=176166
Summary Implement FileSystemFileEntry.file()
Chris Dumez
Reported 2017-08-31 09:46:06 PDT
Attachments
Patch (15.69 KB, patch)
2017-09-02 19:45 PDT, Chris Dumez
no flags
Patch (18.29 KB, patch)
2017-09-02 20:32 PDT, Chris Dumez
no flags
Radar WebKit Bug Importer
Comment 1 2017-08-31 09:46:26 PDT
Chris Dumez
Comment 2 2017-09-02 19:45:51 PDT
Sam Weinig
Comment 3 2017-09-02 20:04:18 PDT
Comment on attachment 319752 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=319752&action=review > Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp:168 > + if (!getFileMetadata(fullPath, metadata, ShouldFollowSymbolicLinks::No)) > + return Exception { NotFoundError, ASCIILiteral("Path does not exist") }; Is it time we had a getFileMetadata that returned an std::optional<FileMetadata> or Expected<FileMetadata>? > Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp:321 > + String virtualPath = fileEntry.virtualPath(); > + String fullPath = evaluatePath(virtualPath); could use auto here. > Source/WebCore/Modules/entriesapi/FileSystemFileEntry.cpp:53 > + if (successCallback) > + successCallback->handleEvent(result.releaseReturnValue()); I'm possibly looking at the wrong version of the spec, https://wicg.github.io/entries-api/#api-fileentry, but it looks to me like success callback should not be nullable, so I think you can update the IDL and remove this null check.
Chris Dumez
Comment 4 2017-09-02 20:26:34 PDT
Comment on attachment 319752 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=319752&action=review >> Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp:168 >> + return Exception { NotFoundError, ASCIILiteral("Path does not exist") }; > > Is it time we had a getFileMetadata that returned an std::optional<FileMetadata> or Expected<FileMetadata>? Yes, I can do this in a follow-up. >> Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp:321 >> + String fullPath = evaluatePath(virtualPath); > > could use auto here. Hmm, OK. This is almost the same length :) >> Source/WebCore/Modules/entriesapi/FileSystemFileEntry.cpp:53 >> + successCallback->handleEvent(result.releaseReturnValue()); > > I'm possibly looking at the wrong version of the spec, https://wicg.github.io/entries-api/#api-fileentry, but it looks to me like success callback should not be nullable, so I think you can update the IDL and remove this null check. Hmm, you're right. Not sure how I got this wrong. Will fix.
Chris Dumez
Comment 5 2017-09-02 20:32:43 PDT
WebKit Commit Bot
Comment 6 2017-09-02 21:02:08 PDT
Comment on attachment 319755 [details] Patch Clearing flags on attachment: 319755 Committed r221544: <http://trac.webkit.org/changeset/221544>
WebKit Commit Bot
Comment 7 2017-09-02 21:02:10 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.