<!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>[194960] 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/194960">194960</a></dd>
<dt>Author</dt> <dd>youenn.fablet@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-01-13 01:54:24 -0800 (Wed, 13 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Streams API] Refactor builtin internals to prepare support for streams API in worker
https://bugs.webkit.org/show_bug.cgi?id=152535

Reviewed by Darin Adler.

Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
This file should be generated by the builtin generator once refactoring is done.
This code is located in JSBuiltinInternalFunctions::initialize.

Adding private controller and reader constructors to the JS DOM constructor map so that they do not get garbage collected.

No change in behavior, except that private builtins are usable in workers (but not actually used).

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
(WebCore::JSDOMGlobalObject::finishCreation):
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::visitChildren):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
(WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
(WebCore::JSBuiltinInternalFunctions::visit):
(WebCore::JSBuiltinInternalFunctions::initialize):
* bindings/js/WebCoreJSBuiltinInternals.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorebindingsjsJSDOMGlobalObjectcpp">trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMGlobalObjecth">trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h</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="#trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp">trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorsh">trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreJSBuiltinInternalsh">trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsjsWebCoreJSBuiltinInternalscpp">trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -1233,6 +1233,7 @@
</span><span class="cx">     bindings/js/ScriptGlobalObject.cpp
</span><span class="cx">     bindings/js/ScriptState.cpp
</span><span class="cx">     bindings/js/SerializedScriptValue.cpp
</span><ins>+    bindings/js/WebCoreJSBuiltinInternals.cpp
</ins><span class="cx">     bindings/js/WebCoreJSBuiltins.cpp
</span><span class="cx">     bindings/js/WebCoreTypedArrayController.cpp
</span><span class="cx">     bindings/js/WorkerScriptController.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/ChangeLog        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-01-13  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
+
+        [Streams API] Refactor builtin internals to prepare support for streams API in worker
+        https://bugs.webkit.org/show_bug.cgi?id=152535
+
+        Reviewed by Darin Adler.
+
+        Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
+        This file should be generated by the builtin generator once refactoring is done.
+        This code is located in JSBuiltinInternalFunctions::initialize.
+
+        Adding private controller and reader constructors to the JS DOM constructor map so that they do not get garbage collected.
+
+        No change in behavior, except that private builtins are usable in workers (but not actually used).
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
+        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
+        (WebCore::JSDOMGlobalObject::finishCreation):
+        (WebCore::JSDOMGlobalObject::visitChildren):
+        * bindings/js/JSDOMGlobalObject.h:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::finishCreation):
+        (WebCore::JSDOMWindowBase::visitChildren):
+        * bindings/js/JSDOMWindowBase.h:
+        * bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
+        (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
+        (WebCore::JSBuiltinInternalFunctions::visit):
+        (WebCore::JSBuiltinInternalFunctions::initialize):
+        * bindings/js/WebCoreJSBuiltinInternals.h:
+
</ins><span class="cx"> 2016-01-13  Gyuyoung Kim  &lt;gyuyoung.kim@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Fix wrong return value of paintThemePart in RenderThemeEfl
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -19042,6 +19042,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\bindings\js\WebCoreJSBuiltinInternals.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\bindings\js\WebCoreJSBuiltins.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -1489,6 +1489,7 @@
</span><span class="cx">                 40ECAE7E16B8B67200C36103 /* JSDOMError.h in Headers */ = {isa = PBXBuildFile; fileRef = 40ECAE7D16B8B67200C36103 /* JSDOMError.h */; };
</span><span class="cx">                 40ECAE8116B8B68A00C36103 /* JSDOMError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 40ECAE8016B8B68A00C36103 /* JSDOMError.cpp */; };
</span><span class="cx">                 410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */; };
</span><ins>+                410D33241C19985000F7FDE2 /* WebCoreJSBuiltinInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 410D33231C19984100F7FDE2 /* WebCoreJSBuiltinInternals.cpp */; };
</ins><span class="cx">                 4123081B138C429700BCCFCA /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93F19B1A08245E5A001E9ABC /* WebCore.framework */; };
</span><span class="cx">                 41230913138C42FF00BCCFCA /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8216299029F4FB501000131 /* JavaScriptCore.framework */; };
</span><span class="cx">                 4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */; };
</span><span class="lines">@@ -8859,6 +8860,7 @@
</span><span class="cx">                 40ECAE7D16B8B67200C36103 /* JSDOMError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMError.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 40ECAE8016B8B68A00C36103 /* JSDOMError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMError.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageEventCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                410D33231C19984100F7FDE2 /* WebCoreJSBuiltinInternals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSBuiltinInternals.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 41189EF71AD8232800B90A0D /* ReadableStreamController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamController.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 4129DF811BB5B79B00322A16 /* ReadableStreamController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamController.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22020,6 +22022,7 @@
</span><span class="cx">                                 A75E497410752ACB00C9B896 /* SerializedScriptValue.h */,
</span><span class="cx">                                 419BE7521BC7F3DB00E1C85B /* WebCoreBuiltinNames.h */,
</span><span class="cx">                                 419BE7531BC7F3DB00E1C85B /* WebCoreJSBuiltinInternals.h */,
</span><ins>+                                410D33231C19984100F7FDE2 /* WebCoreJSBuiltinInternals.cpp */,
</ins><span class="cx">                                 419BE7541BC7F3DB00E1C85B /* WebCoreJSBuiltins.cpp */,
</span><span class="cx">                                 419BE7551BC7F3DB00E1C85B /* WebCoreJSBuiltins.h */,
</span><span class="cx">                                 BC53D910114310CC000D817E /* WebCoreJSClientData.h */,
</span><span class="lines">@@ -31022,6 +31025,7 @@
</span><span class="cx">                                 536D5A25193F40FC00CE4CAB /* SourceSizeList.cpp in Sources */,
</span><span class="cx">                                 D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */,
</span><span class="cx">                                 626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */,
</span><ins>+                                410D33241C19985000F7FDE2 /* WebCoreJSBuiltinInternals.cpp in Sources */,
</ins><span class="cx">                                 AA2A5AD516A4861400975A25 /* SpeechSynthesis.cpp in Sources */,
</span><span class="cx">                                 AA2A5AD316A4860D00975A25 /* SpeechSynthesisEvent.cpp in Sources */,
</span><span class="cx">                                 AA2A5AD116A4860700975A25 /* SpeechSynthesisUtterance.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -30,7 +30,9 @@
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;JSDOMWindow.h&quot;
</span><span class="cx"> #include &quot;JSEventListener.h&quot;
</span><ins>+#include &quot;JSReadableStreamPrivateConstructors.h&quot;
</ins><span class="cx"> #include &quot;JSWorkerGlobalScope.h&quot;
</span><ins>+#include &quot;WebCoreJSClientData.h&quot;
</ins><span class="cx"> #include &quot;WorkerGlobalScope.h&quot;
</span><span class="cx"> 
</span><span class="cx"> using namespace JSC;
</span><span class="lines">@@ -44,6 +46,7 @@
</span><span class="cx">     , m_currentEvent(0)
</span><span class="cx">     , m_world(world)
</span><span class="cx">     , m_worldIsNormal(m_world-&gt;isNormal())
</span><ins>+    , m_builtinInternalFunctions(vm)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_world);
</span><span class="cx"> }
</span><span class="lines">@@ -53,16 +56,49 @@
</span><span class="cx">     static_cast&lt;JSDOMGlobalObject*&gt;(cell)-&gt;JSDOMGlobalObject::~JSDOMGlobalObject();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JSDOMGlobalObject::addBuiltinGlobals(VM&amp; vm)
+{
+    m_builtinInternalFunctions.initialize(*this, vm);
+
+#if ENABLE(STREAMS_API)
+    JSObject* privateReadableStreamControllerConstructor = createReadableStreamControllerPrivateConstructor(vm, *this);
+    JSObject* privateReadableStreamReaderConstructor = createReadableStreamReaderPrivateConstructor(vm, *this);
+
+    ASSERT(!constructors().get(privateReadableStreamControllerConstructor-&gt;info()).get());
+    ASSERT(!constructors().get(privateReadableStreamReaderConstructor-&gt;info()).get());
+    JSC::WriteBarrier&lt;JSC::JSObject&gt; temp;
+    constructors().add(privateReadableStreamControllerConstructor-&gt;info(), temp).iterator-&gt;value.set(vm, this, privateReadableStreamControllerConstructor);
+    constructors().add(privateReadableStreamReaderConstructor-&gt;info(), temp).iterator-&gt;value.set(vm, this, privateReadableStreamReaderConstructor);
+
+    JSVMClientData&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(vm.clientData);
+    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamClosedPrivateName(), jsNumber(1), DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamClosingPrivateName(), jsNumber(2), DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamErroredPrivateName(), jsNumber(3), DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamReadablePrivateName(), jsNumber(4), DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamControllerPrivateName(), privateReadableStreamControllerConstructor, DontDelete | ReadOnly),
+        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamReaderPrivateName(), privateReadableStreamReaderConstructor, DontDelete | ReadOnly),
+    };
+    addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
+#endif
+}
+
</ins><span class="cx"> void JSDOMGlobalObject::finishCreation(VM&amp; vm)
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm);
</span><span class="cx">     ASSERT(inherits(info()));
</span><ins>+
+    addBuiltinGlobals(vm);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSDOMGlobalObject::finishCreation(VM&amp; vm, JSObject* thisValue)
</span><span class="cx"> {
</span><span class="cx">     Base::finishCreation(vm, thisValue);
</span><span class="cx">     ASSERT(inherits(info()));
</span><ins>+
+    addBuiltinGlobals(vm);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ScriptExecutionContext* JSDOMGlobalObject::scriptExecutionContext() const
</span><span class="lines">@@ -86,6 +122,8 @@
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; constructor : thisObject-&gt;constructors().values())
</span><span class="cx">         visitor.append(&amp;constructor);
</span><ins>+
+    thisObject-&gt;m_builtinInternalFunctions.visit(visitor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSDOMGlobalObject::setCurrentEvent(Event* currentEvent)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.h        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #define JSDOMGlobalObject_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PlatformExportMacros.h&quot;
</span><ins>+#include &quot;WebCoreJSBuiltinInternals.h&quot;
</ins><span class="cx"> #include &lt;runtime/JSGlobalObject.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -85,6 +86,12 @@
</span><span class="cx">         Event* m_currentEvent;
</span><span class="cx">         const RefPtr&lt;DOMWrapperWorld&gt; m_world;
</span><span class="cx">         bool m_worldIsNormal;
</span><ins>+
+    private:
+        void addBuiltinGlobals(JSC::VM&amp;);
+        friend void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject&amp;, JSC::VM&amp;);
+
+        JSBuiltinInternalFunctions m_builtinInternalFunctions;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     template&lt;class ConstructorClass&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -52,17 +52,6 @@
</span><span class="cx"> #include &quot;WebSafeIncrementalSweeperIOS.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(STREAMS_API)
-#include &quot;JSReadableStreamPrivateConstructors.h&quot;
-#include &quot;ReadableStreamInternalsBuiltins.h&quot;
-#include &quot;StreamInternalsBuiltins.h&quot;
-#include &quot;WritableStreamInternalsBuiltins.h&quot;
-#endif
-
-#if ENABLE(MEDIA_STREAM)
-#include &quot;RTCPeerConnectionInternalsBuiltins.h&quot;
-#endif
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -81,7 +70,6 @@
</span><span class="cx">     , m_windowCloseWatchpoints((window &amp;&amp; window-&gt;frame()) ? IsWatched : IsInvalidated)
</span><span class="cx">     , m_wrapped(window)
</span><span class="cx">     , m_shell(shell)
</span><del>-    , m_privateFunctions(vm)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -90,47 +78,9 @@
</span><span class="cx">     Base::finishCreation(vm, shell);
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx"> 
</span><del>-    m_privateFunctions.init(*this);
-
-#if ENABLE(STREAMS_API) || ENABLE(MEDIA_STREAM)
-    JSVMClientData&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(vm.clientData);
-#endif
-
</del><span class="cx">     GlobalPropertyInfo staticGlobals[] = {
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;document, jsNull(), DontDelete | ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames-&gt;window, m_shell, DontDelete | ReadOnly),
</span><del>-#if ENABLE(STREAMS_API)
-        GlobalPropertyInfo(clientData.builtinNames().streamClosedPrivateName(), jsNumber(1), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().streamClosingPrivateName(), jsNumber(2), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().streamErroredPrivateName(), jsNumber(3), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().streamReadablePrivateName(), jsNumber(4), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().ReadableStreamControllerPrivateName(), createReadableStreamControllerPrivateConstructor(vm, *this), DontDelete | ReadOnly),
-        GlobalPropertyInfo(clientData.builtinNames().ReadableStreamReaderPrivateName(), createReadableStreamReaderPrivateConstructor(vm, *this), DontDelete | ReadOnly),
-#define DECLARE_GLOBAL_STATIC(name)\
-        GlobalPropertyInfo(\
-            clientData.builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), m_privateFunctions.readableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
-        WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
-#undef DECLARE_GLOBAL_STATIC
-#define DECLARE_GLOBAL_STATIC(name)\
-        GlobalPropertyInfo(\
-            clientData.builtinFunctions().streamInternalsBuiltins().name##PrivateName(), m_privateFunctions.streamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
-        WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
-#undef DECLARE_GLOBAL_STATIC
-#define DECLARE_GLOBAL_STATIC(name)\
-        GlobalPropertyInfo(\
-            clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), m_privateFunctions.writableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
-        WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
-#undef DECLARE_GLOBAL_STATIC
-#endif
-#if ENABLE(MEDIA_STREAM)
-#define DECLARE_GLOBAL_STATIC(name)\
-        GlobalPropertyInfo(\
-            clientData.builtinFunctions().rtcPeerConnectionInternalsBuiltins().name##PrivateName(), m_privateFunctions.rtcPeerConnectionInternals().m_##name##Function.get() , DontDelete | ReadOnly),
-        WEBCORE_FOREACH_RTCPEERCONNECTIONINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
-#undef DECLARE_GLOBAL_STATIC
-#endif
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
</span><span class="lines">@@ -141,7 +91,6 @@
</span><span class="cx">     JSDOMWindowBase* thisObject = jsCast&lt;JSDOMWindowBase*&gt;(cell);
</span><span class="cx">     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
</span><span class="cx">     Base::visitChildren(thisObject, visitor);
</span><del>-    thisObject-&gt;m_privateFunctions.visit(visitor);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSDOMWindowBase::destroy(JSCell* cell)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;JSDOMBinding.h&quot;
</span><span class="cx"> #include &quot;JSDOMGlobalObject.h&quot;
</span><del>-#include &quot;WebCoreJSBuiltinInternals.h&quot;
</del><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -86,8 +85,6 @@
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;DOMWindow&gt; m_wrapped;
</span><span class="cx">         JSDOMWindowShell* m_shell;
</span><del>-
-        JSBuiltinInternalFunctions m_privateFunctions;
</del><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Returns a JSDOMWindow or jsNull()
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -83,12 +83,12 @@
</span><span class="cx">     return readableStreamInternalsPrivateInitializeReadableStreamControllerCodeGenerator(vm);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue createReadableStreamReaderPrivateConstructor(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
</del><ins>+JSObject* createReadableStreamReaderPrivateConstructor(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
</ins><span class="cx"> {
</span><span class="cx">     return JSBuiltinReadableStreamReaderPrivateConstructor::create(vm, JSBuiltinReadableStreamReaderPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue createReadableStreamControllerPrivateConstructor(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
</del><ins>+JSObject* createReadableStreamControllerPrivateConstructor(VM&amp; vm, JSDOMGlobalObject&amp; globalObject)
</ins><span class="cx"> {
</span><span class="cx">     return JSBuiltinReadableStreamControllerPrivateConstructor::create(vm, JSBuiltinReadableStreamControllerPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -21,14 +21,20 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx"> 
</span><del>-#include &lt;runtime/JSCJSValue.h&gt;
</del><ins>+namespace JSC {
</ins><span class="cx"> 
</span><ins>+struct ClassInfo;
+class JSObject;
+class VM;
+
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class JSDOMGlobalObject;
</span><span class="cx"> 
</span><del>-JSC::JSValue createReadableStreamControllerPrivateConstructor(JSC::VM&amp;, JSDOMGlobalObject&amp;);
-JSC::JSValue createReadableStreamReaderPrivateConstructor(JSC::VM&amp;, JSDOMGlobalObject&amp;);
</del><ins>+JSC::JSObject* createReadableStreamControllerPrivateConstructor(JSC::VM&amp;, JSDOMGlobalObject&amp;);
+JSC::JSObject* createReadableStreamReaderPrivateConstructor(JSC::VM&amp;, JSDOMGlobalObject&amp;);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreJSBuiltinInternalscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.cpp (0 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.cpp        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -0,0 +1,118 @@
</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.
+ *  3.  Neither the name of Canon Inc. nor the names of
+ *      its contributors may be used to endorse or promote products derived
+ *      from this software without specific prior written permission.
+ *  THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS &quot;AS IS&quot; 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 CANON INC. AND ITS 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebCoreJSBuiltinInternals.h&quot;
+
+#include &quot;JSDOMGlobalObject.h&quot;
+#include &quot;JSReadableStreamPrivateConstructors.h&quot;
+#include &quot;WebCoreJSClientData.h&quot;
+#include &lt;heap/SlotVisitorInlines.h&gt;
+#include &lt;runtime/JSCJSValueInlines.h&gt;
+#include &lt;runtime/StructureInlines.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM&amp; v)
+    : vm(v)
+#if ENABLE(MEDIA_STREAM)
+    , m_rtcPeerConnectionInternalsFunctions(vm)
+#endif
+#if ENABLE(STREAMS_API)
+    , m_readableStreamInternalsFunctions(vm)
+    , m_streamInternalsFunctions(vm)
+    , m_writableStreamInternalsFunctions(vm)
+#endif
+{
+}
+
+void JSBuiltinInternalFunctions::visit(JSC::SlotVisitor&amp; visitor)
+{
+#if ENABLE(MEDIA_STREAM)
+    m_rtcPeerConnectionInternalsFunctions.visit(visitor);
+#endif
+#if ENABLE(STREAMS_API)
+    m_readableStreamInternalsFunctions.visit(visitor);
+    m_streamInternalsFunctions.visit(visitor);
+    m_writableStreamInternalsFunctions.visit(visitor);
+#endif
+#ifndef SKIP_UNUSED_PARAM
+    UNUSED_PARAM(visitor);
+#endif
+}
+
+void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject&amp; globalObject, VM&amp; vm)
+{
+#if ENABLE(MEDIA_STREAM)
+    m_rtcPeerConnectionInternalsFunctions.init(globalObject);
+#endif
+#if ENABLE(STREAMS_API)
+    m_readableStreamInternalsFunctions.init(globalObject);
+    m_streamInternalsFunctions.init(globalObject);
+    m_writableStreamInternalsFunctions.init(globalObject);
+#endif
+
+#if ENABLE(STREAMS_API) || ENABLE(MEDIA_STREAM)
+    JSVMClientData&amp; clientData = *static_cast&lt;JSVMClientData*&gt;(vm.clientData);
+
+    JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
+#if ENABLE(MEDIA_STREAM)
+#define DECLARE_GLOBAL_STATIC(name)\
+        JSDOMGlobalObject::GlobalPropertyInfo(\
+            clientData.builtinFunctions().rtcPeerConnectionInternalsBuiltins().name##PrivateName(), rtcPeerConnectionInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+        WEBCORE_FOREACH_RTCPEERCONNECTIONINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+#undef DECLARE_GLOBAL_STATIC
+#endif
+#if ENABLE(STREAMS_API)
+#define DECLARE_GLOBAL_STATIC(name)\
+        JSDOMGlobalObject::GlobalPropertyInfo(\
+            clientData.builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), readableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+        WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+#undef DECLARE_GLOBAL_STATIC
+#define DECLARE_GLOBAL_STATIC(name)\
+        JSDOMGlobalObject::GlobalPropertyInfo(\
+            clientData.builtinFunctions().streamInternalsBuiltins().name##PrivateName(), streamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+        WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+#undef DECLARE_GLOBAL_STATIC
+#define DECLARE_GLOBAL_STATIC(name)\
+        JSDOMGlobalObject::GlobalPropertyInfo(\
+            clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), writableStreamInternals().m_##name##Function.get() , DontDelete | ReadOnly),
+        WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
+#undef DECLARE_GLOBAL_STATIC
+#endif
+    };
+
+    globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
+#endif
+#ifndef SKIP_UNUSED_PARAM
+    UNUSED_PARAM(globalObject);
+    UNUSED_PARAM(vm);
+#endif
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWebCoreJSBuiltinInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.h (194959 => 194960)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.h        2016-01-13 08:15:44 UTC (rev 194959)
+++ trunk/Source/WebCore/bindings/js/WebCoreJSBuiltinInternals.h        2016-01-13 09:54:24 UTC (rev 194960)
</span><span class="lines">@@ -27,83 +27,54 @@
</span><span class="cx"> #ifndef WebCoreJSBuiltinInternals_h
</span><span class="cx"> #define WebCoreJSBuiltinInternals_h
</span><span class="cx"> 
</span><ins>+#if ENABLE(MEDIA_STREAM)
+#include &quot;RTCPeerConnectionInternalsBuiltins.h&quot;
+#endif
+
</ins><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx"> #include &quot;ReadableStreamInternalsBuiltins.h&quot;
</span><span class="cx"> #include &quot;StreamInternalsBuiltins.h&quot;
</span><span class="cx"> #include &quot;WritableStreamInternalsBuiltins.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MEDIA_STREAM)
-#include &quot;RTCPeerConnectionInternalsBuiltins.h&quot;
-#endif
-
</del><span class="cx"> #if ENABLE(STREAMS_API) || ENABLE(MEDIA_STREAM)
</span><span class="cx"> #define SKIP_UNUSED_PARAM
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class JSDOMGlobalObject;
+
+// FIXME: Make builtin generator generate this class
</ins><span class="cx"> class JSBuiltinInternalFunctions {
</span><span class="cx"> public:
</span><del>-explicit JSBuiltinInternalFunctions(JSC::VM&amp; v)
-        : vm(v)
-#if ENABLE(STREAMS_API)
-        , m_readableStreamInternalsFunctions(vm)
-        , m_streamInternalsFunctions(vm)
-        , m_writableStreamInternalsFunctions(vm)
-#endif
</del><ins>+    explicit JSBuiltinInternalFunctions(JSC::VM&amp;);
+
</ins><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><del>-        , m_rtcPeerConnectionInternalsFunctions(vm)
</del><ins>+    RTCPeerConnectionInternalsBuiltinFunctions rtcPeerConnectionInternals() { return m_rtcPeerConnectionInternalsFunctions; }
</ins><span class="cx"> #endif
</span><del>-    { }
-
</del><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx">     ReadableStreamInternalsBuiltinFunctions readableStreamInternals() { return m_readableStreamInternalsFunctions; }
</span><span class="cx">     StreamInternalsBuiltinFunctions streamInternals() { return m_streamInternalsFunctions; }
</span><span class="cx">     WritableStreamInternalsBuiltinFunctions writableStreamInternals() { return m_writableStreamInternalsFunctions; }
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MEDIA_STREAM)
-    RTCPeerConnectionInternalsBuiltinFunctions rtcPeerConnectionInternals() { return m_rtcPeerConnectionInternalsFunctions; }
-#endif
-    void visit(JSC::SlotVisitor&amp; visitor) {
-#if ENABLE(STREAMS_API)
-        m_readableStreamInternalsFunctions.visit(visitor);
-        m_streamInternalsFunctions.visit(visitor);
-        m_writableStreamInternalsFunctions.visit(visitor);
-#endif
-#if ENABLE(MEDIA_STREAM)
-        m_rtcPeerConnectionInternalsFunctions.visit(visitor);
-#endif
-#ifndef SKIP_UNUSED_PARAM
-        UNUSED_PARAM(visitor);
-#endif
-    }
-    void init(JSC::JSGlobalObject&amp; globalObject) {
-#if ENABLE(STREAMS_API)
-        m_readableStreamInternalsFunctions.init(globalObject);
-        m_streamInternalsFunctions.init(globalObject);
-        m_writableStreamInternalsFunctions.init(globalObject);
-#endif
-#if ENABLE(MEDIA_STREAM)
-        m_rtcPeerConnectionInternalsFunctions.init(globalObject);
-#endif
-#ifndef SKIP_UNUSED_PARAM
-        UNUSED_PARAM(globalObject);
-#endif
-    }
</del><span class="cx"> 
</span><ins>+    void visit(JSC::SlotVisitor&amp;);
+    void initialize(JSDOMGlobalObject&amp;, JSC::VM&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     JSC::VM&amp; vm;
</span><ins>+#if ENABLE(MEDIA_STREAM)
+    RTCPeerConnectionInternalsBuiltinFunctions m_rtcPeerConnectionInternalsFunctions;
+#endif
</ins><span class="cx"> #if ENABLE(STREAMS_API)
</span><span class="cx">     ReadableStreamInternalsBuiltinFunctions m_readableStreamInternalsFunctions;
</span><span class="cx">     StreamInternalsBuiltinFunctions m_streamInternalsFunctions;
</span><span class="cx">     WritableStreamInternalsBuiltinFunctions m_writableStreamInternalsFunctions;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MEDIA_STREAM)
-    RTCPeerConnectionInternalsBuiltinFunctions m_rtcPeerConnectionInternalsFunctions;
-#endif
</del><span class="cx"> 
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-#endif
</del><ins>+
+#endif // WebCoreJSBuiltinInternals_h
</ins></span></pre>
</div>
</div>

</body>
</html>