RESOLVED FIXED Bug 76826
[chromium] Add isolated filesystem type and WebDragData::filesystem_id for drag-and-drop using File/DirectoryEntry.
https://bugs.webkit.org/show_bug.cgi?id=76826
Summary [chromium] Add isolated filesystem type and WebDragData::filesystem_id for dr...
Kinuko Yasuda
Reported 2012-01-23 06:40:24 PST
[chromium] Add isolated filesystem type and WebDragData::filesystem_id for drag-and-drop using File/DirectoryEntry.
Attachments
Patch (10.68 KB, patch)
2012-03-27 08:29 PDT, Kinuko Yasuda
no flags
Patch (10.70 KB, patch)
2012-03-27 09:58 PDT, Kinuko Yasuda
no flags
Patch (10.79 KB, patch)
2012-03-27 16:50 PDT, Kinuko Yasuda
no flags
Patch (11.08 KB, patch)
2012-03-27 17:21 PDT, Kinuko Yasuda
no flags
Patch (11.28 KB, patch)
2012-03-28 04:30 PDT, Kinuko Yasuda
no flags
Patch (11.40 KB, patch)
2012-03-28 04:39 PDT, Kinuko Yasuda
levin: review+
Kinuko Yasuda
Comment 1 2012-03-27 08:29:48 PDT
WebKit Review Bot
Comment 2 2012-03-27 08:32:03 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
WebKit Review Bot
Comment 3 2012-03-27 09:12:51 PDT
Comment on attachment 134071 [details] Patch Attachment 134071 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12142577
Kinuko Yasuda
Comment 4 2012-03-27 09:58:38 PDT
Created attachment 134087 [details] Patch Fixed build.
Tony Chang
Comment 5 2012-03-27 12:04:39 PDT
Daniel, do you want to review the changes to WebDragData?
Daniel Cheng
Comment 6 2012-03-27 13:29:03 PDT
Comment on attachment 134087 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134087&action=review WebDragData changes look good to me. However, do we want to wrap the new WebDragData methods in #if ENABLE(FILE_SYSTEM) blocks? > Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:178 > + filesystemName.append(document->securityOrigin()->databaseIdentifier()); Unrelated, but it seems kind of odd that this is called 'databaseIdentifier', but we're using it a non-database context. It seems like it could use a better name.
David Levin
Comment 7 2012-03-27 13:41:03 PDT
Comment on attachment 134087 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134087&action=review > Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:62 > +const AsyncFileSystem::Type isolatedType = static_cast<AsyncFileSystem::Type>(WebKit::WebFileSystem::TypeIsolated); Why isn't there a AsyncFileSystem::Type value that can be assigned here? (Should there be one?) > Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:64 > +const size_t isolatedPathPrefixLength = sizeof(isolatedPathPrefix) - 1; This seems unused. Why have it? > Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:190 > + rootURL.append(filesystemId); Where does filesystemId get validated? > Source/WebKit/chromium/src/PlatformSupport.cpp:103 > +#if ENABLE(FILE_SYSTEM) This if shouldn't be in the middle of other include's. (If it is needed, it should be after all other include's. Alternatively, can we leave out the if ENABLE completely and always include those header files?) > Source/WebKit/chromium/src/WebDragData.cpp:127 > +WebString WebDragData::filesystemId() const This part of the change along with the corresponding change in Source/WebKit/chromium/public/platform/WebDragData.h seems detached from everything else. In addition, it has no implementation and requires a different approval due to the change in a chromium/public directory. Why not pull it out of this patch?
Kinuko Yasuda
Comment 8 2012-03-27 16:47:31 PDT
Comment on attachment 134087 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134087&action=review >> Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:62 >> +const AsyncFileSystem::Type isolatedType = static_cast<AsyncFileSystem::Type>(WebKit::WebFileSystem::TypeIsolated); > > Why isn't there a AsyncFileSystem::Type value that can be assigned here? (Should there be one?) Currently it's only used in chromium port, so I wanted to keep it in chromium local. (I could expose it if it'd look better) >> Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:64 >> +const size_t isolatedPathPrefixLength = sizeof(isolatedPathPrefix) - 1; > > This seems unused. Why have it? Will remove. >> Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:178 >> + filesystemName.append(document->securityOrigin()->databaseIdentifier()); > > Unrelated, but it seems kind of odd that this is called 'databaseIdentifier', but we're using it a non-database context. It seems like it could use a better name. True, we've been historically using this string as identifier in several storage implementation not only in database. I won't change it in this cl but storageIdentifier or something would be better. >> Source/WebKit/chromium/src/AsyncFileSystemChromium.cpp:190 >> + rootURL.append(filesystemId); > > Where does filesystemId get validated? The synthesized rootURL (as well as filesystemId) is attached to every succeeding filesystem request and is validated each time in the browser process. I'll add the comment here. >> Source/WebKit/chromium/src/PlatformSupport.cpp:103 >> +#if ENABLE(FILE_SYSTEM) > > This if shouldn't be in the middle of other include's. (If it is needed, it should be after all other include's. Alternatively, can we leave out the if ENABLE completely and always include those header files?) Will remove this ENABLE if/endif. >> Source/WebKit/chromium/src/WebDragData.cpp:127 >> +WebString WebDragData::filesystemId() const > > This part of the change along with the corresponding change in Source/WebKit/chromium/public/platform/WebDragData.h seems detached from everything else. > > In addition, it has no implementation and requires a different approval due to the change in a chromium/public directory. Why not pull it out of this patch? I wanted to include the change where the 'filesystemId' is given (since other part and the actual implementation rely on the WebDragData change). This patch also contains other chromium/public change (in WebFileSystem), so I thought it might be convenient. (As you say it may look slightly irrelevant though.)
Kinuko Yasuda
Comment 9 2012-03-27 16:50:08 PDT
David Levin
Comment 10 2012-03-27 16:51:55 PDT
Comment on attachment 134168 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134168&action=review ok with me. You'll need approval from one of the above listed folks for the public change. > Source/WebKit/chromium/src/WebDragData.cpp:135 > + // FIXME: implement this. Would prefer a comment here saying that filesystemId must be validated and something about how it must be validated. (It shouldn't contain / or .. etc.)
Kinuko Yasuda
Comment 11 2012-03-27 17:21:52 PDT
Kinuko Yasuda
Comment 12 2012-03-27 17:25:54 PDT
Comment on attachment 134168 [details] Patch Thanks, updated. Could someone in WebKit API reviewers take a look at the chromium/public changes? View in context: https://bugs.webkit.org/attachment.cgi?id=134168&action=review >> Source/WebKit/chromium/src/WebDragData.cpp:135 >> + // FIXME: implement this. > > Would prefer a comment here saying that filesystemId must be validated and something about how it must be validated. (It shouldn't contain / or .. etc.) Done.
Adam Barth
Comment 13 2012-03-27 23:51:08 PDT
Comment on attachment 134177 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=134177&action=review > Source/WebCore/platform/chromium/PlatformSupport.h:153 > +#if ENABLE(FILE_SYSTEM) > + static PassRefPtr<DOMFileSystem> createIsolatedFileSystem(Document*, const String& filesystemId); > +#endif This isn't correct. Nothing in WebCore/platform is allowed to know about Documents. Code in WebCore/platform cannot depend on WebCore code outside of WebCore/platform and Document.h is outside of WebCore/platform. > Source/WebKit/chromium/public/platform/WebFileSystem.h:50 > + // Used by ChromeOS. I'd skip these comments. Rather than saying who uses these types (which might change), it might be better to explain what these types mean.
Kinuko Yasuda
Comment 14 2012-03-28 04:30:54 PDT
Kinuko Yasuda
Comment 15 2012-03-28 04:39:55 PDT
Kinuko Yasuda
Comment 16 2012-03-28 04:46:57 PDT
Comment on attachment 134177 [details] Patch Thanks, updated the patch. View in context: https://bugs.webkit.org/attachment.cgi?id=134177&action=review >> Source/WebCore/platform/chromium/PlatformSupport.h:153 >> +#endif > > This isn't correct. Nothing in WebCore/platform is allowed to know about Documents. Code in WebCore/platform cannot depend on WebCore code outside of WebCore/platform and Document.h is outside of WebCore/platform. Fixed. (This file seems to have a lot of methods that refer Document or other WebCore objects though, which made me think this might be an exception.) >> Source/WebKit/chromium/public/platform/WebFileSystem.h:50 >> + // Used by ChromeOS. > > I'd skip these comments. Rather than saying who uses these types (which might change), it might be better to explain what these types mean. Good point, updated the comment.
Adam Barth
Comment 17 2012-03-28 10:32:24 PDT
> Fixed. (This file seems to have a lot of methods that refer Document or other WebCore objects though, which made me think this might be an exception.) Yeah, we have a lot of technical debt to pay. :-/
Adam Barth
Comment 18 2012-03-28 10:35:28 PDT
Comment on attachment 134266 [details] Patch WebKit API changes LGTM. Thanks!
Kinuko Yasuda
Comment 19 2012-03-28 16:35:30 PDT
(In reply to comment #18) > (From update of attachment 134266 [details]) > WebKit API changes LGTM. Thanks! David (levin@), would you be able to take the last look to flip r? Thanks!
Kinuko Yasuda
Comment 20 2012-03-29 02:42:09 PDT
Note You need to log in before you can comment on or make changes to this bug.