Re: XHR and the storage mutex

On Thu, 26 Mar 2009 09:50:27 +0100, Ian Hickson <ian@hixie.ch> wrote:
> HTML5 now has a "storage mutex" concept to cope with cookies being set in
> a multiprocess UA architecture without having scripts be exposed to race
> conditions.
>
> This affects XHR in a couple of ways.
>
> For both sync and async XHR, we should add a must-level requirement that
> UAs are to "obtain the storage mutex" (term of art defined in HTML5)
> before setting cookies.
>
> For sync XHR, we should add a must-level requirement that UAs are to
> "release the storage mutex" (storage mutex is a term of art defined in
> HTML5) at the start of the sync process and again immediately after
> setting cookies.

XMLHttpRequest is currently completely transparent to cookies. Maybe I can "simply" use the "fetch" algorithm as defined by HTML5?

Looking at that algorithm, how do I hook into it? E.g. for synchronous requests I want to wait until the request has completed (though I want to handle redirects, network errors, user aborting the request, etc.). For asynchronous requests it is mostly the same but I also want to dispatch events. Do these events require a new task source?


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Monday, 4 May 2009 14:53:25 UTC