Bug 87969 - [chromium] DataTransferItem.webkitGetAsEntry() should synchronously return entry
Summary: [chromium] DataTransferItem.webkitGetAsEntry() should synchronously return entry
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kinuko Yasuda
URL:
Keywords:
Depends on:
Blocks: 76809
  Show dependency treegraph
 
Reported: 2012-05-31 06:45 PDT by Kinuko Yasuda
Modified: 2012-06-04 21:10 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.37 KB, patch)
2012-05-31 07:06 PDT, Kinuko Yasuda
tony: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kinuko Yasuda 2012-05-31 06:45:10 PDT
[chromium] DataTransferItem.webkitGetAsEntry() should synchronously return entry.

We were adding DataTransferItem.webkitGetAsEntry(callback) which asynchronously returns FileEntry/DirectoryEntry for drag-and-dropped files, but on the public whatwg ML we got the feedback that this method should synchronously return Entry.
(Right now this is only implemented on chromium)

http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Apr/0079.html
http://lists.w3.org/Archives/Public/public-whatwg-archive/2012Apr/0111.html
Comment 1 Kinuko Yasuda 2012-05-31 07:06:34 PDT
Created attachment 145083 [details]
Patch
Comment 2 Kinuko Yasuda 2012-05-31 23:56:39 PDT
Adding some more filesystem folks to solicit unofficial review.
Comment 3 Tony Chang 2012-06-01 10:48:23 PDT
Comment on attachment 145083 [details]
Patch

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

> Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp:80
> +    // FIXME: This involves synchronous file operation. We need to pass file type data when we dispatch drag event.

If the file on disk changes during the drag, should calls to webkitGetAsEntry() return current information?  If so, you probably can't do this optimization.
Comment 4 Kinuko Yasuda 2012-06-03 08:23:48 PDT
Comment on attachment 145083 [details]
Patch

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

>> Source/WebCore/Modules/filesystem/chromium/DataTransferItemFileSystemChromium.cpp:80
>> +    // FIXME: This involves synchronous file operation. We need to pass file type data when we dispatch drag event.
> 
> If the file on disk changes during the drag, should calls to webkitGetAsEntry() return current information?  If so, you probably can't do this optimization.

Good point, it's a bit questionable.  Actually if file<->directory changes we may rather want to return a stale Entry which yields InvalidStateError errors.  I'll update the comment and bring it up on the public list.
Comment 5 Kinuko Yasuda 2012-06-03 22:38:23 PDT
Committed r119371: <http://trac.webkit.org/changeset/119371>