<!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>[190401] trunk</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/190401">190401</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2015-10-01 05:30:43 -0700 (Thu, 01 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Streams API] Add support for private WebCore JS builtins functions
https://bugs.webkit.org/show_bug.cgi?id=149518
Reviewed by Darin Adler.
Source/JavaScriptCore:
Adding API to add private identifiers on the fly.
This is used to support private JS Builtin functions/private JS Builtin names in WebCore.
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::appendExternalName):
* runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::appendExternalName):
* runtime/CommonIdentifiers.h:
Source/WebCore:
Using ReadableStream tee method as a testbed to add support for private WebCore JS builtins functions.
Private functions are hooked to JSDOMWindowBase, as it is the one connected to WebCoreClientData.
WebCoreClientData is responsible to export the private function symbols to the VM.
Updated generate-js-builtins script to generate a class that can create and own all JS functions.
This class is used by JSDOMWindowBase to create the JS builtin functions.
It is also used to manage the GC of these objects.
Covered by rebased tests.
* CMakeLists.txt: Adding ReadableStreamInternals builtin files.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* Modules/streams/ReadableStream.idl: Adding tee declaration as builtin
* Modules/streams/ReadableStream.js:
(tee): Calling @teeReadableStream
* Modules/streams/ReadableStreamInternals.js: Barebone @teeReadableStream implementation.
(teeReadableStream):
* WebCore.vcxproj/WebCore.vcxproj: Adding ReadableStreamInternals builtin files.
* WebCore.xcodeproj/project.pbxproj: Adding ReadableStreamInternals builtin files.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase): Creating ReadableStreamInternalsBuiltinFunctions object.
(WebCore::JSDOMWindowBase::finishCreation): Creating builtin functions through ReadableStreamInternalsBuiltinFunctions and registering them to the JS engine.
(WebCore::JSDOMWindowBase::visitChildren): Ensuring GC does not collect private builtin functions through ReadableStreamInternalsBuiltinFunctions object
* bindings/js/JSDOMWindowBase.h:
* bindings/js/WebCoreJSClientData.h:
(WebCore::WebCoreJSClientData::WebCoreJSClientData): Exporting private names of ReadableStreamInternalsBuiltins
(WebCore::WebCoreJSClientData::readableStreamBuiltins):
(WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins):
* generate-js-builtins: Adding support for ReadableStreamInternalsBuiltinFunctions and exportNames.
LayoutTests:
Rebasing tests now that tee is appearing in the IDL, although not yet conformant in its implementation.
* streams/reference-implementation/readable-stream-expected.txt:
* streams/reference-implementation/readable-stream-tee-expected.txt:
* streams/reference-implementation/readable-stream-templated-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstreamsreferenceimplementationreadablestreamexpectedtxt">trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstreamsreferenceimplementationreadablestreamteeexpectedtxt">trunk/LayoutTests/streams/reference-implementation/readable-stream-tee-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstreamsreferenceimplementationreadablestreamtemplatedexpectedtxt">trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinNamesh">trunk/Source/JavaScriptCore/builtins/BuiltinNames.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifierscpp">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonIdentifiersh">trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamidl">trunk/Source/WebCore/Modules/streams/ReadableStream.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamjs">trunk/Source/WebCore/Modules/streams/ReadableStream.js</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowBasecpp">trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowBaseh">trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreJSBuiltinscpp">trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreJSClientDatah">trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h</a></li>
<li><a href="#trunkSourceWebCoregeneratejsbuiltins">trunk/Source/WebCore/generate-js-builtins</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamInternalsjs">trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/LayoutTests/ChangeLog        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
+ [Streams API] Add support for private WebCore JS builtins functions
+ https://bugs.webkit.org/show_bug.cgi?id=149518
+
+ Reviewed by Darin Adler.
+
+ Rebasing tests now that tee is appearing in the IDL, although not yet conformant in its implementation.
+
+ * streams/reference-implementation/readable-stream-expected.txt:
+ * streams/reference-implementation/readable-stream-tee-expected.txt:
+ * streams/reference-implementation/readable-stream-templated-expected.txt:
+
</ins><span class="cx"> 2015-10-01 Xabier Rodriguez Calvar <calvaris@igalia.com>
</span><span class="cx">
</span><span class="cx"> [Streams API] Update readable-stream tests against latest reference
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsreferenceimplementationreadablestreamexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx">
</span><span class="cx"> PASS ReadableStream can be constructed with no errors
</span><span class="cx"> PASS ReadableStream can't be constructed with garbage
</span><del>-FAIL ReadableStream instances should have the correct list of properties assert_array_equals: should have all the correct methods lengths differ, expected 7 got 6
</del><ins>+FAIL ReadableStream instances should have the correct list of properties assert_false: method should be non-enumerable expected false got true
</ins><span class="cx"> PASS ReadableStream constructor should throw for non-function start arguments
</span><span class="cx"> PASS ReadableStream constructor can get initial garbage as cancel argument
</span><span class="cx"> PASS ReadableStream constructor can get initial garbage as pull argument
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsreferenceimplementationreadablestreamteeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-tee-expected.txt (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/reference-implementation/readable-stream-tee-expected.txt        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-tee-expected.txt        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1,12 +1,12 @@
</span><span class="cx">
</span><del>-FAIL ReadableStream teeing: rs.tee() returns an array of two ReadableStreams rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: should be able to read one branch to the end without affecting the other rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: values should be equal across each branch rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: errors in the source should propagate to both branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: canceling branch1 should not impact branch2 rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: canceling branch2 should not impact branch1 rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: canceling both branches should aggregate the cancel reasons into an array rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: failing to cancel the original stream should cause cancel() to reject on branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: closing the original should immediately close the branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
-FAIL ReadableStream teeing: erroring the original should immediately error the branches rs.tee is not a function. (In 'rs.tee()', 'rs.tee' is undefined)
</del><ins>+FAIL ReadableStream teeing: rs.tee() returns an array of two ReadableStreams tee is not implemented
+FAIL ReadableStream teeing: should be able to read one branch to the end without affecting the other tee is not implemented
+FAIL ReadableStream teeing: values should be equal across each branch tee is not implemented
+FAIL ReadableStream teeing: errors in the source should propagate to both branches tee is not implemented
+FAIL ReadableStream teeing: canceling branch1 should not impact branch2 tee is not implemented
+FAIL ReadableStream teeing: canceling branch2 should not impact branch1 tee is not implemented
+FAIL ReadableStream teeing: canceling both branches should aggregate the cancel reasons into an array tee is not implemented
+FAIL ReadableStream teeing: failing to cancel the original stream should cause cancel() to reject on branches tee is not implemented
+FAIL ReadableStream teeing: closing the original should immediately close the branches tee is not implemented
+FAIL ReadableStream teeing: erroring the original should immediately error the branches tee is not implemented
</ins><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsstreamsreferenceimplementationreadablestreamtemplatedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/LayoutTests/streams/reference-implementation/readable-stream-templated-expected.txt        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx">
</span><span class="cx"> PASS Running templatedRSEmpty with ReadableStream (empty)
</span><del>-FAIL instances have the correct methods and properties assert_equals: has a tee method expected "function" but got "undefined"
</del><ins>+PASS instances have the correct methods and properties
</ins><span class="cx"> PASS Running templatedRSEmptyReader with ReadableStream (empty) reader
</span><span class="cx"> PASS instances have the correct methods and properties
</span><span class="cx"> PASS locked should be true
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
+ [Streams API] Add support for private WebCore JS builtins functions
+ https://bugs.webkit.org/show_bug.cgi?id=149518
+
+ Reviewed by Darin Adler.
+
+ Adding API to add private identifiers on the fly.
+ This is used to support private JS Builtin functions/private JS Builtin names in WebCore.
+
+ * builtins/BuiltinNames.h:
+ (JSC::BuiltinNames::appendExternalName):
+ * runtime/CommonIdentifiers.cpp:
+ (JSC::CommonIdentifiers::appendExternalName):
+ * runtime/CommonIdentifiers.h:
+
</ins><span class="cx"> 2015-09-30 Jaehun Lim <ljaehun.lim@samsung.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, cleanup after r190385
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/BuiltinNames.h (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinNames.h        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinNames.h        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -59,6 +59,8 @@
</span><span class="cx"> const Identifier* lookUpPrivateName(const Identifier&) const;
</span><span class="cx"> const Identifier& lookUpPublicName(const Identifier&) const;
</span><span class="cx">
</span><ins>+ void appendExternalName(const Identifier& publicName, const Identifier& privateName);
+
</ins><span class="cx"> JSC_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
</span><span class="cx"> JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
</span><span class="cx"> JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(DECLARE_BUILTIN_SYMBOL_ACCESSOR)
</span><span class="lines">@@ -108,7 +110,17 @@
</span><span class="cx"> return m_emptyIdentifier;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline void BuiltinNames::appendExternalName(const Identifier& publicName, const Identifier& privateName)
+{
+#ifndef NDEBUG
+ for (const auto& key : m_publicToPrivateMap.keys())
+ ASSERT(publicName.string() != *key);
+#endif
</ins><span class="cx">
</span><ins>+ m_privateToPublicMap.add(privateName.impl(), &publicName);
+ m_publicToPrivateMap.add(publicName.impl(), &privateName);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifierscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.cpp (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.cpp        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.cpp        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -78,5 +78,9 @@
</span><span class="cx"> return m_builtinNames->lookUpPublicName(ident);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void CommonIdentifiers::appendExternalName(const Identifier& publicName, const Identifier& privateName)
+{
+ m_builtinNames->appendExternalName(publicName, privateName);
+}
</ins><span class="cx">
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonIdentifiersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/JavaScriptCore/runtime/CommonIdentifiers.h        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -359,6 +359,10 @@
</span><span class="cx">
</span><span class="cx"> const BytecodeIntrinsicRegistry& bytecodeIntrinsicRegistry() const { return m_bytecodeIntrinsicRegistry; }
</span><span class="cx">
</span><ins>+ // Callers of this method should make sure that identifiers given to this method
+ // survive the lifetime of CommonIdentifiers and related VM.
+ JS_EXPORT_PRIVATE void appendExternalName(const Identifier& publicName, const Identifier& privateName);
+
</ins><span class="cx"> private:
</span><span class="cx"> BytecodeIntrinsicRegistry m_bytecodeIntrinsicRegistry;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -3355,6 +3355,7 @@
</span><span class="cx"> ${WEBCORE_DIR}/Modules/streams/ByteLengthQueuingStrategy.js
</span><span class="cx"> ${WEBCORE_DIR}/Modules/streams/CountQueuingStrategy.js
</span><span class="cx"> ${WEBCORE_DIR}/Modules/streams/ReadableStream.js
</span><ins>+ ${WEBCORE_DIR}/Modules/streams/ReadableStreamInternals.js
</ins><span class="cx"> )
</span><span class="cx">
</span><span class="cx"> WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/ChangeLog        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1,5 +1,43 @@
</span><span class="cx"> 2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr>
</span><span class="cx">
</span><ins>+ [Streams API] Add support for private WebCore JS builtins functions
+ https://bugs.webkit.org/show_bug.cgi?id=149518
+
+ Reviewed by Darin Adler.
+
+ Using ReadableStream tee method as a testbed to add support for private WebCore JS builtins functions.
+ Private functions are hooked to JSDOMWindowBase, as it is the one connected to WebCoreClientData.
+ WebCoreClientData is responsible to export the private function symbols to the VM.
+
+ Updated generate-js-builtins script to generate a class that can create and own all JS functions.
+ This class is used by JSDOMWindowBase to create the JS builtin functions.
+ It is also used to manage the GC of these objects.
+
+ Covered by rebased tests.
+
+ * CMakeLists.txt: Adding ReadableStreamInternals builtin files.
+ * DerivedSources.cpp: Ditto.
+ * DerivedSources.make: Ditto.
+ * Modules/streams/ReadableStream.idl: Adding tee declaration as builtin
+ * Modules/streams/ReadableStream.js:
+ (tee): Calling @teeReadableStream
+ * Modules/streams/ReadableStreamInternals.js: Barebone @teeReadableStream implementation.
+ (teeReadableStream):
+ * WebCore.vcxproj/WebCore.vcxproj: Adding ReadableStreamInternals builtin files.
+ * WebCore.xcodeproj/project.pbxproj: Adding ReadableStreamInternals builtin files.
+ * bindings/js/JSDOMWindowBase.cpp:
+ (WebCore::JSDOMWindowBase::JSDOMWindowBase): Creating ReadableStreamInternalsBuiltinFunctions object.
+ (WebCore::JSDOMWindowBase::finishCreation): Creating builtin functions through ReadableStreamInternalsBuiltinFunctions and registering them to the JS engine.
+ (WebCore::JSDOMWindowBase::visitChildren): Ensuring GC does not collect private builtin functions through ReadableStreamInternalsBuiltinFunctions object
+ * bindings/js/JSDOMWindowBase.h:
+ * bindings/js/WebCoreJSClientData.h:
+ (WebCore::WebCoreJSClientData::WebCoreJSClientData): Exporting private names of ReadableStreamInternalsBuiltins
+ (WebCore::WebCoreJSClientData::readableStreamBuiltins):
+ (WebCore::WebCoreJSClientData::readableStreamInternalsBuiltins):
+ * generate-js-builtins: Adding support for ReadableStreamInternalsBuiltinFunctions and exportNames.
+
+2015-10-01 Youenn Fablet <youenn.fablet@crf.canon.fr>
+
</ins><span class="cx"> Binding generator should make mutable CachedAttribute member fields
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=148056
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/DerivedSources.make        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1253,6 +1253,7 @@
</span><span class="cx"> $(WebCore)/Modules/streams/ByteLengthQueuingStrategy.js \
</span><span class="cx"> $(WebCore)/Modules/streams/CountQueuingStrategy.js \
</span><span class="cx"> $(WebCore)/Modules/streams/ReadableStream.js \
</span><ins>+ $(WebCore)/Modules/streams/ReadableStreamInternals.js \
</ins><span class="cx"> #
</span><span class="cx">
</span><span class="cx"> all : $(WEBCORE_JS_BUILTINS:%.js=%Builtins.cpp)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.idl (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.idl        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.idl        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> [RaisesException] ReadableStreamReader getReader();
</span><span class="cx"> [Custom] Promise pipeTo(any streams, any options);
</span><span class="cx"> [JSBuiltin] Object pipeThrough(any dest, any options);
</span><ins>+ [JSBuiltin] Object tee();
</ins><span class="cx">
</span><span class="cx"> readonly attribute boolean locked;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.js        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -30,3 +30,11 @@
</span><span class="cx"> this.pipeTo(streams.writable, options);
</span><span class="cx"> return streams.readable;
</span><span class="cx"> }
</span><ins>+
+function tee()
+{
+ "use strict";
+
+ // TODO: check this is a ReadableStream
+ return @teeReadableStream(this, false)
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamInternalsjsfromrev190400trunkSourceWebCoreModulesstreamsReadableStreamjs"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js (from rev 190400, trunk/Source/WebCore/Modules/streams/ReadableStream.js) (0 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js         (rev 0)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+/*
+ * Copyright (C) 2015 Canon Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+function teeReadableStream(stream, shouldClone)
+{
+ "use strict";
+
+ throw new @TypeError("tee is not implemented");
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -3946,6 +3946,20 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\ReadableStreamInternalsBuiltins.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStreamController.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -1504,6 +1504,9 @@
</span><span class="cx">                 4162A4571011464700DFF3ED /* JSDedicatedWorkerGlobalScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4162A4551011464700DFF3ED /* JSDedicatedWorkerGlobalScope.cpp */; };
</span><span class="cx">                 4162A4581011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A4561011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h */; };
</span><span class="cx">                 416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E29A5102FA962007FC14E /* WorkerReportingProxy.h */; };
</span><ins>+                416E6FE81BBD12DF000A6043 /* ReadableStreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                416E6FEA1BBD1684000A6043 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8071BB3110D00B764D9 /* ReadableStreamInternalsBuiltinsWrapper.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 417253AA1354BBBC00360F2A /* MediaControlElements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417253A81354BBBC00360F2A /* MediaControlElements.cpp */; };
</span><span class="cx">                 417253AB1354BBBC00360F2A /* MediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = 417253A91354BBBC00360F2A /* MediaControlElements.h */; };
</span><span class="cx">                 417DA6D913734E6E007C57FB /* Internals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417DA4CF13734326007C57FB /* Internals.cpp */; };
</span><span class="lines">@@ -11327,7 +11330,9 @@
</span><span class="cx">                 9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSToLengthConversionData.h; sourceTree = "<group>"; };
</span><span class="cx">                 9AB1F37F18E2489A00534743 /* CSSToLengthConversionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSToLengthConversionData.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltins.h; sourceTree = "<group>"; };
</span><ins>+                9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltins.h; sourceTree = "<group>"; };
</ins><span class="cx">                 9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamBuiltinsWrapper.h; sourceTree = "<group>"; };
</span><ins>+                9B03D8071BB3110D00B764D9 /* ReadableStreamInternalsBuiltinsWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamInternalsBuiltinsWrapper.h; sourceTree = "<group>"; };
</ins><span class="cx">                 9B19B67E1B964E5200348745 /* ShadowRoot.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ShadowRoot.idl; sourceTree = "<group>"; };
</span><span class="cx">                 9B1AB0791648C69D0051F3F2 /* HTMLFormControlsCollection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLFormControlsCollection.idl; sourceTree = "<group>"; };
</span><span class="cx">                 9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormControlsCollectionCustom.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -17077,7 +17082,9 @@
</span><span class="cx">                                 71E2183817359FB8006E6E4D /* PlugInsResources.h */,
</span><span class="cx">                                 71E2183917359FB8006E6E4D /* PlugInsResourcesData.cpp */,
</span><span class="cx">                                 9B03D8061BB3110D00B764D8 /* ReadableStreamBuiltins.h */,
</span><ins>+                                9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */,
</ins><span class="cx">                                 9B03D8071BB3110D00B764D8 /* ReadableStreamBuiltinsWrapper.h */,
</span><ins>+                                9B03D8071BB3110D00B764D9 /* ReadableStreamInternalsBuiltinsWrapper.h */,
</ins><span class="cx">                                 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */,
</span><span class="cx">                                 43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */,
</span><span class="cx">                                 26AA0F9D18D2A18B00419381 /* SelectorPseudoElementTypeMap.cpp */,
</span><span class="lines">@@ -25084,6 +25091,7 @@
</span><span class="cx">                                 BC1A37BE097C715F0019F3D8 /* DOMTraversal.h in Headers */,
</span><span class="cx">                                 85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */,
</span><span class="cx">                                 850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */,
</span><ins>+                                416E6FE91BBD12E5000A6043 /* ReadableStreamBuiltins.h in Headers */,
</ins><span class="cx">                                 85C7F4910AAF79DC004014DD /* DOMUIEvent.h in Headers */,
</span><span class="cx">                                 85989DD00ACC8BBD00A0BC51 /* DOMUIEventInternal.h in Headers */,
</span><span class="cx">                                 FED13D2A0CEA91DF00D89466 /* DOMUIKitExtensions.h in Headers */,
</span><span class="lines">@@ -25264,6 +25272,7 @@
</span><span class="cx">                                 B2AFFC7E0D00A5C10030074D /* FontCustomPlatformData.h in Headers */,
</span><span class="cx">                                 B2C3DA660D006CD600EF6F26 /* FontDescription.h in Headers */,
</span><span class="cx">                                 4A6E9FC813C17D570046A7F8 /* FontFeatureSettings.h in Headers */,
</span><ins>+                                416E6FE81BBD12DF000A6043 /* ReadableStreamInternalsBuiltins.h in Headers */,
</ins><span class="cx">                                 409EBDB616B7EEA300CBA3FC /* FontLoader.h in Headers */,
</span><span class="cx">                                 0845680812B90DA600960A9F /* FontMetrics.h in Headers */,
</span><span class="cx">                                 B5320D6B122A24E9002D1440 /* FontPlatformData.h in Headers */,
</span><span class="lines">@@ -25729,6 +25738,7 @@
</span><span class="cx">                                 FC9E0E4D16419C1E00392BE3 /* JSDOMWindowCSS.h in Headers */,
</span><span class="cx">                                 652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
</span><span class="cx">                                 BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowShell.h in Headers */,
</span><ins>+                                416E6FEA1BBD1684000A6043 /* ReadableStreamInternalsBuiltinsWrapper.h in Headers */,
</ins><span class="cx">                                 65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
</span><span class="cx">                                 FD7868BA136B999200D403DF /* JSDynamicsCompressorNode.h in Headers */,
</span><span class="cx">                                 65DF31FA09D1CC60000BE325 /* JSElement.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -47,6 +47,10 @@
</span><span class="cx"> #include "WebSafeIncrementalSweeperIOS.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(STREAMS_API)
+#include "ReadableStreamInternalsBuiltins.h"
+#endif
+
</ins><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -65,6 +69,9 @@
</span><span class="cx"> , m_windowCloseWatchpoints((window && window->frame()) ? IsWatched : IsInvalidated)
</span><span class="cx"> , m_impl(window)
</span><span class="cx"> , m_shell(shell)
</span><ins>+#if ENABLE(STREAMS_API)
+ , m_readableStreamFunctions(vm)
+#endif
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -73,14 +80,36 @@
</span><span class="cx"> Base::finishCreation(vm, shell);
</span><span class="cx"> ASSERT(inherits(info()));
</span><span class="cx">
</span><ins>+#if ENABLE(STREAMS_API)
+ m_readableStreamFunctions.init(*this);
+#endif
+
</ins><span class="cx"> GlobalPropertyInfo staticGlobals[] = {
</span><span class="cx"> GlobalPropertyInfo(vm.propertyNames->document, jsNull(), DontDelete | ReadOnly),
</span><del>- GlobalPropertyInfo(vm.propertyNames->window, m_shell, DontDelete | ReadOnly)
</del><ins>+ GlobalPropertyInfo(vm.propertyNames->window, m_shell, DontDelete | ReadOnly),
+#if ENABLE(STREAMS_API)
+#define DECLARE_GLOBAL_STATIC(name)\
+ GlobalPropertyInfo(\
+ static_cast<WebCoreJSClientData*>(vm.clientData)->readableStreamInternalsBuiltins().name##PrivateName(),\
+ m_readableStreamFunctions.m_##name##Function.get() , DontDelete | ReadOnly),
+ WEBCOREREADABLESTREAMINTERNALS_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+#undef EXPORT_FUNCTION
+#endif
</ins><span class="cx"> };
</span><del>-
</del><ins>+
</ins><span class="cx"> addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void JSDOMWindowBase::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+ JSDOMWindowBase* thisObject = jsCast<JSDOMWindowBase*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ Base::visitChildren(thisObject, visitor);
+#if ENABLE(STREAMS_API)
+ thisObject->m_readableStreamFunctions.visit(visitor);
+#endif
+}
+
</ins><span class="cx"> void JSDOMWindowBase::destroy(JSCell* cell)
</span><span class="cx"> {
</span><span class="cx"> static_cast<JSDOMWindowBase*>(cell)->JSDOMWindowBase::~JSDOMWindowBase();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx">
</span><span class="cx"> #include "JSDOMBinding.h"
</span><span class="cx"> #include "JSDOMGlobalObject.h"
</span><ins>+#include "ReadableStreamInternalsBuiltinsWrapper.h"
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -73,6 +74,7 @@
</span><span class="cx">
</span><span class="cx"> static JSC::VM& commonVM();
</span><span class="cx"> static void fireFrameClearedWatchpointsForWindow(DOMWindow*);
</span><ins>+ static void visitChildren(JSC::JSCell*, JSC::SlotVisitor&);
</ins><span class="cx">
</span><span class="cx"> protected:
</span><span class="cx"> JSC::WatchpointSet m_windowCloseWatchpoints;
</span><span class="lines">@@ -84,6 +86,10 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<DOMWindow> m_impl;
</span><span class="cx"> JSDOMWindowShell* m_shell;
</span><ins>+
+#if ENABLE(STREAMS_API)
+ ReadableStreamInternalsBuiltinFunctions m_readableStreamFunctions;
+#endif
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> // Returns a JSDOMWindow or jsNull()
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreJSBuiltinscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSBuiltins.cpp        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -29,4 +29,5 @@
</span><span class="cx"> #include "ByteLengthQueuingStrategyBuiltins.cpp"
</span><span class="cx"> #include "CountQueuingStrategyBuiltins.cpp"
</span><span class="cx"> #include "ReadableStreamBuiltins.cpp"
</span><ins>+#include "ReadableStreamInternalsBuiltins.cpp"
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreJSClientDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "ByteLengthQueuingStrategyBuiltinsWrapper.h"
</span><span class="cx"> #include "CountQueuingStrategyBuiltinsWrapper.h"
</span><span class="cx"> #include "ReadableStreamBuiltinsWrapper.h"
</span><ins>+#include "ReadableStreamInternalsBuiltinsWrapper.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -44,12 +45,16 @@
</span><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx"> explicit WebCoreJSClientData(JSC::VM& vm)
</span><span class="cx"> : m_readableStreamBuiltins(&vm)
</span><ins>+ , m_readableStreamInternalsBuiltins(&vm)
</ins><span class="cx"> , m_byteLengthQueuingStrategyBuiltins(&vm)
</span><span class="cx"> , m_countQueuingStrategyBuiltins(&vm)
</span><span class="cx"> #else
</span><span class="cx"> WebCoreJSClientData(JSC::VM&)
</span><span class="cx"> #endif
</span><span class="cx"> {
</span><ins>+#if ENABLE(STREAMS_API)
+ m_readableStreamInternalsBuiltins.exportNames();
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> virtual ~WebCoreJSClientData()
</span><span class="lines">@@ -86,6 +91,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx"> ReadableStreamBuiltinsWrapper& readableStreamBuiltins() { return m_readableStreamBuiltins; }
</span><ins>+ ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; }
</ins><span class="cx"> ByteLengthQueuingStrategyBuiltinsWrapper& byteLengthQueuingStrategyBuiltins() { return m_byteLengthQueuingStrategyBuiltins; }
</span><span class="cx"> CountQueuingStrategyBuiltinsWrapper& countQueuingStrategyBuiltins() { return m_countQueuingStrategyBuiltins; }
</span><span class="cx"> #endif
</span><span class="lines">@@ -96,6 +102,7 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx"> ReadableStreamBuiltinsWrapper m_readableStreamBuiltins;
</span><ins>+ ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins;
</ins><span class="cx"> ByteLengthQueuingStrategyBuiltinsWrapper m_byteLengthQueuingStrategyBuiltins;
</span><span class="cx"> CountQueuingStrategyBuiltinsWrapper m_countQueuingStrategyBuiltins;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoregeneratejsbuiltins"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/generate-js-builtins (190400 => 190401)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/generate-js-builtins        2015-10-01 10:52:37 UTC (rev 190400)
+++ trunk/Source/WebCore/generate-js-builtins        2015-10-01 12:30:43 UTC (rev 190401)
</span><span class="lines">@@ -80,11 +80,11 @@
</span><span class="cx"> #include <bytecode/UnlinkedFunctionExecutable.h>
</span><span class="cx"> #include <builtins/BuiltinUtils.h>
</span><span class="cx"> #include <runtime/Identifier.h>
</span><ins>+#include <runtime/JSFunction.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class ${Filename}BuiltinsWrapper : private JSC::WeakHandleOwner
-{
</del><ins>+class ${Filename}BuiltinsWrapper : private JSC::WeakHandleOwner {
</ins><span class="cx"> public:
</span><span class="cx"> explicit ${Filename}BuiltinsWrapper(JSC::VM* vm)
</span><span class="cx"> : m_vm(*vm)
</span><span class="lines">@@ -103,6 +103,8 @@
</span><span class="cx">
</span><span class="cx"> ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
</span><span class="cx">
</span><ins>+ void exportNames();
+
</ins><span class="cx"> private:
</span><span class="cx"> JSC::VM& m_vm;
</span><span class="cx">
</span><span class="lines">@@ -126,6 +128,44 @@
</span><span class="cx"> ${Prefix}_FOREACH_BUILTIN(DEFINE_BUILTIN_EXECUTABLES)
</span><span class="cx"> #undef DEFINE_BUILTIN_EXECUTABLES
</span><span class="cx">
</span><ins>+inline void ${Filename}BuiltinsWrapper::exportNames()
+{
+#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
+ ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+#undef EXPORT_FUNCTION_NAME
+}
+
+class ${Filename}BuiltinFunctions {
+public:
+ explicit ${Filename}BuiltinFunctions(JSC::VM& vm) : m_vm(vm) { }
+
+ void init(JSC::JSGlobalObject&);
+ void visit(JSC::SlotVisitor&);
+
+public:
+ JSC::VM& m_vm;
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(functionName) \\
+ JSC::WriteBarrier<JSC::JSFunction> m_##functionName##Function;
+ ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+};
+
+inline void ${Filename}BuiltinFunctions::init(JSC::JSGlobalObject& globalObject)
+{
+#define EXPORT_FUNCTION(codeName, functionName, length)\\
+ m_##functionName##Function.set(m_vm, &globalObject, JSC::JSFunction::createBuiltinFunction(m_vm, codeName##Generator(m_vm), &globalObject));
+ ${Prefix}_FOREACH_BUILTIN(EXPORT_FUNCTION)
+#undef EXPORT_FUNCTION
+}
+
+inline void ${Filename}BuiltinFunctions::visit(JSC::SlotVisitor& visitor)
+{
+#define VISIT_FUNCTION(name) visitor.append(&m_##name##Function);
+ ${Prefix}_FOREACH_BUILTIN_FUNCTION_NAME(VISIT_FUNCTION)
+#undef VISIT_FUNCTION
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ${Filename}BuiltinsWrapper_h
</span></span></pre>
</div>
</div>
</body>
</html>