Skip to content

Commit

Permalink
[] (0) Allow UAs to opt out of the storage mutex and corrupt data ins…
Browse files Browse the repository at this point in the history
…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 56cf59c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 15 deletions.
26 changes: 21 additions & 5 deletions complete.html
Expand Up @@ -67995,11 +67995,27 @@ <h5 id=definitions-1><span class=secno>7.1.4.1 </span>Definitions</h5>
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
Expand Down
26 changes: 21 additions & 5 deletions index
Expand Up @@ -67887,11 +67887,27 @@ interface <dfn id=navigatoronline>NavigatorOnLine</dfn> {
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
Expand Down
27 changes: 22 additions & 5 deletions source
Expand Up @@ -77351,11 +77351,28 @@ interface <dfn>NavigatorOnLine</dfn> {
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
Expand Down

0 comments on commit 56cf59c

Please sign in to comment.