Implement FileSystemFileEntry.file(): - https://wicg.github.io/entries-api/#dom-filesystemfileentry-file
<rdar://problem/34187756>
Created attachment 319752 [details] Patch
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.
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.
Created attachment 319755 [details] Patch
Comment on attachment 319755 [details] Patch Clearing flags on attachment: 319755 Committed r221544: <http://trac.webkit.org/changeset/221544>
All reviewed patches have been landed. Closing bug.