[webkit-reviews] review granted: [Bug 176165] Implement FileSystemEntry.getParent() : [Attachment 319564] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 1 09:54:51 PDT 2017


Andreas Kling <akling at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 176165: Implement FileSystemEntry.getParent()
https://bugs.webkit.org/show_bug.cgi?id=176165

Attachment 319564: Patch

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




--- Comment #3 from Andreas Kling <akling at apple.com> ---
Comment on attachment 319564
  --> https://bugs.webkit.org/attachment.cgi?id=319564
Patch

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

> Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp:92
> +    return !virtualPath.isEmpty() && virtualPath[0] == '/';

The isEmpty() check here is redundant but I hate that operator[] API returns a
null character for invalid indices so let's not even care about that.

> Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp:67
> +void FileSystemEntry::getParent(ScriptExecutionContext& context,
RefPtr<FileSystemEntryCallback>&& successCallback, RefPtr<ErrorCallback>&&
errorCallback)

If we have neither successCallback or errorCallback, we could just early return
here, no need to do work. Silly that the API allows this at all.

> Source/WebCore/Modules/entriesapi/FileSystemEntry.cpp:74
> +	   if (result.hasException()) {
> +	       if (errorCallback)
> +		  
errorCallback->handleEvent(DOMException::create(result.releaseException()));
> +	       return;
> +	   }

This is not covered by the layout tests.


More information about the webkit-reviews mailing list