Changeset 239349 in webkit


Ignore:
Timestamp:
Dec 18, 2018 1:41:34 PM (5 years ago)
Author:
youenn@apple.com
Message:

Make ReadableStreamXX constructs use PrivateIdentifier
https://bugs.webkit.org/show_bug.cgi?id=192771

Reviewed by Chris Dumez.

PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
Covered by existing binding tests.

  • Modules/streams/ReadableByteStreamController.idl:
  • Modules/streams/ReadableStreamBYOBReader.idl:
  • Modules/streams/ReadableStreamBYOBRequest.idl:
  • Modules/streams/ReadableStreamDefaultController.idl:
  • Modules/streams/ReadableStreamDefaultReader.idl:
  • bindings/scripts/CodeGeneratorJS.pm:

(NeedsConstructorProperty):

  • bindings/scripts/preprocess-idls.pl:

(shouldExposeInterface):

  • bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
  • bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
  • bindings/scripts/test/TestCustomConstructor.idl: Removed.
Location:
trunk/Source/WebCore
Files:
3 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239347 r239349  
     12018-12-18  Youenn Fablet  <youenn@apple.com>
     2
     3        Make ReadableStreamXX constructs use PrivateIdentifier
     4        https://bugs.webkit.org/show_bug.cgi?id=192771
     5
     6        Reviewed by Chris Dumez.
     7
     8        PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
     9        Covered by existing binding tests.
     10
     11        * Modules/streams/ReadableByteStreamController.idl:
     12        * Modules/streams/ReadableStreamBYOBReader.idl:
     13        * Modules/streams/ReadableStreamBYOBRequest.idl:
     14        * Modules/streams/ReadableStreamDefaultController.idl:
     15        * Modules/streams/ReadableStreamDefaultReader.idl:
     16        * bindings/scripts/CodeGeneratorJS.pm:
     17        (NeedsConstructorProperty):
     18        * bindings/scripts/preprocess-idls.pl:
     19        (shouldExposeInterface):
     20        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
     21        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
     22        * bindings/scripts/test/TestCustomConstructor.idl: Removed.
     23
    1242018-12-18  Zalan Bujtas  <zalan@apple.com>
    225
  • trunk/Source/WebCore/Modules/streams/ReadableByteStreamController.idl

    r220279 r239349  
    3333    Exposed=(Window,Worker),
    3434    JSBuiltin,
    35     NoInterfaceObject
     35    PrivateIdentifier
    3636] interface ReadableByteStreamController {
    3737    [NotEnumerable] void enqueue(optional any chunk);
  • trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.idl

    r220279 r239349  
    2828    Conditional=STREAMS_API,
    2929    CustomConstructor(ReadableStream stream),
    30     Exposed=(Window,Worker),
    3130    JSBuiltin,
    32     NoInterfaceObject
     31    PrivateIdentifier
    3332] interface ReadableStreamBYOBReader {
    3433    [NotEnumerable] Promise<any> read(optional any view);
  • trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.idl

    r220279 r239349  
    3030    Conditional=STREAMS_API,
    3131    CustomConstructor(ReadableByteStreamController controller, TypedArray view),
    32     Exposed=(Window,Worker),
    3332    JSBuiltin,
    34     NoInterfaceObject
     33    PrivateIdentifier
    3534] interface ReadableStreamBYOBRequest {
    3635    [NotEnumerable] void respond(optional any bytesWritten);
  • trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultController.idl

    r220279 r239349  
    3131    Conditional=STREAMS_API,
    3232    CustomConstructor(ReadableStream stream, any underlyingSource, unsigned long size, unsigned long highWaterMark),
    33     Exposed=(Window,Worker),
    3433    JSBuiltin,
    35     NoInterfaceObject
     34    PrivateIdentifier
    3635] interface ReadableStreamDefaultController {
    3736    [NotEnumerable] void enqueue(optional any chunk);
  • trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.idl

    r220279 r239349  
    3131    Conditional=STREAMS_API,
    3232    CustomConstructor(ReadableStream stream),
    33     Exposed=(Window,Worker),
    3433    JSBuiltin,
    35     NoInterfaceObject
     34    PrivateIdentifier
    3635] interface ReadableStreamDefaultReader {
    3736    [NotEnumerable] Promise<any> read();
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r239316 r239349  
    73447344    my $interface = shift;
    73457345   
    7346     # FIXME: This condition makes little sense. It should not be possible to have a constructor at all if you have
    7347     # no interface object. This seems to be only used by the ReadableStreams code.
    7348     return !$interface->extendedAttributes->{NoInterfaceObject} || $interface->extendedAttributes->{CustomConstructor};
     7346    return !$interface->extendedAttributes->{NoInterfaceObject};
    73497347}
    73507348
  • trunk/Source/WebCore/bindings/scripts/preprocess-idls.pl

    r237766 r239349  
    139139    # See https://heycam.github.io/webidl/#es-interfaces
    140140    my $extendedAttributes = getInterfaceExtendedAttributesFromIDL($idlFileContents);
    141     unless ($extendedAttributes->{"NoInterfaceObject"}) {
     141    if (shouldExposeInterface($extendedAttributes)) {
    142142        if (!isCallbackInterfaceFromIDL($idlFileContents) || interfaceHasConstantAttribute($idlFileContents)) {
    143143            my $exposedAttribute = $extendedAttributes->{"Exposed"} || "Window";
     
    404404    return $fileContents =~ /\s+const[\s\w]+=\s+[\w]+;/gs;
    405405}
     406
     407sub shouldExposeInterface
     408{
     409    my $extendedAttributes = shift;
     410
     411    return 0 if $extendedAttributes->{"NoInterfaceObject"};
     412    return 0 if $extendedAttributes->{"PrivateIdentifier"} && !($extendedAttributes->{"PublicIdentifier"});
     413    return 1;
     414}
Note: See TracChangeset for help on using the changeset viewer.