<!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>[207505] trunk/Source/WebCore</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/207505">207505</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-10-18 17:05:09 -0700 (Tue, 18 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
https://bugs.webkit.org/show_bug.cgi?id=163625
Reviewed by Chris Dumez.
- Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
- Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
- Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
- Move MessagePorts and ArrayBuffers more where possible.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/JSCustomEventCustom.cpp:
(WebCore::JSCustomEvent::detail):
* bindings/js/JSHistoryCustom.cpp:
(WebCore::JSHistory::state):
(WebCore::JSHistory::pushState):
(WebCore::JSHistory::replaceState):
* bindings/js/JSPopStateEventCustom.cpp:
(WebCore::JSPopStateEvent::state):
* dom/CustomEvent.cpp:
(WebCore::CustomEvent::trySerializeDetail):
* dom/ErrorEvent.cpp:
(WebCore::ErrorEvent::sanitizedErrorValue):
(WebCore::ErrorEvent::trySerializeError):
* dom/PopStateEvent.cpp:
(WebCore::PopStateEvent::trySerializeState):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
* page/DOMWindow.h:
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/DedicatedWorkerGlobalScope.h:
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/Worker.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::handlePostMessage):
* bindings/js/JSDictionary.cpp:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSDictionary.h:
Updated for new SerializedScriptValue interface/vector naming.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::extractTransferables):
(WebCore::fillMessagePortArray): Deleted.
* bindings/js/JSMessagePortCustom.h:
(WebCore::handlePostMessage):
Rename fillMessagePortArray to extractTransferables to better express what it does.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::fillTransferMap):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::transferArrayBuffers):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
* bindings/js/SerializedScriptValue.h:
Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
* bindings/scripts/CodeGeneratorJS.pm:
(GetNativeVectorType):
Remove special case for MessagePort.
(JSValueToNative):
(NativeToJSValue):
Updated for new SerializedScriptValue interface.
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
(WebCore::MessageEvent::trySerializeData):
* dom/MessageEvent.h:
Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
* dom/MessageEvent.idl:
Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
custom, as we don't quite generate these correctly yet.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::disentanglePorts):
(WebCore::MessagePort::entanglePorts):
* dom/MessagePort.h:
Update interface to take MessagePort vectors by rvalue reference.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp">trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomEventCustomcpp">trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionarycpp">trunk/Source/WebCore/bindings/js/JSDictionary.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDictionaryh">trunk/Source/WebCore/bindings/js/JSDictionary.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHistoryCustomcpp">trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMessageEventCustomcpp">trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMessagePortCustomcpp">trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMessagePortCustomh">trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPopStateEventCustomcpp">trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValueh">trunk/Source/WebCore/bindings/js/SerializedScriptValue.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCoredomCustomEventcpp">trunk/Source/WebCore/dom/CustomEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomErrorEventcpp">trunk/Source/WebCore/dom/ErrorEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMessageEventcpp">trunk/Source/WebCore/dom/MessageEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMessageEventh">trunk/Source/WebCore/dom/MessageEvent.h</a></li>
<li><a href="#trunkSourceWebCoredomMessageEventidl">trunk/Source/WebCore/dom/MessageEvent.idl</a></li>
<li><a href="#trunkSourceWebCoredomMessagePortcpp">trunk/Source/WebCore/dom/MessagePort.cpp</a></li>
<li><a href="#trunkSourceWebCoredomMessagePorth">trunk/Source/WebCore/dom/MessagePort.h</a></li>
<li><a href="#trunkSourceWebCoredomPopStateEventcpp">trunk/Source/WebCore/dom/PopStateEvent.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowh">trunk/Source/WebCore/page/DOMWindow.h</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerGlobalScopecpp">trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersDedicatedWorkerGlobalScopeh">trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkercpp">trunk/Source/WebCore/workers/Worker.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerh">trunk/Source/WebCore/workers/Worker.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/ChangeLog        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -1,3 +1,103 @@
</span><ins>+2016-10-18 Sam Weinig <sam@webkit.org>
+
+ Simplify SerializedScriptValue, MessagePortArray and ArrayBufferArray to ease generation
+ https://bugs.webkit.org/show_bug.cgi?id=163625
+
+ Reviewed by Chris Dumez.
+
+ - Replace uses of MessagePortArray (a.k.a. Vector<RefPtr<MessagePort>, 1>) with Vector<RefPtr<MessagePort>>.
+ - Replace uses of ArrayBufferArray (a.k.a. Vector<RefPtr<ArrayBuffer>, 1>) with Vector<RefPtr<ArrayBuffer>>.
+ - Add convenience functions to SerializedScriptValue to allow calling with fewer parameters.
+ - Move MessagePorts and ArrayBuffers more where possible.
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::putOrAdd):
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
+ * bindings/js/IDBBindingUtilities.cpp:
+ (WebCore::deserializeIDBValueToJSValue):
+ * bindings/js/JSCustomEventCustom.cpp:
+ (WebCore::JSCustomEvent::detail):
+ * bindings/js/JSHistoryCustom.cpp:
+ (WebCore::JSHistory::state):
+ (WebCore::JSHistory::pushState):
+ (WebCore::JSHistory::replaceState):
+ * bindings/js/JSPopStateEventCustom.cpp:
+ (WebCore::JSPopStateEvent::state):
+ * dom/CustomEvent.cpp:
+ (WebCore::CustomEvent::trySerializeDetail):
+ * dom/ErrorEvent.cpp:
+ (WebCore::ErrorEvent::sanitizedErrorValue):
+ (WebCore::ErrorEvent::trySerializeError):
+ * dom/PopStateEvent.cpp:
+ (WebCore::PopStateEvent::trySerializeState):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::postMessage):
+ * page/DOMWindow.h:
+ * workers/DedicatedWorkerGlobalScope.cpp:
+ (WebCore::DedicatedWorkerGlobalScope::postMessage):
+ * workers/DedicatedWorkerGlobalScope.h:
+ * workers/Worker.cpp:
+ (WebCore::Worker::postMessage):
+ * workers/Worker.h:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::handlePostMessage):
+ * bindings/js/JSDictionary.cpp:
+ (WebCore::JSDictionary::convertValue):
+ * bindings/js/JSDictionary.h:
+ Updated for new SerializedScriptValue interface/vector naming.
+
+ * bindings/js/JSMessageEventCustom.cpp:
+ (WebCore::handleInitMessageEvent):
+ Update handleInitMessageEvent to check for exceptions and use convert for the MessagePort sequence.
+
+ * bindings/js/JSMessagePortCustom.cpp:
+ (WebCore::extractTransferables):
+ (WebCore::fillMessagePortArray): Deleted.
+ * bindings/js/JSMessagePortCustom.h:
+ (WebCore::handlePostMessage):
+ Rename fillMessagePortArray to extractTransferables to better express what it does.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneSerializer::serialize):
+ (WebCore::CloneSerializer::CloneSerializer):
+ (WebCore::CloneSerializer::fillTransferMap):
+ (WebCore::CloneSerializer::dumpIfTerminal):
+ (WebCore::CloneDeserializer::deserialize):
+ (WebCore::CloneDeserializer::CloneDeserializer):
+ (WebCore::CloneDeserializer::readTerminal):
+ (WebCore::SerializedScriptValue::transferArrayBuffers):
+ (WebCore::SerializedScriptValue::create):
+ (WebCore::SerializedScriptValue::deserialize):
+ * bindings/js/SerializedScriptValue.h:
+ Simplify interface to allow more callers to avoid passing default arguments. Use ExecState& more.
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GetNativeVectorType):
+ Remove special case for MessagePort.
+ (JSValueToNative):
+ (NativeToJSValue):
+ Updated for new SerializedScriptValue interface.
+
+ * dom/MessageEvent.cpp:
+ (WebCore::MessageEvent::MessageEvent):
+ (WebCore::MessageEvent::create):
+ (WebCore::MessageEvent::initMessageEvent):
+ (WebCore::MessageEvent::trySerializeData):
+ * dom/MessageEvent.h:
+ Store the MessagePort sequence as a Vector<RefPtr<MessagePort>> rather than in a unique_ptr.
+
+ * dom/MessageEvent.idl:
+ Update last type in init functions to be sequence<MessagePort> rather than Array. They are still
+ custom, as we don't quite generate these correctly yet.
+
+ * dom/MessagePort.cpp:
+ (WebCore::MessagePort::postMessage):
+ (WebCore::MessagePort::dispatchMessages):
+ (WebCore::MessagePort::disentanglePorts):
+ (WebCore::MessagePort::entanglePorts):
+ * dom/MessagePort.h:
+ Update interface to take MessagePort vectors by rvalue reference.
+
</ins><span class="cx"> 2016-10-18 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Drop JSDictionary::convertValue() overload taking a TouchList
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx"> if (m_transaction->isReadOnly())
</span><span class="cx"> return Exception { IDBDatabaseException::ReadOnlyError, ASCIILiteral("Failed to store record in an IDBObjectStore: The transaction is read-only.") };
</span><span class="cx">
</span><del>- RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(&state, value, nullptr, nullptr);
</del><ins>+ auto serializedValue = SerializedScriptValue::create(state, value);
</ins><span class="cx"> if (UNLIKELY(scope.exception())) {
</span><span class="cx"> // Clear the DOM exception from the serializer so we can give a more targeted exception.
</span><span class="cx"> scope.clearException();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -874,7 +874,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto serializedValue = SerializedScriptValue::create(&databaseThreadExecState(), value, nullptr, nullptr);
</del><ins>+ auto serializedValue = SerializedScriptValue::create(databaseThreadExecState(), value);
</ins><span class="cx"> if (UNLIKELY(scope.exception())) {
</span><span class="cx"> postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral("Unable to serialize record value after injecting record key")), usedKey));
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsIDBBindingUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/IDBBindingUtilities.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include "JSDOMConvert.h"
</span><span class="cx"> #include "JSDOMStringList.h"
</span><span class="cx"> #include "Logging.h"
</span><ins>+#include "MessagePort.h"
</ins><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "SerializedScriptValue.h"
</span><span class="cx"> #include "SharedBuffer.h"
</span><span class="lines">@@ -328,7 +329,8 @@
</span><span class="cx"> auto serializedValue = SerializedScriptValue::createFromWireBytes(Vector<uint8_t>(data));
</span><span class="cx">
</span><span class="cx"> exec.vm().apiLock().lock();
</span><del>- JSValue result = serializedValue->deserialize(&exec, exec.lexicalGlobalObject(), 0, NonThrowing, value.blobURLs(), value.blobFilePaths());
</del><ins>+ Vector<RefPtr<MessagePort>> messagePorts;
+ JSValue result = serializedValue->deserialize(exec, exec.lexicalGlobalObject(), messagePorts, value.blobURLs(), value.blobFilePaths(), NonThrowing);
</ins><span class="cx"> exec.vm().apiLock().unlock();
</span><span class="cx">
</span><span class="cx"> return result;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSCustomEventCustom.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> auto serializedDetail = event.trySerializeDetail(state);
</span><span class="cx"> if (!serializedDetail)
</span><span class="cx"> return jsNull();
</span><del>- return serializedDetail->deserialize(&state, globalObject(), nullptr);
</del><ins>+ return serializedDetail->deserialize(state, globalObject());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return detail;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -505,8 +505,8 @@
</span><span class="cx"> if (UNLIKELY(state.argumentCount() < 2))
</span><span class="cx"> return throwException(&state, scope, createNotEnoughArgumentsError(&state));
</span><span class="cx">
</span><del>- MessagePortArray messagePorts;
- ArrayBufferArray arrayBuffers;
</del><ins>+ Vector<RefPtr<MessagePort>> messagePorts;
+ Vector<RefPtr<JSC::ArrayBuffer>> arrayBuffers;
</ins><span class="cx">
</span><span class="cx"> // This function has variable arguments and can be:
</span><span class="cx"> // Per current spec:
</span><span class="lines">@@ -521,11 +521,11 @@
</span><span class="cx"> targetOriginArgIndex = 2;
</span><span class="cx"> transferablesArgIndex = 1;
</span><span class="cx"> }
</span><del>- fillMessagePortArray(state, state.argument(transferablesArgIndex), messagePorts, arrayBuffers);
</del><ins>+ extractTransferables(state, state.argument(transferablesArgIndex), messagePorts, arrayBuffers);
</ins><span class="cx"> }
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><del>- auto message = SerializedScriptValue::create(&state, state.uncheckedArgument(0), &messagePorts, &arrayBuffers);
</del><ins>+ auto message = SerializedScriptValue::create(state, state.uncheckedArgument(0), messagePorts, WTFMove(arrayBuffers));
</ins><span class="cx">
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="lines">@@ -533,7 +533,7 @@
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- impl.postMessage(WTFMove(message), &messagePorts, targetOrigin, callerDOMWindow(&state), ec);
</del><ins>+ impl.postMessage(WTFMove(message), WTFMove(messagePorts), targetOrigin, callerDOMWindow(&state), ec);
</ins><span class="cx"> setDOMException(&state, ec);
</span><span class="cx">
</span><span class="cx"> return jsUndefined();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionarycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -30,10 +30,11 @@
</span><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "Dictionary.h"
</span><span class="cx"> #include "JSCSSFontFaceRule.h"
</span><ins>+#include "JSDOMConvert.h"
</ins><span class="cx"> #include "JSDOMError.h"
</span><span class="cx"> #include "JSDOMWindow.h"
</span><span class="cx"> #include "JSEventTarget.h"
</span><del>-#include "JSMessagePortCustom.h"
</del><ins>+#include "JSMessagePort.h"
</ins><span class="cx"> #include "JSNode.h"
</span><span class="cx"> #include "JSStorage.h"
</span><span class="cx"> #include "JSTrackCustom.h"
</span><span class="lines">@@ -177,7 +178,7 @@
</span><span class="cx">
</span><span class="cx"> void JSDictionary::convertValue(ExecState* exec, JSValue value, RefPtr<SerializedScriptValue>& result)
</span><span class="cx"> {
</span><del>- result = SerializedScriptValue::create(exec, value, 0, 0);
</del><ins>+ result = SerializedScriptValue::create(*exec, value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JSDictionary::convertValue(ExecState* state, JSValue value, RefPtr<DOMWindow>& result)
</span><span class="lines">@@ -208,10 +209,9 @@
</span><span class="cx"> result = JSStorage::toWrapped(value);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void JSDictionary::convertValue(ExecState* exec, JSValue value, MessagePortArray& result)
</del><ins>+void JSDictionary::convertValue(ExecState* exec, JSValue value, Vector<RefPtr<MessagePort>>& result)
</ins><span class="cx"> {
</span><del>- ArrayBufferArray arrayBuffers;
- fillMessagePortArray(*exec, value, result, arrayBuffers);
</del><ins>+ result = convert<IDLSequence<IDLInterface<MessagePort>>>(*exec, value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDictionaryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDictionary.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSDictionary.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx"> static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<EventTarget>& result);
</span><span class="cx"> static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<Node>& result);
</span><span class="cx"> static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<Storage>& result);
</span><del>- static void convertValue(JSC::ExecState*, JSC::JSValue, MessagePortArray& result);
</del><ins>+ static void convertValue(JSC::ExecState*, JSC::JSValue, Vector<RefPtr<MessagePort>>& result);
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> static void convertValue(JSC::ExecState*, JSC::JSValue, RefPtr<TrackBase>& result);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHistoryCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> return cachedValue;
</span><span class="cx">
</span><span class="cx"> RefPtr<SerializedScriptValue> serialized = history.state();
</span><del>- JSValue result = serialized ? serialized->deserialize(&state, globalObject(), 0) : jsNull();
</del><ins>+ JSValue result = serialized ? serialized->deserialize(state, globalObject()) : jsNull();
</ins><span class="cx"> m_state.set(state.vm(), this, result);
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> if (UNLIKELY(argCount < 2))
</span><span class="cx"> return throwException(&state, scope, createNotEnoughArgumentsError(&state));
</span><span class="cx">
</span><del>- auto historyState = SerializedScriptValue::create(&state, state.uncheckedArgument(0), 0, 0);
</del><ins>+ auto historyState = SerializedScriptValue::create(state, state.uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="cx"> // FIXME: title should not be nullable.
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> if (UNLIKELY(argCount < 2))
</span><span class="cx"> return throwException(&state, scope, createNotEnoughArgumentsError(&state));
</span><span class="cx">
</span><del>- auto historyState = SerializedScriptValue::create(&state, state.uncheckedArgument(0), 0, 0);
</del><ins>+ auto historyState = SerializedScriptValue::create(state, state.uncheckedArgument(0));
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx">
</span><span class="cx"> // FIXME: title should not be nullable.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMessageEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -33,10 +33,10 @@
</span><span class="cx">
</span><span class="cx"> #include "JSBlob.h"
</span><span class="cx"> #include "JSDOMBinding.h"
</span><ins>+#include "JSDOMConvert.h"
</ins><span class="cx"> #include "JSDOMWindow.h"
</span><span class="cx"> #include "JSEventTarget.h"
</span><span class="cx"> #include "JSMessagePort.h"
</span><del>-#include "JSMessagePortCustom.h"
</del><span class="cx"> #include "MessageEvent.h"
</span><span class="cx"> #include <runtime/JSArray.h>
</span><span class="cx"> #include <runtime/JSArrayBuffer.h>
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> if (dataValue.isObject() && &worldForDOMObject(dataValue.getObject()) != &currentWorld(&state)) {
</span><span class="cx"> RefPtr<SerializedScriptValue> serializedValue = event.trySerializeData(&state);
</span><span class="cx"> if (serializedValue)
</span><del>- result = serializedValue->deserialize(&state, globalObject(), nullptr);
</del><ins>+ result = serializedValue->deserialize(state, globalObject());
</ins><span class="cx"> else
</span><span class="cx"> result = jsNull();
</span><span class="cx"> } else
</span><span class="lines">@@ -78,9 +78,9 @@
</span><span class="cx">
</span><span class="cx"> case MessageEvent::DataTypeSerializedScriptValue:
</span><span class="cx"> if (RefPtr<SerializedScriptValue> serializedValue = event.dataAsSerializedScriptValue()) {
</span><del>- MessagePortArray ports = wrapped().ports();
</del><ins>+ Vector<RefPtr<MessagePort>> ports = wrapped().ports();
</ins><span class="cx"> // FIXME: Why does this suppress exceptions?
</span><del>- result = serializedValue->deserialize(&state, globalObject(), &ports, NonThrowing);
</del><ins>+ result = serializedValue->deserialize(state, globalObject(), ports, NonThrowing);
</ins><span class="cx"> } else
</span><span class="cx"> result = jsNull();
</span><span class="cx"> break;
</span><span class="lines">@@ -109,25 +109,34 @@
</span><span class="cx"> auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">
</span><span class="cx"> const String& typeArg = state.argument(0).toString(&state)->value(&state);
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+
</ins><span class="cx"> bool canBubbleArg = state.argument(1).toBoolean(&state);
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+
</ins><span class="cx"> bool cancelableArg = state.argument(2).toBoolean(&state);
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+
+ JSValue dataArg = state.argument(3);
+
</ins><span class="cx"> const String originArg = valueToUSVString(&state, state.argument(4));
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+
</ins><span class="cx"> const String lastEventIdArg = state.argument(5).toString(&state)->value(&state);
</span><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+
</ins><span class="cx"> auto sourceArg = convert<IDLNullable<IDLUnion<IDLInterface<DOMWindow>, IDLInterface<MessagePort>>>>(state, state.argument(6));
</span><del>- std::unique_ptr<MessagePortArray> messagePorts;
- std::unique_ptr<ArrayBufferArray> arrayBuffers;
</del><ins>+ RETURN_IF_EXCEPTION(scope, JSValue());
+
+ Vector<RefPtr<MessagePort>> messagePorts;
</ins><span class="cx"> if (!state.argument(7).isUndefinedOrNull()) {
</span><del>- messagePorts = std::make_unique<MessagePortArray>();
- arrayBuffers = std::make_unique<ArrayBufferArray>();
- fillMessagePortArray(state, state.argument(7), *messagePorts, *arrayBuffers);
</del><ins>+ messagePorts = convert<IDLSequence<IDLInterface<MessagePort>>>(state, state.argument(7));
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSValue());
</span><span class="cx"> }
</span><del>- Deprecated::ScriptValue dataArg(vm, state.argument(3));
- RETURN_IF_EXCEPTION(scope, JSValue());
</del><span class="cx">
</span><span class="cx"> MessageEvent& event = jsEvent->wrapped();
</span><del>- event.initMessageEvent(typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, WTFMove(sourceArg), WTFMove(messagePorts));
- jsEvent->m_data.set(vm, jsEvent, dataArg.jsValue());
</del><ins>+ event.initMessageEvent(state, typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, WTFMove(sourceArg), WTFMove(messagePorts));
+ jsEvent->m_data.set(vm, jsEvent, dataArg);
</ins><span class="cx"> return jsUndefined();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMessagePortCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -57,13 +57,11 @@
</span><span class="cx"> return handlePostMessage(state, &wrapped());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void fillMessagePortArray(JSC::ExecState& state, JSC::JSValue value, MessagePortArray& portArray, ArrayBufferArray& arrayBuffers)
</del><ins>+void extractTransferables(JSC::ExecState& state, JSC::JSValue value, Vector<RefPtr<MessagePort>>& portArray, Vector<RefPtr<JSC::ArrayBuffer>>& arrayBuffers)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = state.vm();
</span><span class="cx"> auto scope = DECLARE_THROW_SCOPE(vm);
</span><span class="cx">
</span><del>- // Convert from the passed-in JS array-like object to a MessagePortArray.
- // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3 of the HTML5 spec.
</del><span class="cx"> if (value.isUndefinedOrNull()) {
</span><span class="cx"> portArray.resize(0);
</span><span class="cx"> arrayBuffers.resize(0);
</span><span class="lines">@@ -78,7 +76,7 @@
</span><span class="cx"> for (unsigned i = 0 ; i < length; ++i) {
</span><span class="cx"> JSValue value = object->get(&state, i);
</span><span class="cx"> RETURN_IF_EXCEPTION(scope, void());
</span><del>- // Validation of non-null objects, per HTML5 spec 10.3.3.
</del><ins>+
</ins><span class="cx"> if (value.isUndefinedOrNull()) {
</span><span class="cx"> setDOMException(&state, INVALID_STATE_ERR);
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMessagePortCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSMessagePortCustom.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -42,10 +42,7 @@
</span><span class="cx">
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><del>- // Helper function which pulls the values out of a JS sequence and into a MessagePortArray.
- // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3 of the HTML5 spec.
- // May generate an exception via the passed ExecState.
- void fillMessagePortArray(JSC::ExecState&, JSC::JSValue, MessagePortArray&, ArrayBufferArray&);
</del><ins>+ void extractTransferables(JSC::ExecState&, JSC::JSValue, Vector<RefPtr<MessagePort>>&, Vector<RefPtr<JSC::ArrayBuffer>>&);
</ins><span class="cx">
</span><span class="cx"> // Helper function to convert from JS postMessage arguments to WebCore postMessage arguments.
</span><span class="cx"> template <typename T>
</span><span class="lines">@@ -57,14 +54,16 @@
</span><span class="cx"> if (UNLIKELY(state.argumentCount() < 1))
</span><span class="cx"> return throwException(&state, scope, createNotEnoughArgumentsError(&state));
</span><span class="cx">
</span><del>- MessagePortArray portArray;
- ArrayBufferArray arrayBufferArray;
- fillMessagePortArray(state, state.argument(1), portArray, arrayBufferArray);
- auto message = SerializedScriptValue::create(&state, state.uncheckedArgument(0), &portArray, &arrayBufferArray);
</del><ins>+
+ Vector<RefPtr<MessagePort>> messagePortArray;
+ Vector<RefPtr<JSC::ArrayBuffer>> arrayBufferArray;
+ extractTransferables(state, state.argument(1), messagePortArray, arrayBufferArray);
+
+ auto message = SerializedScriptValue::create(state, state.uncheckedArgument(0), messagePortArray, WTFMove(arrayBufferArray));
</ins><span class="cx"> RETURN_IF_EXCEPTION(scope, JSC::JSValue());
</span><span class="cx">
</span><span class="cx"> ExceptionCode ec = 0;
</span><del>- impl->postMessage(WTFMove(message), &portArray, ec);
</del><ins>+ impl->postMessage(WTFMove(message), WTFMove(messagePortArray), ec);
</ins><span class="cx"> setDOMException(&state, ec);
</span><span class="cx"> return JSC::jsUndefined();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPopStateEventCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/JSPopStateEventCustom.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> // Ideally, we would check that the worlds have different privileges but that's not possible yet.
</span><span class="cx"> if (eventState.isObject() && &worldForDOMObject(eventState.getObject()) != &currentWorld(&state)) {
</span><span class="cx"> if (auto serializedValue = event.trySerializeState(&state))
</span><del>- eventState = serializedValue->deserialize(&state, globalObject(), nullptr);
</del><ins>+ eventState = serializedValue->deserialize(state, globalObject());
</ins><span class="cx"> else
</span><span class="cx"> eventState = jsNull();
</span><span class="cx"> }
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> JSHistory* jsHistory = jsCast<JSHistory*>(toJS(&state, globalObject(), *history).asCell());
</span><span class="cx"> result = jsHistory->state(state);
</span><span class="cx"> } else
</span><del>- result = event.serializedState()->deserialize(&state, globalObject(), 0);
</del><ins>+ result = event.serializedState()->deserialize(state, globalObject());
</ins><span class="cx">
</span><span class="cx"> return cacheState(state, this, result);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -474,9 +474,7 @@
</span><span class="cx">
</span><span class="cx"> class CloneSerializer : CloneBase {
</span><span class="cx"> public:
</span><del>- static SerializationReturnCode serialize(ExecState* exec, JSValue value,
- MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers,
- Vector<String>& blobURLs, Vector<uint8_t>& out)
</del><ins>+ static SerializationReturnCode serialize(ExecState* exec, JSValue value, Vector<RefPtr<MessagePort>>& messagePorts, Vector<RefPtr<JSC::ArrayBuffer>>& arrayBuffers, Vector<String>& blobURLs, Vector<uint8_t>& out)
</ins><span class="cx"> {
</span><span class="cx"> CloneSerializer serializer(exec, messagePorts, arrayBuffers, blobURLs, out);
</span><span class="cx"> return serializer.serialize(value);
</span><span class="lines">@@ -525,7 +523,7 @@
</span><span class="cx"> private:
</span><span class="cx"> typedef HashMap<JSObject*, uint32_t> ObjectPool;
</span><span class="cx">
</span><del>- CloneSerializer(ExecState* exec, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, Vector<String>& blobURLs, Vector<uint8_t>& out)
</del><ins>+ CloneSerializer(ExecState* exec, Vector<RefPtr<MessagePort>>& messagePorts, Vector<RefPtr<JSC::ArrayBuffer>>& arrayBuffers, Vector<String>& blobURLs, Vector<uint8_t>& out)
</ins><span class="cx"> : CloneBase(exec)
</span><span class="cx"> , m_buffer(out)
</span><span class="cx"> , m_blobURLs(blobURLs)
</span><span class="lines">@@ -537,13 +535,13 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template <class T>
</span><del>- void fillTransferMap(Vector<RefPtr<T>, 1>* input, ObjectPool& result)
</del><ins>+ void fillTransferMap(Vector<RefPtr<T>>& input, ObjectPool& result)
</ins><span class="cx"> {
</span><del>- if (!input)
</del><ins>+ if (input.isEmpty())
</ins><span class="cx"> return;
</span><span class="cx"> JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(m_exec->lexicalGlobalObject());
</span><del>- for (size_t i = 0; i < input->size(); i++) {
- JSC::JSValue value = toJS(m_exec, globalObject, input->at(i).get());
</del><ins>+ for (size_t i = 0; i < input.size(); i++) {
+ JSC::JSValue value = toJS(m_exec, globalObject, input[i].get());
</ins><span class="cx"> JSC::JSObject* obj = value.getObject();
</span><span class="cx"> if (obj && !result.contains(obj))
</span><span class="cx"> result.add(obj, i);
</span><span class="lines">@@ -877,7 +875,9 @@
</span><span class="cx"> write(CryptoKeyTag);
</span><span class="cx"> Vector<uint8_t> serializedKey;
</span><span class="cx"> Vector<String> dummyBlobURLs;
</span><del>- CloneSerializer rawKeySerializer(m_exec, nullptr, nullptr, dummyBlobURLs, serializedKey);
</del><ins>+ Vector<RefPtr<MessagePort>> dummyMessagePorts;
+ Vector<RefPtr<JSC::ArrayBuffer>> dummyArrayBuffers;
+ CloneSerializer rawKeySerializer(m_exec, dummyMessagePorts, dummyArrayBuffers, dummyBlobURLs, serializedKey);
</ins><span class="cx"> rawKeySerializer.write(key);
</span><span class="cx"> Vector<uint8_t> wrappedKey;
</span><span class="cx"> if (!wrapCryptoKey(m_exec, serializedKey, wrappedKey))
</span><span class="lines">@@ -1487,7 +1487,7 @@
</span><span class="cx"> return str;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- static DeserializationResult deserialize(ExecState* exec, JSGlobalObject* globalObject, MessagePortArray* messagePorts, ArrayBufferContentsArray* arrayBufferContentsArray, const Vector<uint8_t>& buffer, const Vector<String>& blobURLs, const Vector<String> blobFilePaths)
</del><ins>+ static DeserializationResult deserialize(ExecState* exec, JSGlobalObject* globalObject, Vector<RefPtr<MessagePort>>& messagePorts, ArrayBufferContentsArray* arrayBufferContentsArray, const Vector<uint8_t>& buffer, const Vector<String>& blobURLs, const Vector<String> blobFilePaths)
</ins><span class="cx"> {
</span><span class="cx"> if (!buffer.size())
</span><span class="cx"> return std::make_pair(jsNull(), UnspecifiedError);
</span><span class="lines">@@ -1536,7 +1536,7 @@
</span><span class="cx"> size_t m_index;
</span><span class="cx"> };
</span><span class="cx">
</span><del>- CloneDeserializer(ExecState* exec, JSGlobalObject* globalObject, MessagePortArray* messagePorts, ArrayBufferContentsArray* arrayBufferContents, const Vector<uint8_t>& buffer)
</del><ins>+ CloneDeserializer(ExecState* exec, JSGlobalObject* globalObject, Vector<RefPtr<MessagePort>>& messagePorts, ArrayBufferContentsArray* arrayBufferContents, const Vector<uint8_t>& buffer)
</ins><span class="cx"> : CloneBase(exec)
</span><span class="cx"> , m_globalObject(globalObject)
</span><span class="cx"> , m_isDOMGlobalObject(globalObject->inherits(JSDOMGlobalObject::info()))
</span><span class="lines">@@ -1551,7 +1551,7 @@
</span><span class="cx"> m_version = 0xFFFFFFFF;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- CloneDeserializer(ExecState* exec, JSGlobalObject* globalObject, MessagePortArray* messagePorts, ArrayBufferContentsArray* arrayBufferContents, const Vector<uint8_t>& buffer, const Vector<String>& blobURLs, const Vector<String> blobFilePaths)
</del><ins>+ CloneDeserializer(ExecState* exec, JSGlobalObject* globalObject, Vector<RefPtr<MessagePort>>& messagePorts, ArrayBufferContentsArray* arrayBufferContents, const Vector<uint8_t>& buffer, const Vector<String>& blobURLs, const Vector<String> blobFilePaths)
</ins><span class="cx"> : CloneBase(exec)
</span><span class="cx"> , m_globalObject(globalObject)
</span><span class="cx"> , m_isDOMGlobalObject(globalObject->inherits(JSDOMGlobalObject::info()))
</span><span class="lines">@@ -2347,11 +2347,11 @@
</span><span class="cx"> case MessagePortReferenceTag: {
</span><span class="cx"> uint32_t index;
</span><span class="cx"> bool indexSuccessfullyRead = read(index);
</span><del>- if (!indexSuccessfullyRead || !m_messagePorts || index >= m_messagePorts->size()) {
</del><ins>+ if (!indexSuccessfullyRead || index >= m_messagePorts.size()) {
</ins><span class="cx"> fail();
</span><span class="cx"> return JSValue();
</span><span class="cx"> }
</span><del>- return getJSValue(m_messagePorts->at(index).get());
</del><ins>+ return getJSValue(m_messagePorts[index].get());
</ins><span class="cx"> }
</span><span class="cx"> case ArrayBufferTag: {
</span><span class="cx"> RefPtr<ArrayBuffer> arrayBuffer;
</span><span class="lines">@@ -2398,7 +2398,8 @@
</span><span class="cx"> return JSValue();
</span><span class="cx"> }
</span><span class="cx"> JSValue cryptoKey;
</span><del>- CloneDeserializer rawKeyDeserializer(m_exec, m_globalObject, nullptr, nullptr, serializedKey);
</del><ins>+ Vector<RefPtr<MessagePort>> dummyMessagePorts;
+ CloneDeserializer rawKeyDeserializer(m_exec, m_globalObject, dummyMessagePorts, nullptr, serializedKey);
</ins><span class="cx"> if (!rawKeyDeserializer.readCryptoKey(cryptoKey)) {
</span><span class="cx"> fail();
</span><span class="cx"> return JSValue();
</span><span class="lines">@@ -2428,9 +2429,9 @@
</span><span class="cx"> const uint8_t* m_end;
</span><span class="cx"> unsigned m_version;
</span><span class="cx"> Vector<CachedString> m_constantPool;
</span><del>- MessagePortArray* m_messagePorts;
</del><ins>+ Vector<RefPtr<MessagePort>>& m_messagePorts;
</ins><span class="cx"> ArrayBufferContentsArray* m_arrayBufferContents;
</span><del>- ArrayBufferArray m_arrayBuffers;
</del><ins>+ Vector<RefPtr<JSC::ArrayBuffer>> m_arrayBuffers;
</ins><span class="cx"> Vector<String> m_blobURLs;
</span><span class="cx"> Vector<String> m_blobFilePaths;
</span><span class="cx">
</span><span class="lines">@@ -2654,7 +2655,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<SerializedScriptValue::ArrayBufferContentsArray> SerializedScriptValue::transferArrayBuffers(
</span><del>- ExecState* exec, ArrayBufferArray& arrayBuffers, SerializationReturnCode& code)
</del><ins>+ ExecState* exec, Vector<RefPtr<JSC::ArrayBuffer>>& arrayBuffers, SerializationReturnCode& code)
</ins><span class="cx"> {
</span><span class="cx"> for (size_t i = 0; i < arrayBuffers.size(); i++) {
</span><span class="cx"> if (arrayBuffers[i]->isNeutered()) {
</span><span class="lines">@@ -2682,19 +2683,24 @@
</span><span class="cx"> return contents;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<SerializedScriptValue> SerializedScriptValue::create(ExecState* exec, JSValue value, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, SerializationErrorMode throwExceptions)
</del><ins>+RefPtr<SerializedScriptValue> SerializedScriptValue::create(ExecState& exec, JSValue value, SerializationErrorMode throwExceptions)
</ins><span class="cx"> {
</span><ins>+ Vector<RefPtr<MessagePort>> messagePorts;
+ return SerializedScriptValue::create(exec, value, messagePorts, { }, throwExceptions);
+}
+
+RefPtr<SerializedScriptValue> SerializedScriptValue::create(ExecState& exec, JSValue value, Vector<RefPtr<MessagePort>>& messagePorts, Vector<RefPtr<JSC::ArrayBuffer>>&& arrayBuffers, SerializationErrorMode throwExceptions)
+{
</ins><span class="cx"> Vector<uint8_t> buffer;
</span><span class="cx"> Vector<String> blobURLs;
</span><del>- SerializationReturnCode code = CloneSerializer::serialize(exec, value, messagePorts, arrayBuffers, blobURLs, buffer);
</del><ins>+ SerializationReturnCode code = CloneSerializer::serialize(&exec, value, messagePorts, arrayBuffers, blobURLs, buffer);
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<ArrayBufferContentsArray> arrayBufferContentsArray;
</span><ins>+ if (!arrayBuffers.isEmpty() && serializationDidCompleteSuccessfully(code))
+ arrayBufferContentsArray = transferArrayBuffers(&exec, arrayBuffers, code);
</ins><span class="cx">
</span><del>- if (arrayBuffers && serializationDidCompleteSuccessfully(code))
- arrayBufferContentsArray = transferArrayBuffers(exec, *arrayBuffers, code);
-
</del><span class="cx"> if (throwExceptions == Throwing)
</span><del>- maybeThrowExceptionIfSerializationFailed(exec, code);
</del><ins>+ maybeThrowExceptionIfSerializationFailed(&exec, code);
</ins><span class="cx">
</span><span class="cx"> if (!serializationDidCompleteSuccessfully(code))
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -2718,7 +2724,7 @@
</span><span class="cx"> auto scope = DECLARE_CATCH_SCOPE(vm);
</span><span class="cx">
</span><span class="cx"> JSValue value = toJS(exec, apiValue);
</span><del>- RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(exec, value, nullptr, nullptr);
</del><ins>+ RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(*exec, value);
</ins><span class="cx"> if (UNLIKELY(scope.exception())) {
</span><span class="cx"> if (exception)
</span><span class="cx"> *exception = toRef(exec, scope.exception()->value());
</span><span class="lines">@@ -2734,17 +2740,24 @@
</span><span class="cx"> return CloneDeserializer::deserializeString(m_data);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue SerializedScriptValue::deserialize(ExecState* exec, JSGlobalObject* globalObject, MessagePortArray* messagePorts, SerializationErrorMode throwExceptions)
</del><ins>+JSValue SerializedScriptValue::deserialize(ExecState& exec, JSGlobalObject* globalObject, SerializationErrorMode throwExceptions)
</ins><span class="cx"> {
</span><del>- Vector<String> dummyBlobs, dummyPaths;
- return deserialize(exec, globalObject, messagePorts, throwExceptions, dummyBlobs, dummyPaths);
</del><ins>+ Vector<RefPtr<MessagePort>> dummyMessagePorts;
+ return deserialize(exec, globalObject, dummyMessagePorts, throwExceptions);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue SerializedScriptValue::deserialize(ExecState* exec, JSGlobalObject* globalObject, MessagePortArray* messagePorts, SerializationErrorMode throwExceptions, const Vector<String>& blobURLs, const Vector<String>& blobFilePaths)
</del><ins>+JSValue SerializedScriptValue::deserialize(ExecState& exec, JSGlobalObject* globalObject, Vector<RefPtr<MessagePort>>& messagePorts, SerializationErrorMode throwExceptions)
</ins><span class="cx"> {
</span><del>- DeserializationResult result = CloneDeserializer::deserialize(exec, globalObject, messagePorts, m_arrayBufferContentsArray.get(), m_data, blobURLs, blobFilePaths);
</del><ins>+ Vector<String> dummyBlobs;
+ Vector<String> dummyPaths;
+ return deserialize(exec, globalObject, messagePorts, dummyBlobs, dummyPaths, throwExceptions);
+}
+
+JSValue SerializedScriptValue::deserialize(ExecState& exec, JSGlobalObject* globalObject, Vector<RefPtr<MessagePort>>& messagePorts, const Vector<String>& blobURLs, const Vector<String>& blobFilePaths, SerializationErrorMode throwExceptions)
+{
+ DeserializationResult result = CloneDeserializer::deserialize(&exec, globalObject, messagePorts, m_arrayBufferContentsArray.get(), m_data, blobURLs, blobFilePaths);
</ins><span class="cx"> if (throwExceptions == Throwing)
</span><del>- maybeThrowExceptionIfSerializationFailed(exec, result.second);
</del><ins>+ maybeThrowExceptionIfSerializationFailed(&exec, result.second);
</ins><span class="cx"> return result.first ? result.first : jsNull();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2755,7 +2768,7 @@
</span><span class="cx"> JSLockHolder locker(vm);
</span><span class="cx"> auto scope = DECLARE_CATCH_SCOPE(vm);
</span><span class="cx">
</span><del>- JSValue value = deserialize(exec, exec->lexicalGlobalObject(), nullptr);
</del><ins>+ JSValue value = deserialize(*exec, exec->lexicalGlobalObject());
</ins><span class="cx"> if (UNLIKELY(scope.exception())) {
</span><span class="cx"> if (exception)
</span><span class="cx"> *exception = toRef(exec, scope.exception()->value());
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx">
</span><span class="cx"> class IDBValue;
</span><span class="cx"> class MessagePort;
</span><del>-typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
-typedef Vector<RefPtr<JSC::ArrayBuffer>, 1> ArrayBufferArray;
</del><span class="cx">
</span><span class="cx"> enum SerializationReturnCode {
</span><span class="cx"> SuccessfullyCompleted,
</span><span class="lines">@@ -61,7 +59,8 @@
</span><span class="cx">
</span><span class="cx"> class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> {
</span><span class="cx"> public:
</span><del>- WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(JSC::ExecState*, JSC::JSValue, MessagePortArray*, ArrayBufferArray*, SerializationErrorMode = Throwing);
</del><ins>+ WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(JSC::ExecState&, JSC::JSValue, SerializationErrorMode = Throwing);
+ WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(JSC::ExecState&, JSC::JSValue, Vector<RefPtr<MessagePort>>&, Vector<RefPtr<JSC::ArrayBuffer>>&&, SerializationErrorMode = Throwing);
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT static RefPtr<SerializedScriptValue> create(StringView);
</span><span class="cx"> static Ref<SerializedScriptValue> adopt(Vector<uint8_t>&& buffer)
</span><span class="lines">@@ -71,8 +70,9 @@
</span><span class="cx">
</span><span class="cx"> static Ref<SerializedScriptValue> nullValue();
</span><span class="cx">
</span><del>- WEBCORE_EXPORT JSC::JSValue deserialize(JSC::ExecState*, JSC::JSGlobalObject*, MessagePortArray*, SerializationErrorMode = Throwing);
- JSC::JSValue deserialize(JSC::ExecState*, JSC::JSGlobalObject*, MessagePortArray*, SerializationErrorMode, const Vector<String>& blobURLs, const Vector<String>& blobFilePaths);
</del><ins>+ WEBCORE_EXPORT JSC::JSValue deserialize(JSC::ExecState&, JSC::JSGlobalObject*, SerializationErrorMode = Throwing);
+ WEBCORE_EXPORT JSC::JSValue deserialize(JSC::ExecState&, JSC::JSGlobalObject*, Vector<RefPtr<MessagePort>>&, SerializationErrorMode = Throwing);
+ JSC::JSValue deserialize(JSC::ExecState&, JSC::JSGlobalObject*, Vector<RefPtr<MessagePort>>&, const Vector<String>& blobURLs, const Vector<String>& blobFilePaths, SerializationErrorMode = Throwing);
</ins><span class="cx">
</span><span class="cx"> static uint32_t wireFormatVersion();
</span><span class="cx">
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> typedef Vector<JSC::ArrayBufferContents> ArrayBufferContentsArray;
</span><span class="cx"> static void maybeThrowExceptionIfSerializationFailed(JSC::ExecState*, SerializationReturnCode);
</span><span class="cx"> static bool serializationDidCompleteSuccessfully(SerializationReturnCode);
</span><del>- static std::unique_ptr<ArrayBufferContentsArray> transferArrayBuffers(JSC::ExecState*, ArrayBufferArray&, SerializationReturnCode&);
</del><ins>+ static std::unique_ptr<ArrayBufferContentsArray> transferArrayBuffers(JSC::ExecState*, Vector<RefPtr<JSC::ArrayBuffer>>&, SerializationReturnCode&);
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT SerializedScriptValue(Vector<unsigned char>&&);
</span><span class="cx"> SerializedScriptValue(Vector<unsigned char>&&, const Vector<String>& blobURLs, std::unique_ptr<ArrayBufferContentsArray>&&);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -4905,7 +4905,6 @@
</span><span class="cx"> die "This should only be called for sequence or array types" unless $codeGenerator->IsSequenceOrFrozenArrayType($type);
</span><span class="cx">
</span><span class="cx"> my $innerType = $codeGenerator->GetSequenceOrFrozenArrayInnerType($type);
</span><del>- return "MessagePortArray" if $innerType eq "MessagePort";
</del><span class="cx"> return "Vector<" . GetNativeVectorInnerType($innerType) . ">";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5168,7 +5167,7 @@
</span><span class="cx">
</span><span class="cx"> if ($type eq "SerializedScriptValue") {
</span><span class="cx"> AddToImplIncludes("SerializedScriptValue.h", $conditional);
</span><del>- return ("SerializedScriptValue::create($statePointer, $value, 0, 0)", 1);
</del><ins>+ return ("SerializedScriptValue::create($stateReference, $value)", 1);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($type eq "Dictionary") {
</span><span class="lines">@@ -5274,7 +5273,7 @@
</span><span class="cx">
</span><span class="cx"> if ($type eq "SerializedScriptValue") {
</span><span class="cx"> AddToImplIncludes("SerializedScriptValue.h", $conditional);
</span><del>- return "$value ? $value->deserialize($statePointer, $globalObject, 0) : jsNull()";
</del><ins>+ return "$value ? $value->deserialize($stateReference, $globalObject) : jsNull()";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> AddToImplIncludes("StyleProperties.h", $conditional) if $type eq "CSSStyleDeclaration";
</span></span></pre></div>
<a id="trunkSourceWebCoredomCustomEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/CustomEvent.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/CustomEvent.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/CustomEvent.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> RefPtr<SerializedScriptValue> CustomEvent::trySerializeDetail(JSC::ExecState& state)
</span><span class="cx"> {
</span><span class="cx"> if (!m_triedToSerialize) {
</span><del>- m_serializedDetail = SerializedScriptValue::create(&state, m_detail, nullptr, nullptr, NonThrowing);
</del><ins>+ m_serializedDetail = SerializedScriptValue::create(state, m_detail, NonThrowing);
</ins><span class="cx"> m_triedToSerialize = true;
</span><span class="cx"> }
</span><span class="cx"> return m_serializedDetail;
</span></span></pre></div>
<a id="trunkSourceWebCoredomErrorEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ErrorEvent.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ErrorEvent.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/ErrorEvent.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> auto serializedError = trySerializeError(exec);
</span><span class="cx"> if (!serializedError)
</span><span class="cx"> return jsNull();
</span><del>- return serializedError->deserialize(&exec, &globalObject, nullptr);
</del><ins>+ return serializedError->deserialize(exec, &globalObject);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return error;
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx"> RefPtr<SerializedScriptValue> ErrorEvent::trySerializeError(ExecState& exec)
</span><span class="cx"> {
</span><span class="cx"> if (!m_triedToSerialize) {
</span><del>- m_serializedDetail = SerializedScriptValue::create(&exec, m_error, nullptr, nullptr, NonThrowing);
</del><ins>+ m_serializedDetail = SerializedScriptValue::create(exec, m_error, NonThrowing);
</ins><span class="cx"> m_triedToSerialize = true;
</span><span class="cx"> }
</span><span class="cx"> return m_serializedDetail;
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessageEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessageEvent.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessageEvent.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/MessageEvent.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -48,11 +48,11 @@
</span><span class="cx"> , m_origin(initializer.origin)
</span><span class="cx"> , m_lastEventId(initializer.lastEventId)
</span><span class="cx"> , m_source(WTFMove(initializer.source))
</span><del>- , m_ports(std::make_unique<MessagePortArray>(initializer.ports))
</del><ins>+ , m_ports(WTFMove(initializer.ports))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline MessageEvent::MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, std::unique_ptr<MessagePortArray> ports)
</del><ins>+inline MessageEvent::MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
</ins><span class="cx"> : Event(eventNames().messageEvent, false, false)
</span><span class="cx"> , m_dataType(DataTypeSerializedScriptValue)
</span><span class="cx"> , m_dataAsSerializedScriptValue(WTFMove(data))
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<MessageEvent> MessageEvent::create(std::unique_ptr<MessagePortArray> ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source)
</del><ins>+Ref<MessageEvent> MessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source)
</ins><span class="cx"> {
</span><span class="cx"> return adoptRef(*new MessageEvent(WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports)));
</span><span class="cx"> }
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, std::unique_ptr<MessagePortArray> ports)
</del><ins>+void MessageEvent::initMessageEvent(ExecState& state, const AtomicString& type, bool canBubble, bool cancelable, JSValue data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
</ins><span class="cx"> {
</span><span class="cx"> if (dispatched())
</span><span class="cx"> return;
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx"> initEvent(type, canBubble, cancelable);
</span><span class="cx">
</span><span class="cx"> m_dataType = DataTypeScriptValue;
</span><del>- m_dataAsScriptValue = data;
</del><ins>+ m_dataAsScriptValue = Deprecated::ScriptValue(state.vm(), data);
</ins><span class="cx"> m_dataAsSerializedScriptValue = nullptr;
</span><span class="cx"> m_triedToSerialize = false;
</span><span class="cx"> m_origin = origin;
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx"> m_ports = WTFMove(ports);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, std::unique_ptr<MessagePortArray> ports)
</del><ins>+void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
</ins><span class="cx"> {
</span><span class="cx"> if (dispatched())
</span><span class="cx"> return;
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx"> ASSERT(!m_dataAsScriptValue.hasNoValue());
</span><span class="cx">
</span><span class="cx"> if (!m_dataAsSerializedScriptValue && !m_triedToSerialize) {
</span><del>- m_dataAsSerializedScriptValue = SerializedScriptValue::create(exec, m_dataAsScriptValue.jsValue(), nullptr, nullptr, NonThrowing);
</del><ins>+ m_dataAsSerializedScriptValue = SerializedScriptValue::create(*exec, m_dataAsScriptValue.jsValue(), NonThrowing);
</ins><span class="cx"> m_triedToSerialize = true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessageEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessageEvent.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessageEvent.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/MessageEvent.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx">
</span><span class="cx"> class MessageEvent final : public Event {
</span><span class="cx"> public:
</span><del>- static Ref<MessageEvent> create(std::unique_ptr<MessagePortArray>, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, Optional<MessageEventSource>&& source = Nullopt);
</del><ins>+ static Ref<MessageEvent> create(Vector<RefPtr<MessagePort>>&&, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, Optional<MessageEventSource>&& source = Nullopt);
</ins><span class="cx"> static Ref<MessageEvent> create(const AtomicString& type, RefPtr<SerializedScriptValue>&&, const String& origin, const String& lastEventId);
</span><span class="cx"> static Ref<MessageEvent> create(const String& data, const String& origin = { });
</span><span class="cx"> static Ref<MessageEvent> create(Ref<Blob>&& data, const String& origin);
</span><span class="lines">@@ -54,19 +54,19 @@
</span><span class="cx"> String origin;
</span><span class="cx"> String lastEventId;
</span><span class="cx"> Optional<MessageEventSource> source;
</span><del>- MessagePortArray ports;
</del><ins>+ Vector<RefPtr<MessagePort>> ports;
</ins><span class="cx"> };
</span><span class="cx"> static Ref<MessageEvent> create(JSC::ExecState&, const AtomicString& type, Init&, IsTrusted = IsTrusted::No);
</span><span class="cx">
</span><span class="cx"> virtual ~MessageEvent();
</span><span class="cx">
</span><del>- void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const Deprecated::ScriptValue& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, std::unique_ptr<MessagePortArray>);
- void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, std::unique_ptr<MessagePortArray>);
</del><ins>+ void initMessageEvent(JSC::ExecState&, const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
+ void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
</ins><span class="cx">
</span><span class="cx"> const String& origin() const { return m_origin; }
</span><span class="cx"> const String& lastEventId() const { return m_lastEventId; }
</span><span class="cx"> EventTarget* source() const;
</span><del>- MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArray(); }
</del><ins>+ const Vector<RefPtr<MessagePort>>& ports() const { return m_ports; }
</ins><span class="cx">
</span><span class="cx"> // FIXME: Remove this when we have custom ObjC binding support.
</span><span class="cx"> SerializedScriptValue* data() const;
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> private:
</span><span class="cx"> MessageEvent();
</span><span class="cx"> MessageEvent(JSC::ExecState&, const AtomicString&, Init&, IsTrusted);
</span><del>- MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, std::unique_ptr<MessagePortArray>);
</del><ins>+ MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
</ins><span class="cx"> MessageEvent(const AtomicString& type, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId);
</span><span class="cx"> MessageEvent(const String& data, const String& origin);
</span><span class="cx"> MessageEvent(Ref<Blob>&& data, const String& origin);
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> String m_origin;
</span><span class="cx"> String m_lastEventId;
</span><span class="cx"> Optional<MessageEventSource> m_source;
</span><del>- std::unique_ptr<MessagePortArray> m_ports;
</del><ins>+ Vector<RefPtr<MessagePort>> m_ports;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessageEventidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessageEvent.idl (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessageEvent.idl        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/MessageEvent.idl        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -39,11 +39,10 @@
</span><span class="cx">
</span><span class="cx"> [Custom] void initMessageEvent(optional DOMString typeArg, optional boolean canBubbleArg, optional boolean cancelableArg,
</span><span class="cx"> optional any dataArg, optional USVString originArg, optional DOMString lastEventIdArg, optional (DOMWindow or MessagePort)? sourceArg,
</span><del>- optional Array messagePorts);
-
</del><ins>+ optional sequence<MessagePort> messagePorts);
</ins><span class="cx"> [Custom] void webkitInitMessageEvent(optional DOMString typeArg, optional boolean canBubbleArg, optional boolean cancelableArg,
</span><span class="cx"> optional any dataArg, optional USVString originArg, optional DOMString lastEventIdArg, optional (DOMWindow or MessagePort)? sourceArg,
</span><del>- optional Array transferables);
</del><ins>+ optional sequence<MessagePort> messagePorts);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> dictionary MessageEventInit : EventInit {
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessagePortcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessagePort.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessagePort.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/MessagePort.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> m_scriptExecutionContext->destroyedMessagePort(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MessagePort::postMessage(RefPtr<SerializedScriptValue>&& message, const MessagePortArray* ports, ExceptionCode& ec)
</del><ins>+void MessagePort::postMessage(RefPtr<SerializedScriptValue>&& message, Vector<RefPtr<MessagePort>>&& ports, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> if (!isEntangled())
</span><span class="cx"> return;
</span><span class="lines">@@ -61,14 +61,14 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<MessagePortChannelArray> channels;
</span><span class="cx"> // Make sure we aren't connected to any of the passed-in ports.
</span><del>- if (ports) {
- for (auto& dataPort : *ports) {
</del><ins>+ if (!ports.isEmpty()) {
+ for (auto& dataPort : ports) {
</ins><span class="cx"> if (dataPort == this || m_entangledChannel->isConnectedTo(dataPort.get())) {
</span><span class="cx"> ec = DATA_CLONE_ERR;
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- channels = MessagePort::disentanglePorts(ports, ec);
</del><ins>+ channels = MessagePort::disentanglePorts(WTFMove(ports), ec);
</ins><span class="cx"> if (ec)
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx"> if (is<WorkerGlobalScope>(*m_scriptExecutionContext) && downcast<WorkerGlobalScope>(*m_scriptExecutionContext).isClosing())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- std::unique_ptr<MessagePortArray> ports = MessagePort::entanglePorts(*m_scriptExecutionContext, WTFMove(channels));
</del><ins>+ Vector<RefPtr<MessagePort>> ports = MessagePort::entanglePorts(*m_scriptExecutionContext, WTFMove(channels));
</ins><span class="cx"> Ref<Event> event = MessageEvent::create(WTFMove(ports), WTFMove(message));
</span><span class="cx"> dispatchEvent(event);
</span><span class="cx"> }
</span><span class="lines">@@ -174,9 +174,9 @@
</span><span class="cx"> return m_entangledChannel ? m_entangledChannel->locallyEntangledPort(m_scriptExecutionContext) : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<MessagePortChannelArray> MessagePort::disentanglePorts(const MessagePortArray* ports, ExceptionCode& ec)
</del><ins>+std::unique_ptr<MessagePortChannelArray> MessagePort::disentanglePorts(Vector<RefPtr<MessagePort>>&& ports, ExceptionCode& ec)
</ins><span class="cx"> {
</span><del>- if (!ports || !ports->size())
</del><ins>+ if (ports.isEmpty())
</ins><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="cx"> // HashSet used to efficiently check for duplicates in the passed-in array.
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> HashSet<MessagePort*> portSet;
</span><span class="cx">
</span><span class="cx"> // Walk the incoming array - if there are any duplicate ports, or null ports or cloned ports, throw an error (per section 8.3.3 of the HTML5 spec).
</span><del>- for (auto& port : *ports) {
</del><ins>+ for (auto& port : ports) {
</ins><span class="cx"> if (!port || port->isNeutered() || portSet.contains(port.get())) {
</span><span class="cx"> ec = DATA_CLONE_ERR;
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -192,24 +192,25 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Passed-in ports passed validity checks, so we can disentangle them.
</span><del>- auto portArray = std::make_unique<MessagePortChannelArray>(ports->size());
- for (unsigned int i = 0 ; i < ports->size() ; ++i) {
- std::unique_ptr<MessagePortChannel> channel = (*ports)[i]->disentangle();
</del><ins>+ auto portArray = std::make_unique<MessagePortChannelArray>(ports.size());
+ for (unsigned int i = 0 ; i < ports.size() ; ++i) {
+ std::unique_ptr<MessagePortChannel> channel = ports[i]->disentangle();
</ins><span class="cx"> (*portArray)[i] = WTFMove(channel);
</span><span class="cx"> }
</span><span class="cx"> return portArray;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<MessagePortArray> MessagePort::entanglePorts(ScriptExecutionContext& context, std::unique_ptr<MessagePortChannelArray> channels)
</del><ins>+Vector<RefPtr<MessagePort>> MessagePort::entanglePorts(ScriptExecutionContext& context, std::unique_ptr<MessagePortChannelArray> channels)
</ins><span class="cx"> {
</span><span class="cx"> if (!channels || !channels->size())
</span><del>- return nullptr;
</del><ins>+ return { };
</ins><span class="cx">
</span><del>- auto portArray = std::make_unique<MessagePortArray>(channels->size());
</del><ins>+ Vector<RefPtr<MessagePort>> portArray;
+ portArray.reserveInitialCapacity(channels->size());
</ins><span class="cx"> for (unsigned int i = 0; i < channels->size(); ++i) {
</span><span class="cx"> auto port = MessagePort::create(context);
</span><span class="cx"> port->entangle(WTFMove((*channels)[i]));
</span><del>- (*portArray)[i] = WTFMove(port);
</del><ins>+ portArray.uncheckedAppend(WTFMove(port));
</ins><span class="cx"> }
</span><span class="cx"> return portArray;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomMessagePorth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/MessagePort.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/MessagePort.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/MessagePort.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -42,15 +42,12 @@
</span><span class="cx"> class MessagePort;
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx">
</span><del>- // The overwhelmingly common case is sending a single port, so handle that efficiently with an inline buffer of size 1.
- typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
-
</del><span class="cx"> class MessagePort final : public RefCounted<MessagePort>, public EventTargetWithInlineData {
</span><span class="cx"> public:
</span><span class="cx"> static Ref<MessagePort> create(ScriptExecutionContext& scriptExecutionContext) { return adoptRef(*new MessagePort(scriptExecutionContext)); }
</span><span class="cx"> virtual ~MessagePort();
</span><span class="cx">
</span><del>- void postMessage(RefPtr<SerializedScriptValue>&& message, const MessagePortArray*, ExceptionCode&);
</del><ins>+ void postMessage(RefPtr<SerializedScriptValue>&& message, Vector<RefPtr<MessagePort>>&&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> void start();
</span><span class="cx"> void close();
</span><span class="lines">@@ -59,10 +56,9 @@
</span><span class="cx"> std::unique_ptr<MessagePortChannel> disentangle();
</span><span class="cx">
</span><span class="cx"> // Returns 0 if there is an exception, or if the passed-in array is 0/empty.
</span><del>- static std::unique_ptr<MessagePortChannelArray> disentanglePorts(const MessagePortArray*, ExceptionCode&);
</del><ins>+ static std::unique_ptr<MessagePortChannelArray> disentanglePorts(Vector<RefPtr<MessagePort>>&&, ExceptionCode&);
</ins><span class="cx">
</span><del>- // Returns 0 if the passed array is 0/empty.
- static std::unique_ptr<MessagePortArray> entanglePorts(ScriptExecutionContext&, std::unique_ptr<MessagePortChannelArray>);
</del><ins>+ static Vector<RefPtr<MessagePort>> entanglePorts(ScriptExecutionContext&, std::unique_ptr<MessagePortChannelArray>);
</ins><span class="cx">
</span><span class="cx"> void messageAvailable();
</span><span class="cx"> bool started() const { return m_started; }
</span></span></pre></div>
<a id="trunkSourceWebCoredomPopStateEventcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/PopStateEvent.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/PopStateEvent.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/dom/PopStateEvent.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> ASSERT(!m_state.hasNoValue());
</span><span class="cx">
</span><span class="cx"> if (!m_serializedState && !m_triedToSerialize) {
</span><del>- m_serializedState = SerializedScriptValue::create(exec, m_state.jsValue(), nullptr, nullptr, NonThrowing);
</del><ins>+ m_serializedState = SerializedScriptValue::create(*exec, m_state.jsValue(), NonThrowing);
</ins><span class="cx"> m_triedToSerialize = true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -906,7 +906,7 @@
</span><span class="cx"> return m_localStorage.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray* ports, const String& targetOrigin, DOMWindow& source, ExceptionCode& ec)
</del><ins>+void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, Vector<RefPtr<MessagePort>>&& ports, const String& targetOrigin, DOMWindow& source, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> if (!isCurrentlyDisplayedInFrame())
</span><span class="cx"> return;
</span><span class="lines">@@ -930,7 +930,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto channels = MessagePort::disentanglePorts(ports, ec);
</del><ins>+ auto channels = MessagePort::disentanglePorts(WTFMove(ports), ec);
</ins><span class="cx"> if (ec)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/page/DOMWindow.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -88,8 +88,6 @@
</span><span class="cx">
</span><span class="cx"> struct WindowFeatures;
</span><span class="cx">
</span><del>- typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray;
-
</del><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><span class="cx"> enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForwardList };
</span><span class="lines">@@ -241,7 +239,7 @@
</span><span class="cx"> void printErrorMessage(const String&);
</span><span class="cx"> String crossDomainAccessErrorMessage(const DOMWindow& activeWindow);
</span><span class="cx">
</span><del>- void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, DOMWindow& source, ExceptionCode&);
</del><ins>+ void postMessage(PassRefPtr<SerializedScriptValue> message, Vector<RefPtr<MessagePort>>&&, const String& targetOrigin, DOMWindow& source, ExceptionCode&);
</ins><span class="cx"> void postMessageTimerFired(PostMessageTimer&);
</span><span class="cx"> void dispatchMessageEventWithOriginCheck(SecurityOrigin* intendedTargetOrigin, Event&, PassRefPtr<Inspector::ScriptCallStack>);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -63,10 +63,10 @@
</span><span class="cx"> return DedicatedWorkerGlobalScopeEventTargetInterfaceType;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void DedicatedWorkerGlobalScope::postMessage(RefPtr<SerializedScriptValue>&& message, const MessagePortArray* ports, ExceptionCode& ec)
</del><ins>+void DedicatedWorkerGlobalScope::postMessage(RefPtr<SerializedScriptValue>&& message, Vector<RefPtr<MessagePort>>&& ports, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> // Disentangle the port in preparation for sending it to the remote context.
</span><del>- auto channels = MessagePort::disentanglePorts(ports, ec);
</del><ins>+ auto channels = MessagePort::disentanglePorts(WTFMove(ports), ec);
</ins><span class="cx"> if (ec)
</span><span class="cx"> return;
</span><span class="cx"> thread().workerObjectProxy().postMessageToWorkerObject(WTFMove(message), WTFMove(channels));
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersDedicatedWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/workers/DedicatedWorkerGlobalScope.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> // EventTarget
</span><span class="cx"> EventTargetInterface eventTargetInterface() const override;
</span><span class="cx">
</span><del>- void postMessage(RefPtr<SerializedScriptValue>&&, const MessagePortArray*, ExceptionCode&);
</del><ins>+ void postMessage(RefPtr<SerializedScriptValue>&&, Vector<RefPtr<MessagePort>>&&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> DedicatedWorkerThread& thread();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.cpp (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.cpp        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/workers/Worker.cpp        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -107,10 +107,10 @@
</span><span class="cx"> m_contextProxy->workerObjectDestroyed();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Worker::postMessage(RefPtr<SerializedScriptValue>&& message, const MessagePortArray* ports, ExceptionCode& ec)
</del><ins>+void Worker::postMessage(RefPtr<SerializedScriptValue>&& message, Vector<RefPtr<MessagePort>>&& ports, ExceptionCode& ec)
</ins><span class="cx"> {
</span><span class="cx"> // Disentangle the port in preparation for sending it to the remote context.
</span><del>- auto channels = MessagePort::disentanglePorts(ports, ec);
</del><ins>+ auto channels = MessagePort::disentanglePorts(WTFMove(ports), ec);
</ins><span class="cx"> if (ec)
</span><span class="cx"> return;
</span><span class="cx"> m_contextProxy->postMessageToWorkerGlobalScope(WTFMove(message), WTFMove(channels));
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/Worker.h (207504 => 207505)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/Worker.h        2016-10-18 23:55:04 UTC (rev 207504)
+++ trunk/Source/WebCore/workers/Worker.h        2016-10-19 00:05:09 UTC (rev 207505)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">
</span><span class="cx"> EventTargetInterface eventTargetInterface() const override { return WorkerEventTargetInterfaceType; }
</span><span class="cx">
</span><del>- void postMessage(RefPtr<SerializedScriptValue>&& message, const MessagePortArray*, ExceptionCode&);
</del><ins>+ void postMessage(RefPtr<SerializedScriptValue>&& message, Vector<RefPtr<MessagePort>>&&, ExceptionCode&);
</ins><span class="cx">
</span><span class="cx"> void terminate();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>