Changeset 279443 in webkit


Ignore:
Timestamp:
Jun 30, 2021, 4:53:16 PM (4 years ago)
Author:
rniwa@webkit.org
Message:

RemotePlayback must keep its media element alive when there is a pending activity
https://bugs.webkit.org/show_bug.cgi?id=227471
<rdar://79694015>

Reviewed by Geoffrey Garen.

Source/WebCore:

Fixed the bug that the media element's JS wrapper can be collected while there is still
a pending activity for RemotePlayback. In fact, the newly added test demonstrates that
the media element can be deleted without this patch.

This patch also introduces new extended IDL interface attribute GenerateAddOpaqueRoot
to make adding an opaque root as a part of visitChildren easy in the DOM code.

Test: media/remoteplayback-watch-availability-gc.html

  • Modules/remoteplayback/RemotePlayback.cpp:

(WebCore::RemotePlayback::ownerNode const):

  • Modules/remoteplayback/RemotePlayback.h:
  • Modules/remoteplayback/RemotePlayback.idl:
  • bindings/scripts/CodeGeneratorJS.pm:

(InstanceNeedsVisitChildren):
(GenerateImplementation):

  • bindings/scripts/IDLAttributes.json:
  • bindings/scripts/test/BindingTestGlobalConstructors.idl:
  • bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp: Added.

(WebCore::JSTestGenerateAddOpaqueRootDOMConstructor::prototypeForStructure):
(WebCore::JSTestGenerateAddOpaqueRootDOMConstructor::initializeProperties):
(WebCore::JSTestGenerateAddOpaqueRootPrototype::finishCreation):
(WebCore::JSTestGenerateAddOpaqueRoot::JSTestGenerateAddOpaqueRoot):
(WebCore::JSTestGenerateAddOpaqueRoot::finishCreation):
(WebCore::JSTestGenerateAddOpaqueRoot::createPrototype):
(WebCore::JSTestGenerateAddOpaqueRoot::prototype):
(WebCore::JSTestGenerateAddOpaqueRoot::getConstructor):
(WebCore::JSTestGenerateAddOpaqueRoot::destroy):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):
(WebCore::jsTestGenerateAddOpaqueRoot_someAttributeGetter):
(WebCore::JSTestGenerateAddOpaqueRoot::subspaceForImpl):
(WebCore::JSTestGenerateAddOpaqueRoot::visitChildrenImpl):
(WebCore::JSTestGenerateAddOpaqueRoot::analyzeHeap):
(WebCore::JSTestGenerateAddOpaqueRootOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestGenerateAddOpaqueRootOwner::finalize):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSTestGenerateAddOpaqueRoot::toWrapped):

  • bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.h: Added.

(WebCore::JSTestGenerateAddOpaqueRoot::create):
(WebCore::JSTestGenerateAddOpaqueRoot::createStructure):
(WebCore::JSTestGenerateAddOpaqueRoot::subspaceFor):
(WebCore::wrapperOwner):
(WebCore::wrapperKey):
(WebCore::toJS):
(WebCore::toJSNewlyCreated):

  • bindings/scripts/test/JS/JSTestGlobalObject.cpp:

(WebCore::jsTestGlobalObject_TestGenerateAddOpaqueRootConstructorGetter):
(WebCore::JSC_DEFINE_CUSTOM_GETTER):

  • bindings/scripts/test/SupplementalDependencies.dep:
  • bindings/scripts/test/TestGenerateAddOpaqueRoot.idl: Added.
  • testing/Internals.cpp:

(WebCore::Internals::isElementAlive const):
(WebCore::Internals::mediaElementCount):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

Added a GC test.

  • media/remoteplayback-watch-availability-gc-expected.txt: Added.
  • media/remoteplayback-watch-availability-gc.html: Added.
Location:
trunk
Files:
5 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r279437 r279443  
     12021-06-30  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        RemotePlayback must keep its media element alive when there is a pending activity
     4        https://bugs.webkit.org/show_bug.cgi?id=227471
     5        <rdar://79694015>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Added a GC test.
     10
     11        * media/remoteplayback-watch-availability-gc-expected.txt: Added.
     12        * media/remoteplayback-watch-availability-gc.html: Added.
     13
    1142021-06-30  Ayumi Kojima  <ayumi_kojima@apple.com>
    215
  • trunk/Source/WebCore/ChangeLog

    r279442 r279443  
     12021-06-30  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        RemotePlayback must keep its media element alive when there is a pending activity
     4        https://bugs.webkit.org/show_bug.cgi?id=227471
     5        <rdar://79694015>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Fixed the bug that the media element's JS wrapper can be collected while there is still
     10        a pending activity for RemotePlayback. In fact, the newly added test demonstrates that
     11        the media element can be deleted without this patch.
     12
     13        This patch also introduces new extended IDL interface attribute GenerateAddOpaqueRoot
     14        to make adding an opaque root as a part of visitChildren easy in the DOM code.
     15
     16        Test: media/remoteplayback-watch-availability-gc.html
     17
     18        * Modules/remoteplayback/RemotePlayback.cpp:
     19        (WebCore::RemotePlayback::ownerNode const):
     20        * Modules/remoteplayback/RemotePlayback.h:
     21        * Modules/remoteplayback/RemotePlayback.idl:
     22        * bindings/scripts/CodeGeneratorJS.pm:
     23        (InstanceNeedsVisitChildren):
     24        (GenerateImplementation):
     25        * bindings/scripts/IDLAttributes.json:
     26        * bindings/scripts/test/BindingTestGlobalConstructors.idl:
     27        * bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.cpp: Added.
     28        (WebCore::JSTestGenerateAddOpaqueRootDOMConstructor::prototypeForStructure):
     29        (WebCore::JSTestGenerateAddOpaqueRootDOMConstructor::initializeProperties):
     30        (WebCore::JSTestGenerateAddOpaqueRootPrototype::finishCreation):
     31        (WebCore::JSTestGenerateAddOpaqueRoot::JSTestGenerateAddOpaqueRoot):
     32        (WebCore::JSTestGenerateAddOpaqueRoot::finishCreation):
     33        (WebCore::JSTestGenerateAddOpaqueRoot::createPrototype):
     34        (WebCore::JSTestGenerateAddOpaqueRoot::prototype):
     35        (WebCore::JSTestGenerateAddOpaqueRoot::getConstructor):
     36        (WebCore::JSTestGenerateAddOpaqueRoot::destroy):
     37        (WebCore::JSC_DEFINE_CUSTOM_GETTER):
     38        (WebCore::jsTestGenerateAddOpaqueRoot_someAttributeGetter):
     39        (WebCore::JSTestGenerateAddOpaqueRoot::subspaceForImpl):
     40        (WebCore::JSTestGenerateAddOpaqueRoot::visitChildrenImpl):
     41        (WebCore::JSTestGenerateAddOpaqueRoot::analyzeHeap):
     42        (WebCore::JSTestGenerateAddOpaqueRootOwner::isReachableFromOpaqueRoots):
     43        (WebCore::JSTestGenerateAddOpaqueRootOwner::finalize):
     44        (WebCore::toJSNewlyCreated):
     45        (WebCore::toJS):
     46        (WebCore::JSTestGenerateAddOpaqueRoot::toWrapped):
     47        * bindings/scripts/test/JS/JSTestGenerateAddOpaqueRoot.h: Added.
     48        (WebCore::JSTestGenerateAddOpaqueRoot::create):
     49        (WebCore::JSTestGenerateAddOpaqueRoot::createStructure):
     50        (WebCore::JSTestGenerateAddOpaqueRoot::subspaceFor):
     51        (WebCore::wrapperOwner):
     52        (WebCore::wrapperKey):
     53        (WebCore::toJS):
     54        (WebCore::toJSNewlyCreated):
     55        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
     56        (WebCore::jsTestGlobalObject_TestGenerateAddOpaqueRootConstructorGetter):
     57        (WebCore::JSC_DEFINE_CUSTOM_GETTER):
     58        * bindings/scripts/test/SupplementalDependencies.dep:
     59        * bindings/scripts/test/TestGenerateAddOpaqueRoot.idl: Added.
     60        * testing/Internals.cpp:
     61        (WebCore::Internals::isElementAlive const):
     62        (WebCore::Internals::mediaElementCount):
     63        * testing/Internals.h:
     64        * testing/Internals.idl:
     65
    1662021-06-30  Alex Christensen  <achristensen@webkit.org>
    267
  • trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.cpp

    r278538 r279443  
    5959}
    6060
     61void* RemotePlayback::opaqueRootConcurrently() const
     62{
     63    if (auto* element = m_mediaElement.get())
     64        return element->opaqueRoot();
     65    return nullptr;
     66}
     67
     68Node* RemotePlayback::ownerNode() const
     69{
     70    return m_mediaElement.get();
     71}
     72
    6173void RemotePlayback::watchAvailability(Ref<RemotePlaybackAvailabilityCallback>&& callback, Ref<DeferredPromise>&& promise)
    6274{
  • trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.h

    r278538 r279443  
    6969    using RefCounted::deref;
    7070
     71    void* opaqueRootConcurrently() const;
     72    Node* ownerNode() const;
     73
    7174private:
    7275    explicit RemotePlayback(HTMLMediaElement&);
  • trunk/Source/WebCore/Modules/remoteplayback/RemotePlayback.idl

    r267813 r279443  
    3535    Conditional=WIRELESS_PLAYBACK_TARGET,
    3636    EnabledBySetting=RemotePlayback,
    37     Exposed=Window
     37    Exposed=Window,
     38    GenerateIsReachable=ImplOwnerNodeRoot,
     39    GenerateAddOpaqueRoot=opaqueRootConcurrently
    3840] interface RemotePlayback : EventTarget {
    3941    Promise<long> watchAvailability(RemotePlaybackAvailabilityCallback callback);
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r278802 r279443  
    21962196
    21972197    return 1 if $interface->extendedAttributes->{JSCustomMarkFunction};
     2198    return 1 if $interface->extendedAttributes->{GenerateAddOpaqueRoot};
    21982199    return 1 if $interface->extendedAttributes->{Plugin};
    21992200    return 1 if $interface->extendedAttributes->{ReportExtraMemoryCost};
     
    48874888            push(@implContent, "    thisObject->wrapped().pluginReplacementScriptObject().visit(visitor);\n");
    48884889            push(@implContent, "#endif\n");
     4890        }
     4891        if ($interface->extendedAttributes->{GenerateAddOpaqueRoot}) {
     4892            my $functionName = $interface->extendedAttributes->{GenerateAddOpaqueRoot};
     4893            push(@implContent, "    visitor.addOpaqueRoot(thisObject->wrapped().${functionName}());\n");
    48894894        }
    48904895        if ($interface->extendedAttributes->{ReportExtraMemoryCost}) {
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.json

    r277830 r279443  
    224224            "values": ["", "Impl", "ImplWebGLRenderingContext", "ImplCanvasBase", "ImplDocument", "ImplElementRoot", "ImplOwnerNodeRoot", "ImplScriptExecutionContext", "ReachableFromDOMWindow", "ReachableFromNavigator"]
    225225        },
     226        "GenerateAddOpaqueRoot": {
     227            "contextsAllowed": ["interface"],
     228            "values": ["*"]
     229        },
    226230        "Global": {
    227231            "contextsAllowed": ["interface"],
  • trunk/Source/WebCore/bindings/scripts/test/BindingTestGlobalConstructors.idl

    r276656 r279443  
    1414    attribute TestEventTargetConstructor TestEventTarget;
    1515    attribute TestExceptionConstructor TestException;
     16    attribute TestGenerateAddOpaqueRootConstructor TestGenerateAddOpaqueRoot;
    1617    attribute TestGenerateIsReachableConstructor TestGenerateIsReachable;
    1718    attribute TestGlobalObjectConstructor TestGlobalObject;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp

    r278802 r279443  
    5454#include "JSTestEventTarget.h"
    5555#include "JSTestException.h"
     56#include "JSTestGenerateAddOpaqueRoot.h"
    5657#include "JSTestGenerateIsReachable.h"
    5758#include "JSTestGlobalObject.h"
     
    184185static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestEventTargetConstructor);
    185186static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestExceptionConstructor);
     187static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestGenerateAddOpaqueRootConstructor);
    186188static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestGenerateIsReachableConstructor);
    187189static JSC_DECLARE_CUSTOM_GETTER(jsTestGlobalObject_TestGlobalObjectConstructor);
     
    242244/* Hash table */
    243245
    244 static const struct CompactHashIndex JSTestGlobalObjectTableIndex[267] = {
    245     { -1, -1 },
    246     { 40, -1 },
     246static const struct CompactHashIndex JSTestGlobalObjectTableIndex[268] = {
     247    { -1, -1 },
     248    { 41, -1 },
    247249    { -1, -1 },
    248250    { 0, -1 },
    249251    { 4, -1 },
     252    { 45, -1 },
     253    { -1, -1 },
     254    { -1, -1 },
     255    { -1, -1 },
     256    { -1, -1 },
     257    { -1, -1 },
     258    { -1, -1 },
     259    { -1, -1 },
     260    { 55, -1 },
     261    { -1, -1 },
     262    { -1, -1 },
     263    { -1, -1 },
     264    { -1, -1 },
     265    { -1, -1 },
     266    { 49, -1 },
     267    { -1, -1 },
     268    { 64, -1 },
     269    { -1, -1 },
     270    { -1, -1 },
     271    { -1, -1 },
     272    { -1, -1 },
     273    { -1, -1 },
     274    { -1, -1 },
     275    { -1, -1 },
     276    { -1, -1 },
     277    { -1, -1 },
     278    { -1, -1 },
     279    { -1, -1 },
     280    { -1, -1 },
     281    { -1, -1 },
     282    { 35, -1 },
     283    { -1, -1 },
     284    { -1, -1 },
     285    { -1, -1 },
     286    { -1, -1 },
     287    { -1, -1 },
     288    { 67, -1 },
     289    { 13, 261 },
     290    { -1, -1 },
     291    { -1, -1 },
     292    { -1, -1 },
     293    { -1, -1 },
     294    { -1, -1 },
     295    { -1, -1 },
     296    { -1, -1 },
     297    { 39, -1 },
     298    { 20, 258 },
     299    { 6, -1 },
     300    { -1, -1 },
     301    { 46, -1 },
     302    { -1, -1 },
     303    { -1, -1 },
     304    { -1, -1 },
     305    { -1, -1 },
     306    { -1, -1 },
     307    { -1, -1 },
     308    { -1, -1 },
     309    { -1, -1 },
     310    { 37, -1 },
     311    { -1, -1 },
     312    { -1, -1 },
     313    { -1, -1 },
     314    { -1, -1 },
     315    { -1, -1 },
     316    { -1, -1 },
     317    { 22, 266 },
     318    { -1, -1 },
     319    { -1, -1 },
     320    { -1, -1 },
     321    { -1, -1 },
     322    { -1, -1 },
     323    { 5, -1 },
     324    { -1, -1 },
     325    { -1, -1 },
     326    { -1, -1 },
     327    { -1, -1 },
     328    { -1, -1 },
     329    { -1, -1 },
     330    { -1, -1 },
     331    { 30, -1 },
     332    { 57, -1 },
     333    { -1, -1 },
     334    { -1, -1 },
     335    { -1, -1 },
     336    { -1, -1 },
     337    { -1, -1 },
     338    { -1, -1 },
     339    { 9, 257 },
     340    { -1, -1 },
     341    { 59, -1 },
     342    { 19, -1 },
     343    { -1, -1 },
     344    { -1, -1 },
     345    { -1, -1 },
     346    { 18, -1 },
     347    { -1, -1 },
     348    { -1, -1 },
     349    { -1, -1 },
     350    { -1, -1 },
     351    { 36, -1 },
     352    { -1, -1 },
     353    { -1, -1 },
     354    { -1, -1 },
     355    { -1, -1 },
     356    { -1, -1 },
     357    { -1, -1 },
     358    { -1, -1 },
     359    { 24, -1 },
     360    { -1, -1 },
     361    { 2, -1 },
     362    { 38, -1 },
     363    { -1, -1 },
     364    { -1, -1 },
     365    { -1, -1 },
     366    { 21, -1 },
     367    { -1, -1 },
     368    { -1, -1 },
     369    { -1, -1 },
     370    { -1, -1 },
     371    { -1, -1 },
     372    { -1, -1 },
     373    { -1, -1 },
     374    { -1, -1 },
     375    { -1, -1 },
     376    { -1, -1 },
     377    { -1, -1 },
     378    { -1, -1 },
     379    { 28, -1 },
     380    { -1, -1 },
     381    { 43, -1 },
     382    { -1, -1 },
     383    { -1, -1 },
     384    { -1, -1 },
     385    { -1, -1 },
     386    { -1, -1 },
     387    { 54, -1 },
     388    { -1, -1 },
     389    { -1, -1 },
     390    { -1, -1 },
     391    { -1, -1 },
     392    { -1, -1 },
     393    { -1, -1 },
     394    { -1, -1 },
     395    { 48, -1 },
     396    { -1, -1 },
     397    { -1, -1 },
     398    { 10, -1 },
     399    { -1, -1 },
     400    { -1, -1 },
     401    { -1, -1 },
     402    { -1, -1 },
     403    { -1, -1 },
     404    { -1, -1 },
     405    { 65, -1 },
     406    { -1, -1 },
     407    { -1, -1 },
     408    { -1, -1 },
     409    { 27, -1 },
     410    { 32, -1 },
     411    { -1, -1 },
     412    { -1, -1 },
     413    { -1, -1 },
     414    { -1, -1 },
     415    { -1, -1 },
     416    { -1, -1 },
     417    { -1, -1 },
     418    { -1, -1 },
     419    { -1, -1 },
     420    { 15, 260 },
     421    { -1, -1 },
     422    { 60, -1 },
     423    { -1, -1 },
     424    { -1, -1 },
     425    { -1, -1 },
     426    { -1, -1 },
     427    { -1, -1 },
     428    { -1, -1 },
     429    { -1, -1 },
     430    { -1, -1 },
     431    { 34, 267 },
     432    { -1, -1 },
     433    { 16, 256 },
     434    { -1, -1 },
     435    { 63, -1 },
     436    { -1, -1 },
     437    { -1, -1 },
     438    { -1, -1 },
     439    { -1, -1 },
     440    { -1, -1 },
     441    { -1, -1 },
     442    { -1, -1 },
     443    { -1, -1 },
     444    { -1, -1 },
     445    { -1, -1 },
     446    { 12, -1 },
     447    { -1, -1 },
     448    { -1, -1 },
     449    { -1, -1 },
     450    { -1, -1 },
     451    { -1, -1 },
     452    { -1, -1 },
     453    { -1, -1 },
     454    { 47, -1 },
     455    { -1, -1 },
     456    { -1, -1 },
     457    { -1, -1 },
     458    { 11, -1 },
     459    { -1, -1 },
     460    { -1, -1 },
     461    { -1, -1 },
     462    { -1, -1 },
     463    { -1, -1 },
     464    { -1, -1 },
     465    { -1, -1 },
     466    { -1, -1 },
     467    { 58, -1 },
     468    { -1, -1 },
     469    { 1, -1 },
     470    { -1, -1 },
     471    { 8, -1 },
     472    { -1, -1 },
     473    { -1, -1 },
     474    { -1, -1 },
     475    { -1, -1 },
     476    { 50, 264 },
     477    { 7, 263 },
     478    { -1, -1 },
     479    { 61, -1 },
     480    { -1, -1 },
     481    { -1, -1 },
     482    { -1, -1 },
     483    { -1, -1 },
     484    { -1, -1 },
     485    { -1, -1 },
     486    { 14, -1 },
     487    { -1, -1 },
     488    { 25, -1 },
     489    { -1, -1 },
     490    { -1, -1 },
     491    { 31, -1 },
     492    { -1, -1 },
     493    { -1, -1 },
     494    { -1, -1 },
     495    { 3, -1 },
     496    { 52, -1 },
     497    { -1, -1 },
     498    { 53, -1 },
     499    { -1, -1 },
     500    { -1, -1 },
     501    { -1, -1 },
     502    { -1, -1 },
     503    { 17, -1 },
     504    { 23, 259 },
     505    { 26, 265 },
     506    { 29, 262 },
     507    { 33, -1 },
     508    { 40, -1 },
     509    { 42, -1 },
    250510    { 44, -1 },
    251     { -1, -1 },
    252     { -1, -1 },
    253     { -1, -1 },
    254     { -1, -1 },
    255     { -1, -1 },
    256     { -1, -1 },
    257     { -1, -1 },
    258     { 54, -1 },
    259     { -1, -1 },
    260     { -1, -1 },
    261     { -1, -1 },
    262     { -1, -1 },
    263     { -1, -1 },
    264     { 48, -1 },
    265     { -1, -1 },
    266     { 63, -1 },
    267     { -1, -1 },
    268     { -1, -1 },
    269     { -1, -1 },
    270     { -1, -1 },
    271     { -1, -1 },
    272     { -1, -1 },
    273     { -1, -1 },
    274     { -1, -1 },
    275     { -1, -1 },
    276     { -1, -1 },
    277     { -1, -1 },
    278     { -1, -1 },
    279     { -1, -1 },
    280     { 34, -1 },
    281     { -1, -1 },
    282     { -1, -1 },
    283     { -1, -1 },
    284     { -1, -1 },
    285     { -1, -1 },
     511    { 51, -1 },
     512    { 56, -1 },
     513    { 62, -1 },
    286514    { 66, -1 },
    287     { 13, 260 },
    288     { -1, -1 },
    289     { -1, -1 },
    290     { -1, -1 },
    291     { -1, -1 },
    292     { -1, -1 },
    293     { -1, -1 },
    294     { -1, -1 },
    295     { 38, -1 },
    296     { 19, 257 },
    297     { 6, -1 },
    298     { -1, -1 },
    299     { 45, -1 },
    300     { -1, -1 },
    301     { -1, -1 },
    302     { -1, -1 },
    303     { -1, -1 },
    304     { -1, -1 },
    305     { -1, -1 },
    306     { -1, -1 },
    307     { -1, -1 },
    308     { 36, -1 },
    309     { -1, -1 },
    310     { -1, -1 },
    311     { -1, -1 },
    312     { -1, -1 },
    313     { -1, -1 },
    314     { -1, -1 },
    315     { 21, 265 },
    316     { -1, -1 },
    317     { -1, -1 },
    318     { -1, -1 },
    319     { -1, -1 },
    320     { -1, -1 },
    321     { 5, -1 },
    322     { -1, -1 },
    323     { -1, -1 },
    324     { -1, -1 },
    325     { -1, -1 },
    326     { -1, -1 },
    327     { -1, -1 },
    328     { -1, -1 },
    329     { 29, -1 },
    330     { 56, -1 },
    331     { -1, -1 },
    332     { -1, -1 },
    333     { -1, -1 },
    334     { -1, -1 },
    335     { -1, -1 },
    336     { -1, -1 },
    337     { 9, 256 },
    338     { -1, -1 },
    339     { 58, -1 },
    340     { 18, -1 },
    341     { -1, -1 },
    342     { -1, -1 },
    343     { -1, -1 },
    344     { 17, -1 },
    345     { -1, -1 },
    346     { -1, -1 },
    347     { -1, -1 },
    348     { -1, -1 },
    349     { 35, -1 },
    350     { -1, -1 },
    351     { -1, -1 },
    352     { -1, -1 },
    353     { -1, -1 },
    354     { -1, -1 },
    355     { -1, -1 },
    356     { -1, -1 },
    357     { 23, -1 },
    358     { -1, -1 },
    359     { 2, -1 },
    360     { 37, -1 },
    361     { -1, -1 },
    362     { -1, -1 },
    363     { -1, -1 },
    364     { 20, -1 },
    365     { -1, -1 },
    366     { -1, -1 },
    367     { -1, -1 },
    368     { -1, -1 },
    369     { -1, -1 },
    370     { -1, -1 },
    371     { -1, -1 },
    372     { -1, -1 },
    373     { -1, -1 },
    374     { -1, -1 },
    375     { -1, -1 },
    376     { -1, -1 },
    377     { 27, -1 },
    378     { -1, -1 },
    379     { 42, -1 },
    380     { -1, -1 },
    381     { -1, -1 },
    382     { -1, -1 },
    383     { -1, -1 },
    384     { -1, -1 },
    385     { 53, -1 },
    386     { -1, -1 },
    387     { -1, -1 },
    388     { -1, -1 },
    389     { -1, -1 },
    390     { -1, -1 },
    391     { -1, -1 },
    392     { -1, -1 },
    393     { 47, -1 },
    394     { -1, -1 },
    395     { -1, -1 },
    396     { 10, -1 },
    397     { -1, -1 },
    398     { -1, -1 },
    399     { -1, -1 },
    400     { -1, -1 },
    401     { -1, -1 },
    402     { -1, -1 },
    403     { 64, -1 },
    404     { -1, -1 },
    405     { -1, -1 },
    406     { -1, -1 },
    407     { 26, -1 },
    408     { 31, -1 },
    409     { -1, -1 },
    410     { -1, -1 },
    411     { -1, -1 },
    412     { -1, -1 },
    413     { -1, -1 },
    414     { -1, -1 },
    415     { -1, -1 },
    416     { -1, -1 },
    417     { -1, -1 },
    418     { 15, 259 },
    419     { -1, -1 },
    420     { 59, -1 },
    421     { -1, -1 },
    422     { -1, -1 },
    423     { -1, -1 },
    424     { -1, -1 },
    425     { -1, -1 },
    426     { -1, -1 },
    427     { -1, -1 },
    428     { -1, -1 },
    429     { 33, 266 },
    430     { -1, -1 },
    431     { 16, -1 },
    432     { -1, -1 },
    433     { 62, -1 },
    434     { -1, -1 },
    435     { -1, -1 },
    436     { -1, -1 },
    437     { -1, -1 },
    438     { -1, -1 },
    439     { -1, -1 },
    440     { -1, -1 },
    441     { -1, -1 },
    442     { -1, -1 },
    443     { -1, -1 },
    444     { 12, -1 },
    445     { -1, -1 },
    446     { -1, -1 },
    447     { -1, -1 },
    448     { -1, -1 },
    449     { -1, -1 },
    450     { -1, -1 },
    451     { -1, -1 },
    452     { 46, -1 },
    453     { -1, -1 },
    454     { -1, -1 },
    455     { -1, -1 },
    456     { 11, -1 },
    457     { -1, -1 },
    458     { -1, -1 },
    459     { -1, -1 },
    460     { -1, -1 },
    461     { -1, -1 },
    462     { -1, -1 },
    463     { -1, -1 },
    464     { -1, -1 },
    465     { 57, -1 },
    466     { -1, -1 },
    467     { 1, -1 },
    468     { -1, -1 },
    469     { 8, -1 },
    470     { -1, -1 },
    471     { -1, -1 },
    472     { -1, -1 },
    473     { -1, -1 },
    474     { 49, 263 },
    475     { 7, 262 },
    476     { -1, -1 },
    477     { 60, -1 },
    478     { -1, -1 },
    479     { -1, -1 },
    480     { -1, -1 },
    481     { -1, -1 },
    482     { -1, -1 },
    483     { -1, -1 },
    484     { 14, -1 },
    485     { -1, -1 },
    486     { 24, -1 },
    487     { -1, -1 },
    488     { -1, -1 },
    489     { 30, -1 },
    490     { -1, -1 },
    491     { -1, -1 },
    492     { -1, -1 },
    493     { 3, -1 },
    494     { 51, -1 },
    495     { -1, -1 },
    496     { 52, -1 },
    497     { -1, -1 },
    498     { -1, -1 },
    499     { -1, -1 },
    500     { -1, -1 },
    501     { 22, 258 },
    502     { 25, 264 },
    503     { 28, 261 },
    504     { 32, -1 },
    505     { 39, -1 },
    506     { 41, -1 },
    507     { 43, -1 },
    508     { 50, -1 },
    509     { 55, -1 },
    510     { 61, -1 },
    511     { 65, -1 },
    512515};
    513516
     
    540543    { "TestEventTarget", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    541544    { "TestException", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     545    { "TestGenerateAddOpaqueRoot", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestGenerateAddOpaqueRootConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    542546    { "TestGenerateIsReachable", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestGenerateIsReachableConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
    543547    { "TestGlobalObject", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObject_TestGlobalObjectConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     
    600604};
    601605
    602 static const HashTable JSTestGlobalObjectTable = { 67, 255, true, JSTestGlobalObject::info(), JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex };
     606static const HashTable JSTestGlobalObjectTable = { 68, 255, true, JSTestGlobalObject::info(), JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex };
    603607/* Hash table for constructor */
    604608
     
    10161020{
    10171021    return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObject_TestExceptionConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
     1022}
     1023
     1024static inline JSValue jsTestGlobalObject_TestGenerateAddOpaqueRootConstructorGetter(JSGlobalObject& lexicalGlobalObject, JSTestGlobalObject& thisObject)
     1025{
     1026    UNUSED_PARAM(lexicalGlobalObject);
     1027    return JSTestGenerateAddOpaqueRoot::getConstructor(JSC::getVM(&lexicalGlobalObject), &thisObject);
     1028}
     1029
     1030JSC_DEFINE_CUSTOM_GETTER(jsTestGlobalObject_TestGenerateAddOpaqueRootConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
     1031{
     1032    return IDLAttribute<JSTestGlobalObject>::get<jsTestGlobalObject_TestGenerateAddOpaqueRootConstructorGetter>(*lexicalGlobalObject, thisValue, attributeName);
    10181033}
    10191034
  • trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep

    r276656 r279443  
    111111DOMTestException.h:
    112112WebDOMTestException.h:
     113JSTestGenerateAddOpaqueRoot.h:
     114DOMTestGenerateAddOpaqueRoot.h:
     115WebDOMTestGenerateAddOpaqueRoot.h:
    113116JSTestGenerateIsReachable.h:
    114117DOMTestGenerateIsReachable.h:
  • trunk/Source/WebCore/testing/Internals.cpp

    r279218 r279443  
    27072707}
    27082708
     2709bool Internals::isElementAlive(Document& document, uint64_t elementIdentifier) const
     2710{
     2711    return document.searchForElementByIdentifier(makeObjectIdentifier<ElementIdentifierType>(elementIdentifier));
     2712}
     2713
    27092714uint64_t Internals::frameIdentifier(const Document& document) const
    27102715{
     
    38663871#if ENABLE(VIDEO)
    38673872
     3873unsigned Internals::mediaElementCount()
     3874{
     3875    return HTMLMediaElement::allMediaElements().size();
     3876}
     3877
    38683878Vector<String> Internals::mediaResponseSources(HTMLMediaElement& media)
    38693879{
  • trunk/Source/WebCore/testing/Internals.h

    r279218 r279443  
    485485
    486486    uint64_t elementIdentifier(Element&) const;
     487    bool isElementAlive(Document&, uint64_t documentIdentifier) const;
     488
    487489    uint64_t frameIdentifier(const Document&) const;
    488490    uint64_t pageIdentifier(const Document&) const;
     
    645647
    646648#if ENABLE(VIDEO)
     649    unsigned mediaElementCount();
    647650    Vector<String> mediaResponseSources(HTMLMediaElement&);
    648651    Vector<String> mediaResponseContentRanges(HTMLMediaElement&);
  • trunk/Source/WebCore/testing/Internals.idl

    r279218 r279443  
    876876
    877877    unsigned long long elementIdentifier(Element element);
     878    [CallWith=Document] boolean isElementAlive(unsigned long long documentIdentifier);
    878879    unsigned long long frameIdentifier(Document document);
    879880    unsigned long long pageIdentifier(Document document);
Note: See TracChangeset for help on using the changeset viewer.