WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
55644
[fileapi] Add URI resolution support to WorkerContext
https://bugs.webkit.org/show_bug.cgi?id=55644
Summary
[fileapi] Add URI resolution support to WorkerContext
Adam Klein
Reported
2011-03-02 18:54:45 PST
[fileapi] Add URI resolution support to WorkerContext
Attachments
Patch
(18.67 KB, patch)
2011-03-02 18:57 PST
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Patch
(18.89 KB, patch)
2011-03-03 12:10 PST
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Use an enum for internal create param
(19.16 KB, patch)
2011-03-03 14:08 PST
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Now with tests, but not ready for review
(35.07 KB, patch)
2011-03-18 14:47 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Ready for review, tests pass
(35.47 KB, patch)
2011-03-18 17:48 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Patch
(35.67 KB, patch)
2011-03-21 16:37 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
Adam Klein
Comment 1
2011-03-02 18:57:57 PST
Created
attachment 84508
[details]
Patch
Adam Klein
Comment 2
2011-03-02 18:59:11 PST
Depends on
http://codereview.chromium.org/6613008/
.
Kinuko Yasuda
Comment 3
2011-03-02 23:08:05 PST
Comment on
attachment 84508
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=84508&action=review
lgtm.
> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:60 > +void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous)
The implementation of this method is mostly same as that of requestFileSystem-- maybe we could factor out a common private method that takes all of parameters plus boolean create flag and make both readFileSystem and requestFileSystem a wrapper of the method.
Adam Klein
Comment 4
2011-03-03 12:09:45 PST
Comment on
attachment 84508
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=84508&action=review
>> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:60 >> +void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) > > The implementation of this method is mostly same as that of requestFileSystem-- maybe we could factor out a common private method that takes all of parameters plus boolean create flag and make both readFileSystem and requestFileSystem a wrapper of the method.
Good idea. I've done that. The only thing that I don't like about all this is the fact that there's two bools and a long long all together in one signature. Quite easy to screw up the order and break stuff. I'd like to come back to this code and redo the API with enums instead.
Adam Klein
Comment 5
2011-03-03 12:10:39 PST
Created
attachment 84604
[details]
Patch
Kinuko Yasuda
Comment 6
2011-03-03 12:24:13 PST
(In reply to
comment #5
)
> Created an attachment (id=84604) [details] > Patch
LGTM. (In reply to
comment #4
)
> > The implementation of this method is mostly same as that of requestFileSystem-- maybe we could factor out a common private method that takes all of parameters plus boolean create flag and make both readFileSystem and requestFileSystem a wrapper of the method. > > Good idea. I've done that. The only thing that I don't like about all this is the fact that there's two bools and a long long all together in one signature. Quite easy to screw up the order and break stuff. I'd like to come back to this code and redo the API with enums instead.
Agreed, the signature looks a bit messed up after repeated ad-hoc changes. Anyway the two public methods look nicer now, thanks for doing this.
Adam Klein
Comment 7
2011-03-03 12:57:49 PST
CCing some possible reviewers.
David Levin
Comment 8
2011-03-03 13:58:10 PST
Comment on
attachment 84604
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=84604&action=review
> Source/WebCore/ChangeLog:9 > + in the WebKit Chromium builds.
Why are are adding more stuff here if none of it is testable? (I thought I saw some tests for the file system in workers but maybe not.) If they aren't testable, can we fix that before adding more here.
> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:77 > + openFileSystemHelper(context, type, callbacks, synchronous, 0, false);
That last parameter should be an enum instead of a bool to make the call sites more readable.
Adam Klein
Comment 9
2011-03-03 14:08:35 PST
Created
attachment 84624
[details]
Use an enum for internal create param
Adam Klein
Comment 10
2011-03-03 14:10:49 PST
Comment on
attachment 84604
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=84604&action=review
>> Source/WebCore/ChangeLog:9 >> + in the WebKit Chromium builds. > > Why are are adding more stuff here if none of it is testable? (I thought I saw some tests for the file system in workers but maybe not.) > > If they aren't testable, can we fix that before adding more here.
Thanks for calling me on this. Kinuko, can you help here? Last time I tried to run the worker tests they just hung.
>> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:77 >> + openFileSystemHelper(context, type, callbacks, synchronous, 0, false); > > That last parameter should be an enum instead of a bool to make the call sites more readable.
Done.
Adam Klein
Comment 11
2011-03-03 14:19:51 PST
Removing review bit while I go get the filesystem sync tests running in Chromium.
David Levin
Comment 12
2011-03-03 16:24:38 PST
I saw this but then forgot to mention this before. Avoid abbreviations in WebKit. I'm referring to "fs" below: RefPtr<DOMFileSystemSync> fs = readFileSystemHelper.getResult(ec);
Adam Klein
Comment 13
2011-03-18 14:47:43 PDT
Created
attachment 86215
[details]
Now with tests, but not ready for review
Adam Klein
Comment 14
2011-03-18 14:48:54 PDT
The one thing holding this back from review is the backslash test: I can't figure out why it's passing in async mode but failing in sync. Will probably require a debugging session.
Adam Klein
Comment 15
2011-03-18 17:48:33 PDT
Created
attachment 86248
[details]
Ready for review, tests pass
Adam Klein
Comment 16
2011-03-21 14:52:35 PDT
Just a friendly ping that this is ready for review again, now with the tests David asked for.
Adam Barth
Comment 17
2011-03-21 15:08:53 PDT
I'm going to let dave_levin review this patch. I looked over it briefly and it looked sane to me. :)
David Levin
Comment 18
2011-03-21 15:58:41 PDT
Comment on
attachment 86248
[details]
Ready for review, tests pass View in context:
https://bugs.webkit.org/attachment.cgi?id=86248&action=review
Just a few minor things to address.
> Source/WebCore/fileapi/LocalFileSystem.h:57 > + void readFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, PassOwnPtr<AsyncFileSystemCallbacks>, bool synchronous = false);
Why add this parameter and then ignore it?
> Source/WebCore/workers/WorkerContext.h:136 > + void resolveLocalFileSystemURL(const String& url, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>);
The parameter name successCallback would add information in this case so it would be good to add it.
> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:67 > +void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous, long long size, CreationFlag create)
Function local to file should be "static".
Adam Klein
Comment 19
2011-03-21 16:37:33 PDT
Created
attachment 86384
[details]
Patch
Adam Klein
Comment 20
2011-03-21 16:41:40 PDT
Comment on
attachment 86248
[details]
Ready for review, tests pass View in context:
https://bugs.webkit.org/attachment.cgi?id=86248&action=review
>> Source/WebCore/fileapi/LocalFileSystem.h:57 >> + void readFileSystem(ScriptExecutionContext*, AsyncFileSystem::Type, PassOwnPtr<AsyncFileSystemCallbacks>, bool synchronous = false); > > Why add this parameter and then ignore it?
The code in fileapi/LocalFileSystem.cpp is a stubbed-out implementation that's not currently used since the Chromium port is the only one to implement FileSystem. My code's ignoring of the new parameter is just following in the footsteps of requestFileSystem, in this same file. Note that I do use the bool in LocalFileSystemChromium.cpp. Kinuko may be able to explain why this stubbed impl exists at all; it seems that things would work just fine without it.
>> Source/WebCore/workers/WorkerContext.h:136 >> + void resolveLocalFileSystemURL(const String& url, PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>); > > The parameter name successCallback would add information in this case so it would be good to add it.
Added the name here, and above for requestFileSystem for consistency.
>> Source/WebKit/chromium/src/LocalFileSystemChromium.cpp:67 >> +void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous, long long size, CreationFlag create) > > Function local to file should be "static".
Function was already inside an anonymous namespace, but I've moved the namespace up to cover only the enum, and made the function static. Let me know if you want the function inside the namespace, but that seems redundant to me.
WebKit Commit Bot
Comment 21
2011-03-21 20:31:53 PDT
The commit-queue encountered the following flaky tests while processing
attachment 86384
[details]
: fast/dom/onerror-img.html
bug 51019
The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 22
2011-03-21 20:35:24 PDT
Comment on
attachment 86384
[details]
Patch Clearing flags on attachment: 86384 Committed
r81640
: <
http://trac.webkit.org/changeset/81640
>
WebKit Commit Bot
Comment 23
2011-03-21 20:35:29 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.
Top of Page
Format For Printing
XML
Clone This Bug