[Webkit-unassigned] [Bug 58443] [GTK] Support the Filesystem API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 14 12:00:12 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=58443





--- Comment #48 from Zan Dobersek <zandobersek at gmail.com>  2012-05-14 11:59:16 PST ---
Hi, first off thanks for taking up the work here and sorry for such a late reply.

(In reply to comment #47)
> There are two ways of using the filesystem API, synchronously and asynchronously. Currently, the argument that determines whether the filesystem is asynchronous is ignored. See the call to LocalFileSystem::requestFileSystem in WorkerContextFileSystem::webkitRequestFileSystemSync and note that the "synchronous" parameter is ignored completely.

The synchronous methods are intended to be used with workers only.

> So before this patch can be reviewed, we need to determine (probably just by asking around) whether operations should be synchronous or asynchronous. My guess is that they should be asynchronous and that the synchronous version of the API will just block until the callback is called.

Operations (preferably GIO functions calls) should definitely be all asynchronous. The FileSystem API expects that all these operations are done via ScriptExecutionContext. This can be either a Document or a WorkerContext. If the former, calling scriptExecutionContext->postTask(task) will post the task on the main thread, if the latter, doing that will post the task on the worker thread. To use a unified approach for both cases the operations should all be asynchronous as, as said, you'd hate to clog up the main thread.

When using a synchronous version of the FileSystem API (through workers) all the calls should still be asynchronous because when using that version the SyncCallbackHelpers[1] are used that basically wait until the operation is complete (either succeeds or fails, producing an error).

> If that's the case, this patch shouldn't be doing operations synchronously and definitely should not be doing them on the main thread. This API can be used from a worker thread. An easy way to accomplish this is to simply use the asychronous versions of the GIO APIs.

While I was still trying to get things working now almost a year back, the main problem I was facing was keeping the AsyncFileSystemCallbacks objects around long enough for the asynchronous operation to complete so the callbacks could be triggered. Just to top it off I was trying for every operation being as asynchronous as possible - from GIO operations to even the callbacks being fired asynchronously.

[1] http://trac.webkit.org/browser/trunk/Source/WebCore/Modules/filesystem/SyncCallbackHelper.h

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list