Skip to content
Permalink
Browse files

[] (0) Allow UAs to opt out of the storage mutex and corrupt data ins…

…tead of being slow.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13020

git-svn-id: http://svn.whatwg.org/webapps@6368 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Aug 4, 2011
1 parent c5c1b19 commit 56cf59c0db64121878c735c042862c3a2a0ac689
Showing with 64 additions and 15 deletions.
  1. +21 −5 complete.html
  2. +21 −5 index
  3. +22 −5 source
was queued; if the task was queued by or for a <a href=#concept-script title=concept-script>script</a> then the document is the
<a href="#script's-document">script's document</a>.</p>

<p>A user agent is required to have one <dfn id=storage-mutex>storage
mutex</dfn>. This mutex is used to control access to shared state
like cookies. At any one point, the <a href=#storage-mutex>storage mutex</a> is
either free, or owned by a particular <a href=#event-loop>event loop</a> or
instance of the <a href=#fetch title=fetch>fetching</a> algorithm.</p>
<p>A user agent may have one <dfn id=storage-mutex>storage mutex</dfn>. This mutex is
used to control access to shared state like cookies. At any one
point, the <a href=#storage-mutex>storage mutex</a> is either free, or owned by a
particular <a href=#event-loop>event loop</a> or instance of the <a href=#fetch title=fetch>fetching</a> algorithm.</p>

<p>If a user agent does not implement a <a href=#storage-mutex>storage mutex</a>,
it is exempt from implementing the requirements that require it to
acquire or release it.</p>

<p class=note>User agent implementors have to make a choice
between two evils. On the one hand, not implementing the storage
mutex means that there is a risk of data corruption: a site could,
for instance, try to read a cookie, increment its value, then write
it back out, using the new value of the cookie as a unique
identifier for the session; if the site does this twice in two
different browser windows at the same time, it might end up using
the same "unique" identifier for both sessions, with potentially
disastrous effects. On the other hand, implementing the storage
mutex has potentially serious performance implications: whenever a
site uses Web Storage or cookies, all other sites that try to use
Web Storage or cookies are blocked until the first site finishes.</p>

<p>Whenever a <a href=#concept-script title=concept-script>script</a> calls into
a <a href=#plugin>plugin</a>, and whenever a <a href=#plugin>plugin</a> calls into
26 index
was queued; if the task was queued by or for a <a href=#concept-script title=concept-script>script</a> then the document is the
<a href="#script's-document">script's document</a>.</p>

<p>A user agent is required to have one <dfn id=storage-mutex>storage
mutex</dfn>. This mutex is used to control access to shared state
like cookies. At any one point, the <a href=#storage-mutex>storage mutex</a> is
either free, or owned by a particular <a href=#event-loop>event loop</a> or
instance of the <a href=#fetch title=fetch>fetching</a> algorithm.</p>
<p>A user agent may have one <dfn id=storage-mutex>storage mutex</dfn>. This mutex is
used to control access to shared state like cookies. At any one
point, the <a href=#storage-mutex>storage mutex</a> is either free, or owned by a
particular <a href=#event-loop>event loop</a> or instance of the <a href=#fetch title=fetch>fetching</a> algorithm.</p>

<p>If a user agent does not implement a <a href=#storage-mutex>storage mutex</a>,
it is exempt from implementing the requirements that require it to
acquire or release it.</p>

<p class=note>User agent implementors have to make a choice
between two evils. On the one hand, not implementing the storage
mutex means that there is a risk of data corruption: a site could,
for instance, try to read a cookie, increment its value, then write
it back out, using the new value of the cookie as a unique
identifier for the session; if the site does this twice in two
different browser windows at the same time, it might end up using
the same "unique" identifier for both sessions, with potentially
disastrous effects. On the other hand, implementing the storage
mutex has potentially serious performance implications: whenever a
site uses Web Storage or cookies, all other sites that try to use
Web Storage or cookies are blocked until the first site finishes.</p>

<p>Whenever a <a href=#concept-script title=concept-script>script</a> calls into
a <a href=#plugin>plugin</a>, and whenever a <a href=#plugin>plugin</a> calls into
27 source
title="concept-script">script</span> then the document is the
<span>script's document</span>.</p>

<p>A user agent is required to have one <dfn>storage
mutex</dfn>. This mutex is used to control access to shared state
like cookies. At any one point, the <span>storage mutex</span> is
either free, or owned by a particular <span>event loop</span> or
instance of the <span title="fetch">fetching</span> algorithm.</p>
<p>A user agent may have one <dfn>storage mutex</dfn>. This mutex is
used to control access to shared state like cookies. At any one
point, the <span>storage mutex</span> is either free, or owned by a
particular <span>event loop</span> or instance of the <span
title="fetch">fetching</span> algorithm.</p>

<p>If a user agent does not implement a <span>storage mutex</span>,
it is exempt from implementing the requirements that require it to
acquire or release it.</p>

<p class="note">User agent implementors have to make a choice
between two evils. On the one hand, not implementing the storage
mutex means that there is a risk of data corruption: a site could,
for instance, try to read a cookie, increment its value, then write
it back out, using the new value of the cookie as a unique
identifier for the session; if the site does this twice in two
different browser windows at the same time, it might end up using
the same "unique" identifier for both sessions, with potentially
disastrous effects. On the other hand, implementing the storage
mutex has potentially serious performance implications: whenever a
site uses Web Storage or cookies, all other sites that try to use
Web Storage or cookies are blocked until the first site finishes.</p>

<p>Whenever a <span title="concept-script">script</span> calls into
a <span>plugin</span>, and whenever a <span>plugin</span> calls into

0 comments on commit 56cf59c

Please sign in to comment.
You can’t perform that action at this time.