WebKit Bugzilla
Attachment 357689 Details for
Bug 192838
: Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192838-20181219101024.patch (text/plain), 38.58 KB, created by
youenn fablet
on 2018-12-19 10:10:27 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-12-19 10:10:27 PST
Size:
38.58 KB
patch
obsolete
>Subversion Revision: 239107 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index a3e93630712e2b340a8df62b882ecbdcf131ac59..6f51ba579960f90bdbf57d5bc5c8c19986458247 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,56 @@ >+2018-12-19 Youenn Fablet <youenn@apple.com> >+ >+ Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader >+ https://bugs.webkit.org/show_bug.cgi?id=192838 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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-17 Youenn Fablet <youenn@apple.com> > > Make ReadableStreamXX constructs use PrivateIdentifier >diff --git a/Source/WebCore/Modules/streams/ReadableByteStreamController.idl b/Source/WebCore/Modules/streams/ReadableByteStreamController.idl >index e836cad108e436b87981147e639646c780ca6111..002c1affbed06ac2e5c86a37ef1934b1802793a7 100644 >--- a/Source/WebCore/Modules/streams/ReadableByteStreamController.idl >+++ b/Source/WebCore/Modules/streams/ReadableByteStreamController.idl >@@ -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 >diff --git a/Source/WebCore/Modules/streams/ReadableByteStreamController.js b/Source/WebCore/Modules/streams/ReadableByteStreamController.js >index 8bbf31b1872984f928e1cbe8664a7e471c7690c8..24ee76d5bf6dd3739ac78118b03883d3f623248d 100644 >--- a/Source/WebCore/Modules/streams/ReadableByteStreamController.js >+++ b/Source/WebCore/Modules/streams/ReadableByteStreamController.js >@@ -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 @@ function byobRequest() > 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"); >diff --git a/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js b/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js >index 411098b34863a50e93bf8ca8cc5c7a627a0844e6..a686be479bda5ba9d58c59c3ed043311ff194e5e 100644 >--- a/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js >+++ b/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js >@@ -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"; >diff --git a/Source/WebCore/Modules/streams/ReadableStream.js b/Source/WebCore/Modules/streams/ReadableStream.js >index 3376cd4e6926b559e26a27deaf1303659134a74b..068fe24cabe5ce85178900e778849869b2b40ac6 100644 >--- a/Source/WebCore/Modules/streams/ReadableStream.js >+++ b/Source/WebCore/Modules/streams/ReadableStream.js >@@ -61,11 +61,11 @@ function initializeReadableStream(underlyingSource, strategy) > @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"); > >diff --git a/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl b/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl >index 35d1fbd9cd2774945a12483e4b09e1c5f0ac9279..4b1a5224b759416e6baee1e007f332724022d3ef 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl >+++ b/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl >@@ -26,7 +26,8 @@ > > [ > Conditional=STREAMS_API, >- CustomConstructor(ReadableStream stream), >+ Constructor(ReadableStream stream), >+ Exposed=(Window,Worker), > JSBuiltin, > PrivateIdentifier > ] interface ReadableStreamBYOBReader { >diff --git a/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js b/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js >index 68bcafb191d58dd98815652e1309d113a99f4c95..e3b432d275c4cd1d7bf859ccae74ee964a3f5d36 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js >@@ -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"; >diff --git a/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl b/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl >index 0897188fc0b1b67c66a5c8a50f5b708398686171..bb67065e8bbfaf3db2b2b4ab6186ecbe5eb0aeee 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl >+++ b/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl >@@ -28,7 +28,8 @@ > > [ > Conditional=STREAMS_API, >- CustomConstructor(ReadableByteStreamController controller, TypedArray view), >+ Constructor(ReadableByteStreamController controller, TypedArray view), >+ Exposed=(Window,Worker), > JSBuiltin, > PrivateIdentifier > ] interface ReadableStreamBYOBRequest { >diff --git a/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js b/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js >index 38731602d7cb8ac180f08f91e41b3194fe265d08..009a0a57adc82a97e348ca37a609c1dfdc0cd470 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.js >@@ -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"; >diff --git a/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl b/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl >index 77a38865aabcd0f152d8bcaf1e18e76e3fb140be..14c04226b4a2a4b79eac3031c05fd1a3e2005e32 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl >+++ b/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl >@@ -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 { >diff --git a/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js b/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js >index a373fadb74b063205dc7fcf005f499a2c56a72da..930db712aeea9494d4914a48ee5789b629363e0a 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamDefaultController.js >@@ -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"; >diff --git a/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl b/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl >index ae600ba9ef280ee7e225a2ae9c8c619fabcaecc8..1fa2b7900f2bb30e3f28a2d9f3a72b0c15b2735b 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl >+++ b/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl >@@ -29,7 +29,8 @@ > > [ > Conditional=STREAMS_API, >- CustomConstructor(ReadableStream stream), >+ Constructor(ReadableStream stream), >+ Exposed=(Window,Worker), > JSBuiltin, > PrivateIdentifier > ] interface ReadableStreamDefaultReader { >diff --git a/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js b/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js >index db16ab5fc6ae6f6e20bee900653119db7b8a3f77..da75a3f629a41ac8489cce9fdb2eceeea7f2f03b 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js >@@ -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"; >diff --git a/Source/WebCore/Modules/streams/ReadableStreamInternals.js b/Source/WebCore/Modules/streams/ReadableStreamInternals.js >index 95aa75b504da5c4d1d2542a4cff87a58679d7a7e..51f01987185b99a0b3d7b2a1b21eefbe912e4d95 100644 >--- a/Source/WebCore/Modules/streams/ReadableStreamInternals.js >+++ b/Source/WebCore/Modules/streams/ReadableStreamInternals.js >@@ -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"; >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 9373a256ef1121cc42cd01b078aceb004dd81452..3b24fcf77561bceba23d5152c3d8d338c4370d5d 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -464,7 +464,6 @@ bindings/js/JSPerformanceObserverCustom.cpp > 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 >diff --git a/Source/WebCore/UnifiedSources-input.xcfilelist b/Source/WebCore/UnifiedSources-input.xcfilelist >index 5712b95fd659b438ac74d6b94d48000a82c37068..dfc2a3c29529a4146448ec8c3b5bcee081411730 100644 >--- a/Source/WebCore/UnifiedSources-input.xcfilelist >+++ b/Source/WebCore/UnifiedSources-input.xcfilelist >@@ -1393,7 +1393,6 @@ $(SRCROOT)/bindings/js/JSPerformanceObserverCustom.cpp > $(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 >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index dbcb4a7ee2e67cf0c3bfca958d35c8b1e4f60150..dfef9fec52fd27ee105cd500881c8dcafc2aae47 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -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 */; }; >@@ -7242,8 +7241,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>"; }; >@@ -24525,8 +24522,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 */, >@@ -29656,7 +29651,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 */, >diff --git a/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp b/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp >index 765eedcc245512d559de29146e5df8fae4e3688a..a2eb7b60ec14c4443fc09d8367710f75a6fa408d 100644 >--- a/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp >+++ b/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp >@@ -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 @@ void JSDOMGlobalObject::addBuiltinGlobals(VM& vm) > { > 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 @@ void JSDOMGlobalObject::addBuiltinGlobals(VM& vm) > 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 > }; >diff --git a/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp b/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp >deleted file mode 100644 >index f50cd273b60ed0c2cd7174c3c3416530a910a214..0000000000000000000000000000000000000000 >--- a/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp >+++ /dev/null >@@ -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 <JavaScriptCore/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 >diff --git a/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h b/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h >deleted file mode 100644 >index 5a28a23955323c55e2634878f85d538d9f1fb09d..0000000000000000000000000000000000000000 >--- a/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.h >+++ /dev/null >@@ -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) >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index cb90174a0948f5b11991e66bac2208280c6491b8..8307284d6aa58a562ec14fdfa780062bcc591c0b 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -3057,6 +3057,7 @@ sub GeneratePropertiesHashTable > 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)) { >diff --git a/Source/WebCore/bindings/scripts/preprocess-idls.pl b/Source/WebCore/bindings/scripts/preprocess-idls.pl >index 7faf409be834194488e0c7f6ca5480b09f3a1e50..fe1164d9899bafbb5fa1d247de25291c6e604b99 100644 >--- a/Source/WebCore/bindings/scripts/preprocess-idls.pl >+++ b/Source/WebCore/bindings/scripts/preprocess-idls.pl >@@ -408,7 +408,5 @@ sub shouldExposeInterface > { > my $extendedAttributes = shift; > >- return 0 if $extendedAttributes->{"NoInterfaceObject"}; >- return 0 if $extendedAttributes->{"PrivateIdentifier"} && !($extendedAttributes->{"PublicIdentifier"}); >- return 1; >+ return !$extendedAttributes->{"NoInterfaceObject"}; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192838
:
357686
| 357689