<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[212526] branches/safari-603-branch</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/212526">212526</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2017-02-16 21:28:03 -0800 (Thu, 16 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/212301">r212301</a>. rdar://problem/30494674</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsChangeLog">branches/safari-603-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCoreChangeLog">branches/safari-603-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari603branchSourceWebCorebindingsjsSerializedScriptValuecpp">branches/safari-603-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsworkerssabnullworkerjs">branches/safari-603-branch/LayoutTests/workers/sab/null-worker.js</a></li>
<li><a href="#branchessafari603branchLayoutTestsworkerssabpostMessagetransfertypeerrorexpectedtxt">branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error-expected.txt</a></li>
<li><a href="#branchessafari603branchLayoutTestsworkerssabpostMessagetransfertypeerrorhtml">branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchessafari603branchLayoutTestsworkerssabsimplehtml">branches/safari-603-branch/LayoutTests/workers/sab/simple.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari603branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/LayoutTests/ChangeLog (212525 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-17 05:28:00 UTC (rev 212525)
+++ branches/safari-603-branch/LayoutTests/ChangeLog        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212301. rdar://problem/30494674
+
+    2017-02-13  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+            worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
+            https://bugs.webkit.org/show_bug.cgi?id=168277
+
+            Reviewed by Mark Lam.
+
+            Add a test of the new behavior, and remove tests for the old behavior.
+
+            Most of the SharedArrayBuffer tests use the new style, where the buffer is not in the
+            transfer list, and the tests being removed are clones of the no-transfer tests. So, we
+            aren't losing any coverage.
+
+            * workers/sab/null-worker.js: Added.
+            * workers/sab/postMessage-transfer-type-error-expected.txt: Added.
+            * workers/sab/postMessage-transfer-type-error.html: Added.
+            * workers/sab/sab-creator-transfer.js: Removed. (Sibling: sab-creator-no-transfer.js)
+            * workers/sab/sent-from-worker-transfer.html: Removed. (Sibling: sent-from-worker-no-transfer.html)
+            * workers/sab/simple.html: Removed. (Sibling: no-transfer.html)
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212214. rdar://problem/30451581
</span><span class="cx"> 
</span><span class="cx">     2017-02-12  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span></span></pre></div>
<a id="branchessafari603branchLayoutTestsworkerssabnullworkerjs"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/workers/sab/null-worker.js (0 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/workers/sab/null-worker.js                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/workers/sab/null-worker.js        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+// This does nothing.
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsworkerssabpostMessagetransfertypeerrorexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error-expected.txt (0 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error-expected.txt                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error-expected.txt        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Checks that worker.postMessage rejects SharedArrayBuffers in the transfer list
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS postMessageTransferSharedArrayBuffer() threw exception TypeError: Type error.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsworkerssabpostMessagetransfertypeerrorhtml"></a>
<div class="addfile"><h4>Added: branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error.html (0 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error.html                                (rev 0)
+++ branches/safari-603-branch/LayoutTests/workers/sab/postMessage-transfer-type-error.html        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+description(&quot;Checks that worker.postMessage rejects SharedArrayBuffers in the transfer list&quot;);
+
+function postMessageTransferSharedArrayBuffer()
+{
+    var sab = new SharedArrayBuffer(4);
+    var memory = new Int32Array(sab);
+    new Worker(&quot;null-worker.js&quot;).postMessage(memory, [sab]);
+}
+
+shouldThrowErrorName(&quot;postMessageTransferSharedArrayBuffer()&quot;, &quot;TypeError&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="branchessafari603branchLayoutTestsworkerssabsimplehtml"></a>
<div class="delfile"><h4>Deleted: branches/safari-603-branch/LayoutTests/workers/sab/simple.html (212525 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/LayoutTests/workers/sab/simple.html        2017-02-17 05:28:00 UTC (rev 212525)
+++ branches/safari-603-branch/LayoutTests/workers/sab/simple.html        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -1,90 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-function getOrCreate(id, tagName)
-{
-    var element = document.getElementById(id);
-    if (element)
-        return element;
-    
-    element = document.createElement(tagName);
-    element.id = id;
-    var parent = document.body || document.documentElement;
-    var refNode = parent.firstChild;
-    
-    parent.insertBefore(element, refNode);
-    return element;
-}
-
-function debug(msg)
-{
-    var span = document.createElement(&quot;span&quot;);
-    getOrCreate(&quot;console&quot;, &quot;div&quot;).appendChild(span); // insert it first so XHTML knows the namespace
-    span.innerHTML = msg + '&lt;br /&gt;';
-}
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-}
-
-var verbose = false;
-
-var sab = new SharedArrayBuffer(100 * 4);
-
-var memory = new Int32Array(sab);
-
-var numWorkers = 0;
-function startWorker(file)
-{
-    if (verbose)
-        debug(&quot;Starting worker: &quot; + file);
-    numWorkers++;
-    var worker = new Worker(file);
-    worker.onmessage = function(event) {
-        if (event.data == &quot;done&quot;) {
-            if (verbose)
-                debug(&quot;Finished worker: &quot; + file);
-            if (--numWorkers)
-                return;
-            debug(&quot;All workers done!&quot;);
-            done();
-            return;
-        }
-        if (event.data.indexOf(&quot;Error&quot;) == 0) {
-            debug(&quot;Test failed: &quot;+ event.data);
-            if (window.testRunner)
-                testRunner.notifyDone();
-        }
-        
-        if (verbose)
-            debug(&quot;Event from &quot; + file + &quot;: &quot; + event.data);
-    };
-    worker.postMessage(memory, [sab]);
-}
-
-function done()
-{
-    for (var i = 0; i &lt; 3; ++i) {
-        if (memory[i] != 1)
-            throw &quot;Error: Bad value at memory[&quot; + i + &quot;]: &quot; + memory[i];
-    }
-    for (var i = 3; i &lt; memory.length; ++i) {
-        if (memory[i] != 0)
-            throw &quot;Error: Bad value at memory[&quot; + i + &quot;]: &quot; + memory[i];
-    }
-    debug(&quot;Test passed!&quot;);
-
-    if (window.testRunner)
-        testRunner.notifyDone();
-}
-
-startWorker(&quot;simple-worker-1.js&quot;);
-startWorker(&quot;simple-worker-2.js&quot;);
-
-&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="branchessafari603branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212525 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-17 05:28:00 UTC (rev 212525)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r212301. rdar://problem/30494674
+
+    2017-02-13  Filip Pizlo  &lt;fpizlo@apple.com&gt;
+
+            worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
+            https://bugs.webkit.org/show_bug.cgi?id=168277
+
+            Reviewed by Mark Lam.
+
+            Test: workers/sab/postMessage-transfer-type-error.html
+
+            This is a simple spec compliance change. The title says it all.
+
+            * bindings/js/SerializedScriptValue.cpp:
+            (WebCore::SerializedScriptValue::create):
+
+2017-02-16  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r212260. rdar://problem/30481079
</span><span class="cx"> 
</span><span class="cx">     2017-02-13  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari603branchSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-603-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp (212525 => 212526)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-603-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2017-02-17 05:28:00 UTC (rev 212525)
+++ branches/safari-603-branch/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2017-02-17 05:28:03 UTC (rev 212526)
</span><span class="lines">@@ -2759,6 +2759,8 @@
</span><span class="cx">         if (auto arrayBuffer = toPossiblySharedArrayBuffer(transferable.get())) {
</span><span class="cx">             if (arrayBuffer-&gt;isNeutered())
</span><span class="cx">                 return Exception { DATA_CLONE_ERR };
</span><ins>+            if (arrayBuffer-&gt;isShared())
+                return Exception { TypeError };
</ins><span class="cx">             arrayBuffers.append(WTFMove(arrayBuffer));
</span><span class="cx">             continue;
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>