Skip to content

Commit

Permalink
Raise the bar for SharedArrayBuffer via postMessage()
Browse files Browse the repository at this point in the history
This depends on the work to add Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy. It specifies how postMessage() is affected when both those headers are set for the agent clusters they impact.

Closes #4732.
  • Loading branch information
annevk committed Jun 25, 2019
1 parent d89b68a commit c192845
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -8275,13 +8275,25 @@ interface <dfn>DOMStringList</dfn> {
<p>If ! <span>IsSharedArrayBuffer</span>(<var>value</var>) is true, then:

<ol>
<li><p>Let <var>agentCluster</var> be the <span>current Realm Record</span>'s corresponding
<span>agent cluster</span>.</p></li>
<!-- Should this use the surrounding agent's agent cluster instead? -->

<li>
<p>If <var>agentCluster</var>'s <span>allow sidechannel attacks</span> is set to false, then
throw a <span>"<code>DataCloneError</code>"</span> <code>DOMException</code>.</p>

<p class="note">This check is only needed once as <span>allow sidechannel attacks</span>
cannot change over time and a <code>SharedArrayBuffer</code> cannot leave an <span>agent
cluster</span>.</p>
</li>

<li><p>If <var>forStorage</var> is true, then throw a
<span>"<code>DataCloneError</code>"</span> <code>DOMException</code>.</p></li>

<li><p>Set <var>serialized</var> to { [[Type]]: "SharedArrayBuffer", [[ArrayBufferData]]:
<var>value</var>.[[ArrayBufferData]], [[ArrayBufferByteLength]]: <var>size</var>,
[[AgentCluster]]: the <span>current Realm Record</span>'s corresponding <span>agent
cluster</span> }.</p></li>
[[AgentCluster]]: <var>agentCluster</var> }.</p></li>
</ol>
</li>

Expand Down

0 comments on commit c192845

Please sign in to comment.