Title: [239472] trunk/Source/WebCore
Revision
239472
Author
[email protected]
Date
2018-12-20 16:03:29 -0800 (Thu, 20 Dec 2018)

Log Message

Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
https://bugs.webkit.org/show_bug.cgi?id=192838

Reviewed by Chris Dumez.

Generate constructor code in case of a Private but not Public constructor.
Make sure this is correctly exposed in global objects.
Add JS built-in constructor implementations for those two objects.

Also add JS built-in constructors for controller and byob request.
To keep existing behavior, JS built-ins calling these constructors need to pass
an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
In the latter case, the constructor will throw.

Covered by existing tests, no observable change of behavior.

* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableByteStreamController.js:
(initializeReadableByteStreamController):
(getter.byobRequest):
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Deleted.
(privateInitializeReadableStreamBYOBRequest): Deleted.
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
* Modules/streams/ReadableStreamBYOBReader.js:
(initializeReadableStreamBYOBReader):
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamBYOBRequest.js:
(initializeReadableStreamBYOBRequest):
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultController.js:
(initializeReadableStreamDefaultController):
(enqueue):
* Modules/streams/ReadableStreamDefaultReader.js:
(initializeReadableStreamDefaultReader):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamDefaultControllerError): Deleted.
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMBuiltinConstructor.h:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
* bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* bindings/scripts/preprocess-idls.pl:
(shouldExposeInterface):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (239471 => 239472)


--- trunk/Source/WebCore/ChangeLog	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/ChangeLog	2018-12-21 00:03:29 UTC (rev 239472)
@@ -1,3 +1,56 @@
+2018-12-20  Youenn Fablet  <[email protected]>
+
+        Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
+        https://bugs.webkit.org/show_bug.cgi?id=192838
+
+        Reviewed by Chris Dumez.
+
+        Generate constructor code in case of a Private but not Public constructor.
+        Make sure this is correctly exposed in global objects.
+        Add JS built-in constructor implementations for those two objects.
+
+        Also add JS built-in constructors for controller and byob request.
+        To keep existing behavior, JS built-ins calling these constructors need to pass
+        an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
+        In the latter case, the constructor will throw.
+
+        Covered by existing tests, no observable change of behavior.
+
+        * Modules/streams/ReadableByteStreamController.idl:
+        * Modules/streams/ReadableByteStreamController.js:
+        (initializeReadableByteStreamController):
+        (getter.byobRequest):
+        * Modules/streams/ReadableByteStreamInternals.js:
+        (privateInitializeReadableByteStreamController): Deleted.
+        (privateInitializeReadableStreamBYOBRequest): Deleted.
+        * Modules/streams/ReadableStream.js:
+        (initializeReadableStream):
+        * Modules/streams/ReadableStreamBYOBReader.js:
+        (initializeReadableStreamBYOBReader):
+        * Modules/streams/ReadableStreamBYOBRequest.idl:
+        * Modules/streams/ReadableStreamBYOBRequest.js:
+        (initializeReadableStreamBYOBRequest):
+        * Modules/streams/ReadableStreamDefaultController.idl:
+        * Modules/streams/ReadableStreamDefaultController.js:
+        (initializeReadableStreamDefaultController):
+        (enqueue):
+        * Modules/streams/ReadableStreamDefaultReader.js:
+        (initializeReadableStreamDefaultReader):
+        * Modules/streams/ReadableStreamInternals.js:
+        (readableStreamDefaultControllerError): Deleted.
+        * Sources.txt:
+        * UnifiedSources-input.xcfilelist:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMBuiltinConstructor.h:
+        * bindings/js/JSDOMGlobalObject.cpp:
+        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
+        * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
+        * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GeneratePropertiesHashTable):
+        * bindings/scripts/preprocess-idls.pl:
+        (shouldExposeInterface):
+
 2018-12-20  Jiewen Tan  <[email protected]>
 
         [WebAuthN] Remove hash from Client Data

Modified: trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.idl (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.idl	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.idl	2018-12-21 00:03:29 UTC (rev 239472)
@@ -29,7 +29,7 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor(ReadableStream stream, any underlyingByteSource, unsigned long highWaterMark),
+    Constructor(ReadableStream stream, any underlyingByteSource, unsigned long highWaterMark),
     Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier

Modified: trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -25,6 +25,16 @@
 
 // @conditional=ENABLE(STREAMS_API)
 
+function initializeReadableByteStreamController(stream, underlyingByteSource, highWaterMark)
+{
+    "use strict";
+
+    if (arguments.length !== 4 && arguments[3] !== @isReadableStream)
+        @throwTypeError("ReadableByteStreamController constructor should not be called directly");
+
+    return @privateInitializeReadableByteStreamController.@call(this, stream, underlyingByteSource, highWaterMark);
+}
+
 function enqueue(chunk)
 {
     "use strict";
@@ -89,7 +99,7 @@
         const view = new @Uint8Array(firstDescriptor.buffer,
             firstDescriptor.byteOffset + firstDescriptor.bytesFilled,
             firstDescriptor.byteLength - firstDescriptor.bytesFilled);
-        @putByIdDirectPrivate(this, "byobRequest", new @ReadableStreamBYOBRequest(this, view));
+        @putByIdDirectPrivate(this, "byobRequest", new @ReadableStreamBYOBRequest(this, view, @isReadableStream));
     }
 
     return @getByIdDirectPrivate(this, "byobRequest");

Modified: trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -26,23 +26,6 @@
 // @conditional=ENABLE(STREAMS_API)
 // @internal
 
-function privateInitializeReadableStreamBYOBReader(stream)
-{
-    "use strict";
-
-    if (!@isReadableStream(stream))
-        @throwTypeError("ReadableStreamBYOBReader needs a ReadableStream");
-    if (!@isReadableByteStreamController(@getByIdDirectPrivate(stream, "readableStreamController")))
-        @throwTypeError("ReadableStreamBYOBReader needs a ReadableByteStreamController");
-    if (@isReadableStreamLocked(stream))
-        @throwTypeError("ReadableStream is locked");
-
-    @readableStreamReaderGenericInitialize(this, stream);
-    @putByIdDirectPrivate(this, "readIntoRequests", []);
-
-    return this;
-}
-
 function privateInitializeReadableByteStreamController(stream, underlyingByteSource, highWaterMark)
 {
     "use strict";

Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStream.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -61,11 +61,11 @@
             @throwRangeError("Strategy for a ReadableByteStreamController cannot have a size");
 
         let readableByteStreamControllerConstructor = @ReadableByteStreamController;
-        @putByIdDirectPrivate(this, "readableStreamController", new @ReadableByteStreamController(this, underlyingSource, strategy.highWaterMark));
+        @putByIdDirectPrivate(this, "readableStreamController", new @ReadableByteStreamController(this, underlyingSource, strategy.highWaterMark, @isReadableStream));
     } else if (type === @undefined) {
         if (strategy.highWaterMark === @undefined)
             strategy.highWaterMark = 1;
-        @putByIdDirectPrivate(this, "readableStreamController", new @ReadableStreamDefaultController(this, underlyingSource, strategy.size, strategy.highWaterMark));
+        @putByIdDirectPrivate(this, "readableStreamController", new @ReadableStreamDefaultController(this, underlyingSource, strategy.size, strategy.highWaterMark, @isReadableStream));
     } else
         @throwRangeError("Invalid type for underlying source");
 

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl	2018-12-21 00:03:29 UTC (rev 239472)
@@ -26,7 +26,8 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor(ReadableStream stream),
+    Constructor(ReadableStream stream),
+    Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamBYOBReader {

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -24,6 +24,23 @@
 
 // @conditional=ENABLE(STREAMS_API)
 
+function initializeReadableStreamBYOBReader(stream)
+{
+    "use strict";
+
+    if (!@isReadableStream(stream))
+        @throwTypeError("ReadableStreamBYOBReader needs a ReadableStream");
+    if (!@isReadableByteStreamController(@getByIdDirectPrivate(stream, "readableStreamController")))
+        @throwTypeError("ReadableStreamBYOBReader needs a ReadableByteStreamController");
+    if (@isReadableStreamLocked(stream))
+        @throwTypeError("ReadableStream is locked");
+
+    @readableStreamReaderGenericInitialize(this, stream);
+    @putByIdDirectPrivate(this, "readIntoRequests", []);
+
+    return this;
+}
+
 function cancel(reason)
 {
     "use strict";

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl	2018-12-21 00:03:29 UTC (rev 239472)
@@ -28,7 +28,8 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor(ReadableByteStreamController controller, TypedArray view),
+    Constructor(ReadableByteStreamController controller, TypedArray view),
+    Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamBYOBRequest {

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -25,6 +25,16 @@
 
 // @conditional=ENABLE(STREAMS_API)
 
+function initializeReadableStreamBYOBRequest(controller, view)
+{
+    "use strict";
+
+    if (arguments.length !== 3 && arguments[2] !== @isReadableStream)
+        @throwTypeError("ReadableStreamBYOBRequest constructor should not be called directly");
+
+    return @privateInitializeReadableStreamBYOBRequest.@call(this, controller, view);
+}
+
 function respond(bytesWritten)
 {
     "use strict";

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl	2018-12-21 00:03:29 UTC (rev 239472)
@@ -29,7 +29,8 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor(ReadableStream stream, any underlyingSource, unsigned long size, unsigned long highWaterMark),
+    Constructor(ReadableStream stream, any underlyingSource, unsigned long size, unsigned long highWaterMark),
+    Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamDefaultController {

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -25,6 +25,16 @@
 
 // @conditional=ENABLE(STREAMS_API)
 
+function initializeReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark)
+{
+    "use strict";
+
+    if (arguments.length !== 5 && arguments[4] !== @isReadableStream)
+        @throwTypeError("ReadableStreamDefaultController constructor should not be called directly");
+
+    return @privateInitializeReadableStreamDefaultController.@call(this, stream, underlyingSource, size, highWaterMark);
+}
+
 function enqueue(chunk)
 {
     "use strict";

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl	2018-12-21 00:03:29 UTC (rev 239472)
@@ -29,7 +29,8 @@
 
 [
     Conditional=STREAMS_API,
-    CustomConstructor(ReadableStream stream),
+    Constructor(ReadableStream stream),
+    Exposed=(Window,Worker),
     JSBuiltin,
     PrivateIdentifier
 ] interface ReadableStreamDefaultReader {

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -25,6 +25,21 @@
 
 // @conditional=ENABLE(STREAMS_API)
 
+function initializeReadableStreamDefaultReader(stream)
+{
+    "use strict";
+
+    if (!@isReadableStream(stream))
+        @throwTypeError("ReadableStreamDefaultReader needs a ReadableStream");
+    if (@isReadableStreamLocked(stream))
+        @throwTypeError("ReadableStream is locked");
+
+    @readableStreamReaderGenericInitialize(this, stream);
+    @putByIdDirectPrivate(this, "readRequests", []);
+
+    return this;
+}
+
 function cancel(reason)
 {
     "use strict";

Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js (239471 => 239472)


--- trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js	2018-12-21 00:03:29 UTC (rev 239472)
@@ -27,21 +27,6 @@
 // @conditional=ENABLE(STREAMS_API)
 // @internal
 
-function privateInitializeReadableStreamDefaultReader(stream)
-{
-    "use strict";
-
-    if (!@isReadableStream(stream))
-       @throwTypeError("ReadableStreamDefaultReader needs a ReadableStream");
-    if (@isReadableStreamLocked(stream))
-       @throwTypeError("ReadableStream is locked");
-
-    @readableStreamReaderGenericInitialize(this, stream);
-    @putByIdDirectPrivate(this, "readRequests", []);
-
-    return this;
-}
-
 function readableStreamReaderGenericInitialize(reader, stream)
 {
     "use strict";

Modified: trunk/Source/WebCore/Sources.txt (239471 => 239472)


--- trunk/Source/WebCore/Sources.txt	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/Sources.txt	2018-12-21 00:03:29 UTC (rev 239472)
@@ -467,7 +467,6 @@
 bindings/js/JSPluginElementFunctions.cpp
 bindings/js/JSPopStateEventCustom.cpp
 bindings/js/JSPromiseRejectionEventCustom.cpp
-bindings/js/JSReadableStreamPrivateConstructors.cpp
 bindings/js/JSReadableStreamSourceCustom.cpp
 bindings/js/JSRemoteDOMWindowBase.cpp
 bindings/js/JSRemoteDOMWindowCustom.cpp

Modified: trunk/Source/WebCore/UnifiedSources-input.xcfilelist (239471 => 239472)


--- trunk/Source/WebCore/UnifiedSources-input.xcfilelist	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/UnifiedSources-input.xcfilelist	2018-12-21 00:03:29 UTC (rev 239472)
@@ -1393,7 +1393,6 @@
 $(SRCROOT)/bindings/js/JSPluginElementFunctions.cpp
 $(SRCROOT)/bindings/js/JSPopStateEventCustom.cpp
 $(SRCROOT)/bindings/js/JSPromiseRejectionEventCustom.cpp
-$(SRCROOT)/bindings/js/JSReadableStreamPrivateConstructors.cpp
 $(SRCROOT)/bindings/js/JSReadableStreamSourceCustom.cpp
 $(SRCROOT)/bindings/js/JSRemoteDOMWindowBase.cpp
 $(SRCROOT)/bindings/js/JSRemoteDOMWindowCustom.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (239471 => 239472)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-12-21 00:03:29 UTC (rev 239472)
@@ -1072,7 +1072,6 @@
 		4129C9A91F59C56B009D7403 /* ReadableStreamDefaultController.h in Headers */ = {isa = PBXBuildFile; fileRef = 418C395F1C8F0AAB0051C8A3 /* ReadableStreamDefaultController.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4129C9AB1F59C573009D7403 /* ReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 418C395B1C8F0A610051C8A3 /* ReadableStreamSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4129C9AF1F59CF5B009D7403 /* ReadableStreamSink.h in Headers */ = {isa = PBXBuildFile; fileRef = 4129C9801F5861C7009D7403 /* ReadableStreamSink.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		4129DF861BB5B80C00322A16 /* JSReadableStreamPrivateConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		412DE4B8219285C00075F3A7 /* RTCRtpCapabilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 412DE4B6219285BF0075F3A7 /* RTCRtpCapabilities.h */; };
 		4133CB8B20F80E9900E89B11 /* MediaStreamAudioSourceCocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4133CB8920F80E8600E89B11 /* MediaStreamAudioSourceCocoa.cpp */; };
 		41380C271F3436AC00155FDA /* DOMCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 41380C251F34369A00155FDA /* DOMCache.h */; };
@@ -7245,8 +7244,6 @@
 		4129C9801F5861C7009D7403 /* ReadableStreamSink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamSink.h; sourceTree = "<group>"; };
 		4129C9811F5861C7009D7403 /* ReadableStreamSink.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStreamSink.idl; sourceTree = "<group>"; };
 		4129C9871F58662D009D7403 /* ReadableStreamSink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamSink.cpp; sourceTree = "<group>"; };
-		4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamPrivateConstructors.cpp; sourceTree = "<group>"; };
-		4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamPrivateConstructors.h; sourceTree = "<group>"; };
 		412BA5FE218C651800365474 /* RTCPMuxPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCPMuxPolicy.h; sourceTree = "<group>"; };
 		412DE4B6219285BF0075F3A7 /* RTCRtpCapabilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RTCRtpCapabilities.h; sourceTree = "<group>"; };
 		413015D51C7B570400091C6E /* FetchResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchResponse.cpp; sourceTree = "<group>"; };
@@ -24598,8 +24595,6 @@
 				E3C9AEC92113147400419B92 /* JSMicrotaskCallback.h */,
 				93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */,
 				93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */,
-				4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */,
-				4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */,
 				46BCBBC12085008000710638 /* JSRemoteDOMWindowBase.cpp */,
 				46BCBBC02085007F00710638 /* JSRemoteDOMWindowBase.h */,
 				931AE3B81FB80EAE00F5EFB2 /* JSValueInWrappedObject.h */,
@@ -29763,7 +29758,6 @@
 				6C4C96DF1AD4483500365672 /* JSReadableStreamBYOBRequest.h in Headers */,
 				6C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultController.h in Headers */,
 				7C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultReader.h in Headers */,
-				4129DF861BB5B80C00322A16 /* JSReadableStreamPrivateConstructors.h in Headers */,
 				7F4C96DD1AD4483500365A51 /* JSReadableStreamSink.h in Headers */,
 				7E4C96DD1AD4483500365A51 /* JSReadableStreamSource.h in Headers */,
 				46C376622085177D00C73829 /* JSRemoteDOMWindow.h in Headers */,

Modified: trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (239471 => 239472)


--- trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp	2018-12-21 00:03:29 UTC (rev 239472)
@@ -37,7 +37,6 @@
 #include "JSRTCIceCandidate.h"
 #include "JSRTCSessionDescription.h"
 #include "JSReadableStream.h"
-#include "JSReadableStreamPrivateConstructors.h"
 #include "JSRemoteDOMWindow.h"
 #include "JSWorkerGlobalScope.h"
 #include "JSWorkletGlobalScope.h"
@@ -122,28 +121,6 @@
 {
     m_builtinInternalFunctions.initialize(*this);
 
-#if ENABLE(STREAMS_API)
-    JSObject* privateReadableStreamDefaultControllerConstructor = createReadableStreamDefaultControllerPrivateConstructor(vm, *this);
-    JSObject* privateReadableByteStreamControllerConstructor = createReadableByteStreamControllerPrivateConstructor(vm, *this);
-    JSObject* privateReadableStreamBYOBRequestConstructor = createReadableStreamBYOBRequestPrivateConstructor(vm, *this);
-    JSObject* privateReadableStreamDefaultReaderConstructor = createReadableStreamDefaultReaderPrivateConstructor(vm, *this);
-    JSObject* privateReadableStreamBYOBReaderConstructor = createReadableStreamBYOBReaderPrivateConstructor(vm, *this);
-
-    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamDefaultControllerConstructor->info()).get());
-    ASSERT(!constructors(NoLockingNecessary).get(privateReadableByteStreamControllerConstructor->info()).get());
-    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamBYOBRequestConstructor->info()).get());
-    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamDefaultReaderConstructor->info()).get());
-    ASSERT(!constructors(NoLockingNecessary).get(privateReadableStreamBYOBReaderConstructor->info()).get());
-    JSC::WriteBarrier<JSC::JSObject> temp;
-    {
-        auto locker = lockDuringMarking(vm.heap, m_gcLock);
-        constructors(locker).add(privateReadableStreamDefaultControllerConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamDefaultControllerConstructor);
-        constructors(locker).add(privateReadableByteStreamControllerConstructor->info(), temp).iterator->value.set(vm, this, privateReadableByteStreamControllerConstructor);
-        constructors(locker).add(privateReadableStreamBYOBRequestConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamBYOBRequestConstructor);
-        constructors(locker).add(privateReadableStreamDefaultReaderConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamDefaultReaderConstructor);
-        constructors(locker).add(privateReadableStreamBYOBReaderConstructor->info(), temp).iterator->value.set(vm, this, privateReadableStreamBYOBReaderConstructor);
-    }
-#endif
     JSVMClientData& clientData = *static_cast<JSVMClientData*>(vm.clientData);
     JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().makeThisTypeErrorPrivateName(),
@@ -164,11 +141,6 @@
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamReadablePrivateName(), jsNumber(4), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWaitingPrivateName(), jsNumber(5), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().streamWritablePrivateName(), jsNumber(6), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamDefaultControllerPrivateName(), privateReadableStreamDefaultControllerConstructor, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableByteStreamControllerPrivateName(), privateReadableByteStreamControllerConstructor, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamBYOBRequestPrivateName(), privateReadableStreamBYOBRequestConstructor, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamDefaultReaderPrivateName(), privateReadableStreamDefaultReaderConstructor, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-        JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().ReadableStreamBYOBReaderPrivateName(), privateReadableStreamBYOBReaderConstructor, PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         JSDOMGlobalObject::GlobalPropertyInfo(clientData.builtinNames().readableByteStreamAPIEnabledPrivateName(), JSFunction::create(vm, this, 0, String(), isReadableByteStreamAPIEnabled), PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
 #endif
     };

Deleted: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (239471 => 239472)


--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp	2018-12-21 00:03:29 UTC (rev 239472)
@@ -1,177 +0,0 @@
-/*
- *  Copyright (C) 2015 Canon Inc. All rights reserved.
- *  Copyright (C) 2016-2017 Apple Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "JSReadableStreamPrivateConstructors.h"
-
-#if ENABLE(STREAMS_API)
-
-#include "JSDOMBuiltinConstructor.h"
-#include "JSReadableByteStreamController.h"
-#include "JSReadableStream.h"
-#include "JSReadableStreamBYOBReader.h"
-#include "JSReadableStreamBYOBRequest.h"
-#include "JSReadableStreamDefaultController.h"
-#include "JSReadableStreamDefaultReader.h"
-#include "ReadableByteStreamInternalsBuiltins.h"
-#include "ReadableStreamInternalsBuiltins.h"
-#include "WebCoreJSClientData.h"
-#include <_javascript_Core/JSCInlines.h>
-
-namespace WebCore {
-using namespace JSC;
-
-enum class ReaderType {
-    Byob,
-    Default,
-};
-
-template <ReaderType type>
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReaderGeneric(ExecState&);
-
-// Public JS ReadableStreamDefaultController constructor callback.
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamDefaultController(ExecState& exec)
-{
-    VM& vm = exec.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    return throwVMTypeError(&exec, scope, "ReadableStreamDefaultController constructor should not be called directly"_s);
-}
-
-// Public JS ReadableStreamDefaultReader and ReadableStreamBYOBReader callbacks.
-template<ReaderType type>
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReaderGeneric(ExecState& exec)
-{
-    VM& vm = exec.vm();
-    auto& clientData = *static_cast<JSVMClientData*>(vm.clientData);
-    auto& globalObject = *JSC::jsCast<JSDOMGlobalObject*>(exec.lexicalGlobalObject());
-
-    JSC::JSObject* constructor;
-    if (type == ReaderType::Byob)
-        constructor = JSC::asObject(globalObject.get(&exec, clientData.builtinNames().ReadableStreamBYOBReaderPrivateName()));
-    else
-        constructor = JSC::asObject(globalObject.get(&exec, clientData.builtinNames().ReadableStreamDefaultReaderPrivateName()));
-
-    ConstructData constructData;
-    ConstructType constructType = constructor->methodTable(vm)->getConstructData(constructor, constructData);
-    ASSERT(constructType != ConstructType::None);
-
-    MarkedArgumentBuffer args;
-    args.append(exec.argument(0));
-    ASSERT(!args.hasOverflowed());
-    return JSValue::encode(JSC::construct(&exec, constructor, constructType, constructData, args));
-}
-
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamDefaultReader(ExecState& exec)
-{
-    return constructJSReadableStreamReaderGeneric<ReaderType::Default>(exec);
-}
-
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamBYOBReader(ExecState& exec)
-{
-    return constructJSReadableStreamReaderGeneric<ReaderType::Byob>(exec);
-}
-
-// Public JS ReadableByteStreamController and ReadableStreamBYOBRequest constructor callbacks.
-EncodedJSValue JSC_HOST_CALL constructJSReadableByteStreamController(ExecState& exec)
-{
-    VM& vm = exec.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    return throwVMTypeError(&exec, scope, "ReadableByteStreamController constructor should not be called directly"_s);
-}
-
-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamBYOBRequest(ExecState& exec)
-{
-    VM& vm = exec.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-    return throwVMTypeError(&exec, scope, "ReadableStreamBYOBRequest constructor should not be called directly"_s);
-}
-
-// Private JS ReadableStreamDefaultReader and ReadableStreamDefaultController constructors.
-using JSBuiltinReadableStreamDefaultReaderPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamDefaultReader>;
-using JSBuiltinReadableStreamDefaultControllerPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamDefaultController>;
-// Private JS ReadableByteStreamController, ReadableStreamBYOBReader and ReadableStreamBYOBRequest constructors.
-using JSBuiltinReadableByteStreamControllerPrivateConstructor = JSDOMBuiltinConstructor<JSReadableByteStreamController>;
-using JSBuiltinReadableStreamBYOBReaderPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamBYOBReader>;
-using JSBuiltinReadableStreamBYOBRequestPrivateConstructor = JSDOMBuiltinConstructor<JSReadableStreamBYOBRequest>;
-
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamDefaultReaderPrivateConstructor);
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamDefaultControllerPrivateConstructor);
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableByteStreamControllerPrivateConstructor);
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamBYOBReaderPrivateConstructor);
-STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(JSBuiltinReadableStreamBYOBRequestPrivateConstructor);
-
-template<> const ClassInfo JSBuiltinReadableStreamDefaultReaderPrivateConstructor::s_info = { "ReadableStreamDefaultReaderPrivateConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBuiltinReadableStreamDefaultReaderPrivateConstructor) };
-template<> const ClassInfo JSBuiltinReadableStreamDefaultControllerPrivateConstructor::s_info = { "ReadableStreamDefaultControllerPrivateConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBuiltinReadableStreamDefaultControllerPrivateConstructor) };
-template<> const ClassInfo JSBuiltinReadableByteStreamControllerPrivateConstructor::s_info = { "ReadableByteStreamControllerPrivateConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBuiltinReadableByteStreamControllerPrivateConstructor) };
-template<> const ClassInfo JSBuiltinReadableStreamBYOBReaderPrivateConstructor::s_info = { "ReadableStreamBYOBReaderPrivateConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBuiltinReadableStreamBYOBReaderPrivateConstructor) };
-template<> const ClassInfo JSBuiltinReadableStreamBYOBRequestPrivateConstructor::s_info = { "ReadableStreamBYOBRequestPrivateConstructor", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBuiltinReadableStreamBYOBRequestPrivateConstructor) };
-
-template<> FunctionExecutable* JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable(JSC::VM& vm)
-{
-    return readableStreamInternalsPrivateInitializeReadableStreamDefaultReaderCodeGenerator(vm);
-}
-
-template<> FunctionExecutable* JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable(JSC::VM& vm)
-{
-    return readableStreamInternalsPrivateInitializeReadableStreamDefaultControllerCodeGenerator(vm);
-}
-
-template<> FunctionExecutable* JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable(JSC::VM& vm)
-{
-    return readableByteStreamInternalsPrivateInitializeReadableByteStreamControllerCodeGenerator(vm);
-}
-
-template<> FunctionExecutable* JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable(JSC::VM& vm)
-{
-    return readableByteStreamInternalsPrivateInitializeReadableStreamBYOBReaderCodeGenerator(vm);
-}
-
-template<> FunctionExecutable* JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable(JSC::VM& vm)
-{
-    return readableByteStreamInternalsPrivateInitializeReadableStreamBYOBRequestCodeGenerator(vm);
-}
-
-JSObject* createReadableStreamDefaultReaderPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return JSBuiltinReadableStreamDefaultReaderPrivateConstructor::create(vm, JSBuiltinReadableStreamDefaultReaderPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
-}
-
-JSObject* createReadableStreamDefaultControllerPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return JSBuiltinReadableStreamDefaultControllerPrivateConstructor::create(vm, JSBuiltinReadableStreamDefaultControllerPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
-}
-
-JSObject* createReadableByteStreamControllerPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return JSBuiltinReadableByteStreamControllerPrivateConstructor::create(vm, JSBuiltinReadableByteStreamControllerPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
-}
-
-JSObject* createReadableStreamBYOBReaderPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return JSBuiltinReadableStreamBYOBReaderPrivateConstructor::create(vm, JSBuiltinReadableStreamBYOBReaderPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
-}
-
-JSObject* createReadableStreamBYOBRequestPrivateConstructor(VM& vm, JSDOMGlobalObject& globalObject)
-{
-    return JSBuiltinReadableStreamBYOBRequestPrivateConstructor::create(vm, JSBuiltinReadableStreamBYOBRequestPrivateConstructor::createStructure(vm, globalObject, globalObject.objectPrototype()), globalObject);
-}
-
-} // namespace WebCore
-
-#endif

Deleted: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h (239471 => 239472)


--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h	2018-12-21 00:03:29 UTC (rev 239472)
@@ -1,41 +0,0 @@
-/*
- *  Copyright (C) 2015 Canon Inc. All rights reserved.
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#pragma once
-
-#if ENABLE(STREAMS_API)
-
-namespace JSC {
-class JSObject;
-class VM;
-}
-
-namespace WebCore {
-
-class JSDOMGlobalObject;
-
-JSC::JSObject* createReadableStreamDefaultReaderPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
-JSC::JSObject* createReadableStreamDefaultControllerPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
-
-JSC::JSObject* createReadableByteStreamControllerPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
-JSC::JSObject* createReadableStreamBYOBReaderPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
-JSC::JSObject* createReadableStreamBYOBRequestPrivateConstructor(JSC::VM&, JSDOMGlobalObject&);
-
-} // namespace WebCore
-
-#endif // ENABLE(STREAMS_API)

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (239471 => 239472)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2018-12-21 00:03:29 UTC (rev 239472)
@@ -3057,6 +3057,7 @@
     foreach my $attribute (@attributes) {
         next if ($attribute->isStatic);
         next if AttributeShouldBeOnInstance($interface, $attribute) != $isInstance;
+        next if ($attribute->extendedAttributes->{PrivateIdentifier} and not $attribute->extendedAttributes->{PublicIdentifier});
 
         # Global objects add RuntimeEnabled attributes after creation so do not add them to the static table.
         if ($isInstance && NeedsRuntimeCheck($interface, $attribute)) {

Modified: trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl (239471 => 239472)


--- trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2018-12-20 23:55:48 UTC (rev 239471)
+++ trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl	2018-12-21 00:03:29 UTC (rev 239472)
@@ -408,7 +408,5 @@
 {
     my $extendedAttributes = shift;
 
-    return 0 if $extendedAttributes->{"NoInterfaceObject"};
-    return 0 if $extendedAttributes->{"PrivateIdentifier"} && !($extendedAttributes->{"PublicIdentifier"});
-    return 1;
+    return !$extendedAttributes->{"NoInterfaceObject"};
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to