[whatwg] RFC: Alternatives to storage mutex for cookies and localStorage

Robert O'Callahan robert at ocallahan.org
Tue Sep 8 05:21:53 PDT 2009


On Tue, Sep 8, 2009 at 9:38 PM, Aaron Boodman <aa at google.com> wrote:

> On Tue, Sep 8, 2009 at 2:02 AM, Robert O'Callahan<robert at ocallahan.org>
> wrote:
> > Looking back over previous threads on the storage mutex, I can't seem to
> > remember or find the reason that implementing the storage mutex for
> cookies
> > can't easily be done with a mutex per domain. Ian pointed out this
> approach
> > breaks if you can make synchronous script calls across origins (e.g.
> across
> > IFRAME boundaries), but can you actually make such calls? Or if you can
> > (NPAPI?), can we just declare that those APIs release the storage mutex?
>
> I believe that synchronous cross-origin calls are possible a variety
> of ways. Here is one way I found with a quick test: Resize an iframe
> element. window.onresize is fired synchronously inside the frame. I
> bet there are others.
>

What spec says that onresize should fire synchronously? I'm actually pretty
sure no-one should be saying that, since layout is "mostly asynchronous" in
Webkit and Gecko and I don't want any spec to impose mostly-unobservable
requirements about when layout should happen.

> I know that setting document.domain makes this tricky because it
> > synchronously enables new cross-domain interactions, but can't we handle
> > that by declaring that setting document.domain releases the storage
> mutex?
>
> All of these different ways that the storage mutex gets implicitly
> released lead to weird behavior in edge cases. In my opinion, it would
> be better to fix the API in a clean way than keep patching it like
> this.
>
>
document.domain is a crazy API. So are sync XHRs which I believe also drop
the mutex. I'm comfortable with these cases dropping the mutex ... much more
comfortable than not having the mutex at all.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090909/d6ea2fb4/attachment-0002.htm>


More information about the whatwg mailing list