Refactor binding generator to factor JS DOM class m_impl handling
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 13:07:55 +0000 (13:07 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 13:07:55 +0000 (13:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=149660

Reviewed by Darin Adler.

Added JSDOMWrapperWithImplementation template class to move m_impl out of the binding generator.
Updated custom bindings to use impl() instead of m_impl directly.
Updated binding generator accordingly.

Covered by existing tests and binding tests.

* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::getOwnPropertyNames):
(WebCore::JSDOMStringMap::deleteProperty):
* bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapperWithImplementation::impl):
(WebCore::JSDOMWrapperWithImplementation::~JSDOMWrapperWithImplementation):
(WebCore::JSDOMWrapperWithImplementation::JSDOMWrapperWithImplementation):
(WebCore::JSDOMWrapperWithImplementation::releaseImpl):
* bindings/js/JSGeolocationCustom.cpp:
(WebCore::JSGeolocation::getCurrentPosition):
(WebCore::JSGeolocation::watchPosition):
* bindings/js/JSSQLResultSetRowListCustom.cpp:
(WebCore::JSSQLResultSetRowList::item):
* bindings/js/JSSQLTransactionCustom.cpp:
(WebCore::JSSQLTransaction::executeSql):
* bindings/js/JSStorageCustom.cpp:
(WebCore::JSStorage::deleteProperty):
(WebCore::JSStorage::getOwnPropertyNames):
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::JSSubtleCrypto::encrypt):
(WebCore::JSSubtleCrypto::decrypt):
(WebCore::JSSubtleCrypto::sign):
(WebCore::JSSubtleCrypto::verify):
(WebCore::JSSubtleCrypto::wrapKey):
(WebCore::JSSubtleCrypto::unwrapKey):
* bindings/scripts/CodeGeneratorJS.pm:
(GetParentClassName):
(GetImplClassName):
(GenerateHeader):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject):
(WebCore::JSTestActiveDOMObject::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
(WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): Deleted.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
(WebCore::JSTestCustomNamedGetter::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
(WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructor::JSTestEventConstructor):
(WebCore::jsTestEventConstructorAttr1): Deleted.
* bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::~JSTestEventConstructor):
(WebCore::JSTestEventConstructor::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::JSTestEventTarget):
(WebCore::JSTestEventTarget::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestEventTarget.h:
(WebCore::JSTestEventTarget::~JSTestEventTarget):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestException::JSTestException):
(WebCore::JSTestException::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestException.h:
(WebCore::JSTestException::~JSTestException):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable):
(WebCore::jsTestGenerateIsReachableConstructor): Deleted.
* bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
(WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
(WebCore::JSTestGenerateIsReachable::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterface::JSTestInterface):
(WebCore::JSTestInterface::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestInterface.h:
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::jsTestJSBuiltinConstructorConstructor): Deleted.
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
(WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
(WebCore::jsTestMediaQueryListListenerConstructor): Deleted.
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
(WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
(WebCore::JSTestMediaQueryListListener::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructor::JSTestNamedConstructor):
(WebCore::jsTestNamedConstructorConstructor): Deleted.
* bindings/scripts/test/JS/JSTestNamedConstructor.h:
(WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
(WebCore::JSTestNamedConstructor::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministic::JSTestNondeterministic):
(WebCore::jsTestNondeterministicNondeterministicReadonlyAttr): Deleted.
* bindings/scripts/test/JS/JSTestNondeterministic.h:
(WebCore::JSTestNondeterministic::~JSTestNondeterministic):
(WebCore::JSTestNondeterministic::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::JSTestObj):
(WebCore::JSTestObj::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore::JSTestObj::~JSTestObj):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors):
(WebCore::jsTestOverloadedConstructorsConstructor): Deleted.
* bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
(WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
(WebCore::JSTestOverloadedConstructors::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins):
(WebCore::JSTestOverrideBuiltins::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
(WebCore::JSTestOverrideBuiltins::~JSTestOverrideBuiltins):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
(WebCore::jsTestSerializedScriptValueInterfaceValue): Deleted.
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
(WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
(WebCore::JSTestSerializedScriptValueInterface::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefs::JSTestTypedefs):
(WebCore::JSTestTypedefs::getOwnPropertySlot): Deleted.
* bindings/scripts/test/JS/JSTestTypedefs.h:
(WebCore::JSTestTypedefs::~JSTestTypedefs):
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattribute::JSattribute):
(WebCore::jsattributeReadonly): Deleted.
* bindings/scripts/test/JS/JSattribute.h:
(WebCore::JSattribute::~JSattribute):
(WebCore::JSattribute::finishCreation): Deleted.
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::JSreadonly::JSreadonly):
(WebCore::jsreadonlyConstructor): Deleted.
* bindings/scripts/test/JS/JSreadonly.h:
(WebCore::JSreadonly::~JSreadonly):
(WebCore::JSreadonly::finishCreation): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMStringMapCustom.cpp
Source/WebCore/bindings/js/JSDOMWrapper.h
Source/WebCore/bindings/js/JSGeolocationCustom.cpp
Source/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp
Source/WebCore/bindings/js/JSSQLTransactionCustom.cpp
Source/WebCore/bindings/js/JSStorageCustom.cpp
Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestCustomNamedGetter.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
Source/WebCore/bindings/scripts/test/JS/JSTestException.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestException.h
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestGenerateIsReachable.h
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestMediaQueryListListener.h
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNamedConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestNondeterministic.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverloadedConstructors.h
Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestOverrideBuiltins.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.h
Source/WebCore/bindings/scripts/test/JS/JSattribute.cpp
Source/WebCore/bindings/scripts/test/JS/JSattribute.h
Source/WebCore/bindings/scripts/test/JS/JSreadonly.cpp
Source/WebCore/bindings/scripts/test/JS/JSreadonly.h

index 1136983..512dcb1 100644 (file)
@@ -1,3 +1,150 @@
+2015-10-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        Refactor binding generator to factor JS DOM class m_impl handling
+        https://bugs.webkit.org/show_bug.cgi?id=149660
+
+        Reviewed by Darin Adler.
+
+        Added JSDOMWrapperWithImplementation template class to move m_impl out of the binding generator.
+        Updated custom bindings to use impl() instead of m_impl directly.
+        Updated binding generator accordingly.
+
+        Covered by existing tests and binding tests.
+
+        * bindings/js/JSDOMStringMapCustom.cpp:
+        (WebCore::JSDOMStringMap::getOwnPropertyNames):
+        (WebCore::JSDOMStringMap::deleteProperty):
+        * bindings/js/JSDOMWrapper.h:
+        (WebCore::JSDOMWrapperWithImplementation::impl):
+        (WebCore::JSDOMWrapperWithImplementation::~JSDOMWrapperWithImplementation):
+        (WebCore::JSDOMWrapperWithImplementation::JSDOMWrapperWithImplementation):
+        (WebCore::JSDOMWrapperWithImplementation::releaseImpl):
+        * bindings/js/JSGeolocationCustom.cpp:
+        (WebCore::JSGeolocation::getCurrentPosition):
+        (WebCore::JSGeolocation::watchPosition):
+        * bindings/js/JSSQLResultSetRowListCustom.cpp:
+        (WebCore::JSSQLResultSetRowList::item):
+        * bindings/js/JSSQLTransactionCustom.cpp:
+        (WebCore::JSSQLTransaction::executeSql):
+        * bindings/js/JSStorageCustom.cpp:
+        (WebCore::JSStorage::deleteProperty):
+        (WebCore::JSStorage::getOwnPropertyNames):
+        * bindings/js/JSSubtleCryptoCustom.cpp:
+        (WebCore::JSSubtleCrypto::encrypt):
+        (WebCore::JSSubtleCrypto::decrypt):
+        (WebCore::JSSubtleCrypto::sign):
+        (WebCore::JSSubtleCrypto::verify):
+        (WebCore::JSSubtleCrypto::wrapKey):
+        (WebCore::JSSubtleCrypto::unwrapKey):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GetParentClassName):
+        (GetImplClassName):
+        (GenerateHeader):
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
+        (WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject):
+        (WebCore::JSTestActiveDOMObject::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
+        (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
+        (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): Deleted.
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
+        (WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter):
+        (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
+        (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
+        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+        (WebCore::JSTestEventConstructor::JSTestEventConstructor):
+        (WebCore::jsTestEventConstructorAttr1): Deleted.
+        * bindings/scripts/test/JS/JSTestEventConstructor.h:
+        (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
+        (WebCore::JSTestEventConstructor::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::JSTestEventTarget::JSTestEventTarget):
+        (WebCore::JSTestEventTarget::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestEventTarget.h:
+        (WebCore::JSTestEventTarget::~JSTestEventTarget):
+        * bindings/scripts/test/JS/JSTestException.cpp:
+        (WebCore::JSTestException::JSTestException):
+        (WebCore::JSTestException::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestException.h:
+        (WebCore::JSTestException::~JSTestException):
+        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
+        (WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable):
+        (WebCore::jsTestGenerateIsReachableConstructor): Deleted.
+        * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
+        (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
+        (WebCore::JSTestGenerateIsReachable::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        (WebCore::JSTestInterface::JSTestInterface):
+        (WebCore::JSTestInterface::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestInterface.h:
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
+        (WebCore::jsTestJSBuiltinConstructorConstructor): Deleted.
+        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
+        (WebCore::JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
+        (WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener):
+        (WebCore::jsTestMediaQueryListListenerConstructor): Deleted.
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
+        (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
+        (WebCore::JSTestMediaQueryListListener::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
+        (WebCore::JSTestNamedConstructor::JSTestNamedConstructor):
+        (WebCore::jsTestNamedConstructorConstructor): Deleted.
+        * bindings/scripts/test/JS/JSTestNamedConstructor.h:
+        (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
+        (WebCore::JSTestNamedConstructor::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
+        (WebCore::JSTestNondeterministic::JSTestNondeterministic):
+        (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr): Deleted.
+        * bindings/scripts/test/JS/JSTestNondeterministic.h:
+        (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
+        (WebCore::JSTestNondeterministic::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::JSTestObj::JSTestObj):
+        (WebCore::JSTestObj::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestObj.h:
+        (WebCore::JSTestObj::~JSTestObj):
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
+        (WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors):
+        (WebCore::jsTestOverloadedConstructorsConstructor): Deleted.
+        * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
+        (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
+        (WebCore::JSTestOverloadedConstructors::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
+        (WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins):
+        (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
+        (WebCore::JSTestOverrideBuiltins::~JSTestOverrideBuiltins):
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface):
+        (WebCore::jsTestSerializedScriptValueInterfaceValue): Deleted.
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
+        (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
+        (WebCore::JSTestSerializedScriptValueInterface::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::JSTestTypedefs::JSTestTypedefs):
+        (WebCore::JSTestTypedefs::getOwnPropertySlot): Deleted.
+        * bindings/scripts/test/JS/JSTestTypedefs.h:
+        (WebCore::JSTestTypedefs::~JSTestTypedefs):
+        * bindings/scripts/test/JS/JSattribute.cpp:
+        (WebCore::JSattribute::JSattribute):
+        (WebCore::jsattributeReadonly): Deleted.
+        * bindings/scripts/test/JS/JSattribute.h:
+        (WebCore::JSattribute::~JSattribute):
+        (WebCore::JSattribute::finishCreation): Deleted.
+        * bindings/scripts/test/JS/JSreadonly.cpp:
+        (WebCore::JSreadonly::JSreadonly):
+        (WebCore::jsreadonlyConstructor): Deleted.
+        * bindings/scripts/test/JS/JSreadonly.h:
+        (WebCore::JSreadonly::~JSreadonly):
+        (WebCore::JSreadonly::finishCreation): Deleted.
+
 2015-10-01  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         Fix the ARM build after r190192
index 88dc56d..9af845c 100644 (file)
@@ -52,7 +52,7 @@ void JSDOMStringMap::getOwnPropertyNames(JSObject* object, ExecState* exec, Prop
 {
     JSDOMStringMap* thisObject = jsCast<JSDOMStringMap*>(object);
     Vector<String> names;
-    thisObject->m_impl->getNames(names);
+    thisObject->impl().getNames(names);
     size_t length = names.size();
     for (size_t i = 0; i < length; ++i)
         propertyNames.add(Identifier::fromString(exec, names[i]));
@@ -65,7 +65,7 @@ bool JSDOMStringMap::deleteProperty(JSCell* cell, ExecState* exec, PropertyName
     JSDOMStringMap* thisObject = jsCast<JSDOMStringMap*>(cell);
     if (propertyName.isSymbol())
         return Base::deleteProperty(thisObject, exec, propertyName);
-    return thisObject->m_impl->deleteItem(propertyNameToString(propertyName));
+    return thisObject->impl().deleteItem(propertyNameToString(propertyName));
 }
 
 bool JSDOMStringMap::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned index)
index 8ded980..2b46770 100644 (file)
@@ -42,12 +42,28 @@ public:
 
 protected:
     JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject* globalObject) 
-        : JSDestructibleObject(globalObject->vm(), structure)
+        : Base(globalObject->vm(), structure)
     {
         ASSERT(scriptExecutionContext());
     }
 };
 
+template<typename ImplementationClass> class JSDOMWrapperWithImplementation : public JSDOMWrapper {
+public:
+    typedef JSDOMWrapper Base;
+
+    ImplementationClass& impl() const { return *m_impl; }
+    ~JSDOMWrapperWithImplementation() { std::exchange(m_impl, nullptr)->deref(); }
+
+protected:
+    JSDOMWrapperWithImplementation(JSC::Structure* structure, JSC::JSGlobalObject* globalObject, Ref<ImplementationClass>&& impl)
+        : Base(structure, globalObject)
+        , m_impl(&impl.leakRef()) { }
+
+private:
+    ImplementationClass* m_impl;
+};
+
 } // namespace WebCore
 
 #endif // JSDOMWrapper_h
index 527d213..ebc5ba7 100644 (file)
@@ -114,7 +114,7 @@ JSValue JSGeolocation::getCurrentPosition(ExecState& state)
         return jsUndefined();
     ASSERT(positionOptions);
 
-    m_impl->getCurrentPosition(positionCallback.release(), positionErrorCallback.release(), positionOptions.release());
+    impl().getCurrentPosition(positionCallback.release(), positionErrorCallback.release(), positionOptions.release());
     return jsUndefined();
 }
 
@@ -136,7 +136,7 @@ JSValue JSGeolocation::watchPosition(ExecState& state)
         return jsUndefined();
     ASSERT(positionOptions);
 
-    int watchID = m_impl->watchPosition(positionCallback.release(), positionErrorCallback.release(), positionOptions.release());
+    int watchID = impl().watchPosition(positionCallback.release(), positionErrorCallback.release(), positionOptions.release());
     return jsNumber(watchID);
 }
 
index 49a0efd..b3364d2 100644 (file)
@@ -47,17 +47,17 @@ JSValue JSSQLResultSetRowList::item(ExecState& state)
         setDOMException(&state, TYPE_MISMATCH_ERR);
         return jsUndefined();
     }
-    if (index < 0 || (unsigned)index >= m_impl->length()) {
+    if (index < 0 || (unsigned)index >= impl().length()) {
         setDOMException(&state, INDEX_SIZE_ERR);
         return jsUndefined();
     }
 
     JSObject* object = constructEmptyObject(&state);
 
-    unsigned numColumns = m_impl->columnNames().size();
+    unsigned numColumns = impl().columnNames().size();
     unsigned valuesIndex = index * numColumns;
     for (unsigned i = 0; i < numColumns; i++) {
-        const SQLValue& value = m_impl->values()[valuesIndex + i];
+        const SQLValue& value = impl().values()[valuesIndex + i];
         JSValue jsValue;
 
         switch (value.type()) {
@@ -74,7 +74,7 @@ JSValue JSSQLResultSetRowList::item(ExecState& state)
             ASSERT_NOT_REACHED();
         }
 
-        object->putDirect(state.vm(), Identifier::fromString(&state, m_impl->columnNames()[i]), jsValue, DontDelete | ReadOnly);
+        object->putDirect(state.vm(), Identifier::fromString(&state, impl().columnNames()[i]), jsValue, DontDelete | ReadOnly);
     }
 
     return object;
index 3c734a5..95a8dfc 100644 (file)
@@ -109,7 +109,7 @@ JSValue JSSQLTransaction::executeSql(ExecState& state)
     }
 
     ExceptionCode ec = 0;
-    m_impl->executeSQL(sqlStatement, sqlValues, callback.release(), errorCallback.release(), ec);
+    impl().executeSQL(sqlStatement, sqlValues, callback.release(), errorCallback.release(), ec);
     setDOMException(&state, ec);
 
     return jsUndefined();
index 9cc585b..585d724 100644 (file)
@@ -69,7 +69,7 @@ bool JSStorage::deleteProperty(JSCell* cell, ExecState* exec, PropertyName prope
         return Base::deleteProperty(thisObject, exec, propertyName);
 
     ExceptionCode ec = 0;
-    thisObject->m_impl->removeItem(propertyNameToString(propertyName), ec);
+    thisObject->impl().removeItem(propertyNameToString(propertyName), ec);
     setDOMException(exec, ec);
     return true;
 }
@@ -83,12 +83,12 @@ void JSStorage::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyN
 {
     JSStorage* thisObject = jsCast<JSStorage*>(object);
     ExceptionCode ec = 0;
-    unsigned length = thisObject->m_impl->length(ec);
+    unsigned length = thisObject->impl().length(ec);
     setDOMException(exec, ec);
     if (exec->hadException())
         return;
     for (unsigned i = 0; i < length; ++i) {
-        propertyNames.add(Identifier::fromString(exec, thisObject->m_impl->key(i, ec)));
+        propertyNames.add(Identifier::fromString(exec, thisObject->impl().key(i, ec)));
         setDOMException(exec, ec);
         if (exec->hadException())
             return;
index 68e6d56..f5ba4d3 100644 (file)
@@ -152,7 +152,7 @@ JSValue JSSubtleCrypto::encrypt(ExecState& state)
         return throwTypeError(&state);
 
     if (!key->allows(CryptoKeyUsageEncrypt)) {
-        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'encrypt'"));
+        impl().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'encrypt'"));
         setDOMException(&state, NOT_SUPPORTED_ERR);
         return jsUndefined();
     }
@@ -205,7 +205,7 @@ JSValue JSSubtleCrypto::decrypt(ExecState& state)
         return throwTypeError(&state);
 
     if (!key->allows(CryptoKeyUsageDecrypt)) {
-        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'decrypt'"));
+        impl().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'decrypt'"));
         setDOMException(&state, NOT_SUPPORTED_ERR);
         return jsUndefined();
     }
@@ -257,7 +257,7 @@ JSValue JSSubtleCrypto::sign(ExecState& state)
         return throwTypeError(&state);
 
     if (!key->allows(CryptoKeyUsageSign)) {
-        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'sign'"));
+        impl().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'sign'"));
         setDOMException(&state, NOT_SUPPORTED_ERR);
         return jsUndefined();
     }
@@ -309,7 +309,7 @@ JSValue JSSubtleCrypto::verify(ExecState& state)
         return throwTypeError(&state);
 
     if (!key->allows(CryptoKeyUsageVerify)) {
-        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'verify'"));
+        impl().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'verify'"));
         setDOMException(&state, NOT_SUPPORTED_ERR);
         return jsUndefined();
     }
@@ -646,7 +646,7 @@ JSValue JSSubtleCrypto::wrapKey(ExecState& state)
         return throwTypeError(&state);
 
     if (!wrappingKey->allows(CryptoKeyUsageWrapKey)) {
-        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'wrapKey'"));
+        impl().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'wrapKey'"));
         setDOMException(&state, NOT_SUPPORTED_ERR);
         return jsUndefined();
     }
@@ -728,7 +728,7 @@ JSValue JSSubtleCrypto::unwrapKey(ExecState& state)
         return throwTypeError(&state);
 
     if (!unwrappingKey->allows(CryptoKeyUsageUnwrapKey)) {
-        m_impl->document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'unwrapKey'"));
+        impl().document()->addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral("Key usages do not include 'unwrapKey'"));
         setDOMException(&state, NOT_SUPPORTED_ERR);
         return jsUndefined();
     }
index 62b5135..5dfac35 100644 (file)
@@ -180,7 +180,8 @@ sub GetParentClassName
     my $interface = shift;
 
     return $interface->extendedAttributes->{"JSLegacyParent"} if $interface->extendedAttributes->{"JSLegacyParent"};
-    return "JSDOMWrapper" unless $interface->parent;
+    return "JSDOMWrapper" unless NeedsImplementationClass($interface);
+    return "JSDOMWrapperWithImplementation<" . GetImplClassName($interface->name) . ">" unless $interface->parent;
     return "JS" . $interface->parent;
 }
 
@@ -840,6 +841,10 @@ sub GetImplClassName
     my $name = shift;
 
     return "DOMWindow" if $name eq "AbstractView";
+
+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($name);
+    return $svgNativeType if $svgNativeType;
+
     return $name;
 }
 
@@ -881,9 +886,7 @@ sub GenerateHeader
     $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/;
 
     my $implType = GetImplClassName($interfaceName);
-    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
-    $implType = $svgNativeType if $svgNativeType;
-
+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName);
     my $svgPropertyOrListPropertyType;
     $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType;
     $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType;
@@ -1027,7 +1030,6 @@ sub GenerateHeader
 
     if (!$hasParent) {
         push(@headerContent, "    static void destroy(JSC::JSCell*);\n");
-        push(@headerContent, "    ~${className}();\n");
     }
 
     # Class info
@@ -1188,12 +1190,7 @@ sub GenerateHeader
     }
 
     if (NeedsImplementationClass($interface)) {
-        if (!$hasParent) {
-            push(@headerContent, "    $implType& impl() const { return *m_impl; }\n");
-            push(@headerContent, "    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }\n\n");
-            push(@headerContent, "private:\n");
-            push(@headerContent, "    $implType* m_impl;\n");
-        } else {
+        if ($hasParent) {
             push(@headerContent, "    $interfaceName& impl() const\n");
             push(@headerContent, "    {\n");
             push(@headerContent, "        return static_cast<$interfaceName&>(Base::impl());\n");
@@ -2138,9 +2135,7 @@ sub GenerateImplementation
     }
     push(@implContent, ", CREATE_METHOD_TABLE($className) };\n\n");
 
-    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($implType);
-    $implType = $svgNativeType if $svgNativeType;
-
+    my ($svgPropertyType, $svgListPropertyType, $svgNativeType) = GetSVGPropertyTypes($interfaceName);
     my $svgPropertyOrListPropertyType;
     $svgPropertyOrListPropertyType = $svgPropertyType if $svgPropertyType;
     $svgPropertyOrListPropertyType = $svgListPropertyType if $svgListPropertyType;
@@ -2163,12 +2158,7 @@ sub GenerateImplementation
         push(@implContent, "    : $parentClassName(structure, globalObject) { }\n\n");
      }else {
         push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject* globalObject, Ref<$implType>&& impl)\n");
-        if ($hasParent) {
-            push(@implContent, "    : $parentClassName(structure, globalObject, WTF::move(impl))\n");
-        } else {
-            push(@implContent, "    : $parentClassName(structure, globalObject)\n");
-            push(@implContent, "    , m_impl(&impl.leakRef())\n");
-        }
+        push(@implContent, "    : $parentClassName(structure, globalObject, WTF::move(impl))\n");
         push(@implContent, "{\n");
         push(@implContent, "}\n\n");
     }
@@ -2196,13 +2186,6 @@ sub GenerateImplementation
         push(@implContent, "    ${className}* thisObject = static_cast<${className}*>(cell);\n");
         push(@implContent, "    thisObject->${className}::~${className}();\n");
         push(@implContent, "}\n\n");
-
-        push(@implContent, "${className}::~${className}()\n");
-        push(@implContent, "{\n");
-        if (NeedsImplementationClass($interface)) {
-            push(@implContent, "    releaseImpl();\n");
-        }
-        push(@implContent, "}\n\n");
     }
 
     my $hasGetter = InstanceOverridesGetOwnPropertySlot($interface);
index 9ff0933..a168088 100644 (file)
@@ -139,8 +139,7 @@ void JSTestActiveDOMObjectPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestActiveDOMObject::s_info = { "TestActiveDOMObject", &Base::s_info, &JSTestActiveDOMObjectTable, CREATE_METHOD_TABLE(JSTestActiveDOMObject) };
 
 JSTestActiveDOMObject::JSTestActiveDOMObject(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestActiveDOMObject>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestActiveDOMObject>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -160,11 +159,6 @@ void JSTestActiveDOMObject::destroy(JSC::JSCell* cell)
     thisObject->JSTestActiveDOMObject::~JSTestActiveDOMObject();
 }
 
-JSTestActiveDOMObject::~JSTestActiveDOMObject()
-{
-    releaseImpl();
-}
-
 bool JSTestActiveDOMObject::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestActiveDOMObject*>(object);
index 8c95887..24cc561 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestActiveDOMObject : public JSDOMWrapper {
+class JSTestActiveDOMObject : public JSDOMWrapperWithImplementation<TestActiveDOMObject> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestActiveDOMObject> Base;
     static JSTestActiveDOMObject* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestActiveDOMObject>&& impl)
     {
         JSTestActiveDOMObject* ptr = new (NotNull, JSC::allocateCell<JSTestActiveDOMObject>(globalObject->vm().heap)) JSTestActiveDOMObject(structure, globalObject, WTF::move(impl));
@@ -42,7 +42,6 @@ public:
     static TestActiveDOMObject* toWrapped(JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestActiveDOMObject();
 
     DECLARE_INFO;
 
@@ -52,11 +51,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestActiveDOMObject& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestActiveDOMObject* m_impl;
 public:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
index 03030c0..3c1e883 100644 (file)
@@ -119,8 +119,7 @@ void JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation(VM& v
 const ClassInfo JSTestCustomConstructorWithNoInterfaceObject::s_info = { "TestCustomConstructorWithNoInterfaceObject", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCustomConstructorWithNoInterfaceObject) };
 
 JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestCustomConstructorWithNoInterfaceObject>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestCustomConstructorWithNoInterfaceObject>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -140,11 +139,6 @@ void JSTestCustomConstructorWithNoInterfaceObject::destroy(JSC::JSCell* cell)
     thisObject->JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject();
 }
 
-JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestCustomConstructorWithNoInterfaceObjectConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSTestCustomConstructorWithNoInterfaceObjectPrototype* domObject = jsDynamicCast<JSTestCustomConstructorWithNoInterfaceObjectPrototype*>(baseValue);
index 0d239af..8f4f0a6 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestCustomConstructorWithNoInterfaceObject : public JSDOMWrapper {
+class JSTestCustomConstructorWithNoInterfaceObject : public JSDOMWrapperWithImplementation<TestCustomConstructorWithNoInterfaceObject> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestCustomConstructorWithNoInterfaceObject> Base;
     static JSTestCustomConstructorWithNoInterfaceObject* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestCustomConstructorWithNoInterfaceObject>&& impl)
     {
         JSTestCustomConstructorWithNoInterfaceObject* ptr = new (NotNull, JSC::allocateCell<JSTestCustomConstructorWithNoInterfaceObject>(globalObject->vm().heap)) JSTestCustomConstructorWithNoInterfaceObject(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestCustomConstructorWithNoInterfaceObject* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestCustomConstructorWithNoInterfaceObject();
 
     DECLARE_INFO;
 
@@ -50,11 +49,6 @@ public:
         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
     }
 
-    TestCustomConstructorWithNoInterfaceObject& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestCustomConstructorWithNoInterfaceObject* m_impl;
 protected:
     JSTestCustomConstructorWithNoInterfaceObject(JSC::Structure*, JSDOMGlobalObject*, Ref<TestCustomConstructorWithNoInterfaceObject>&&);
 
index b5e854d..6d25338 100644 (file)
@@ -133,8 +133,7 @@ void JSTestCustomNamedGetterPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestCustomNamedGetter::s_info = { "TestCustomNamedGetter", &Base::s_info, &JSTestCustomNamedGetterTable, CREATE_METHOD_TABLE(JSTestCustomNamedGetter) };
 
 JSTestCustomNamedGetter::JSTestCustomNamedGetter(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestCustomNamedGetter>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestCustomNamedGetter>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -154,11 +153,6 @@ void JSTestCustomNamedGetter::destroy(JSC::JSCell* cell)
     thisObject->JSTestCustomNamedGetter::~JSTestCustomNamedGetter();
 }
 
-JSTestCustomNamedGetter::~JSTestCustomNamedGetter()
-{
-    releaseImpl();
-}
-
 bool JSTestCustomNamedGetter::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestCustomNamedGetter*>(object);
index 24c080b..6b4d9f9 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestCustomNamedGetter : public JSDOMWrapper {
+class JSTestCustomNamedGetter : public JSDOMWrapperWithImplementation<TestCustomNamedGetter> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestCustomNamedGetter> Base;
     static JSTestCustomNamedGetter* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestCustomNamedGetter>&& impl)
     {
         JSTestCustomNamedGetter* ptr = new (NotNull, JSC::allocateCell<JSTestCustomNamedGetter>(globalObject->vm().heap)) JSTestCustomNamedGetter(structure, globalObject, WTF::move(impl));
@@ -43,7 +43,6 @@ public:
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestCustomNamedGetter();
 
     DECLARE_INFO;
 
@@ -53,11 +52,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestCustomNamedGetter& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestCustomNamedGetter* m_impl;
 public:
     static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
index b870fd5..f6a3c61 100644 (file)
@@ -170,8 +170,7 @@ void JSTestEventConstructorPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestEventConstructor::s_info = { "TestEventConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestEventConstructor) };
 
 JSTestEventConstructor::JSTestEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestEventConstructor>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestEventConstructor>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -191,11 +190,6 @@ void JSTestEventConstructor::destroy(JSC::JSCell* cell)
     thisObject->JSTestEventConstructor::~JSTestEventConstructor();
 }
 
-JSTestEventConstructor::~JSTestEventConstructor()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestEventConstructorAttr1(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
 {
     UNUSED_PARAM(state);
index 3f1db26..dc728e5 100644 (file)
@@ -29,9 +29,9 @@ namespace WebCore {
 
 class JSDictionary;
 
-class JSTestEventConstructor : public JSDOMWrapper {
+class JSTestEventConstructor : public JSDOMWrapperWithImplementation<TestEventConstructor> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestEventConstructor> Base;
     static JSTestEventConstructor* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestEventConstructor>&& impl)
     {
         JSTestEventConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestEventConstructor>(globalObject->vm().heap)) JSTestEventConstructor(structure, globalObject, WTF::move(impl));
@@ -43,7 +43,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestEventConstructor* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestEventConstructor();
 
     DECLARE_INFO;
 
@@ -53,11 +52,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestEventConstructor& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestEventConstructor* m_impl;
 protected:
     JSTestEventConstructor(JSC::Structure*, JSDOMGlobalObject*, Ref<TestEventConstructor>&&);
 
index b10a670..83b30cd 100644 (file)
@@ -145,8 +145,7 @@ void JSTestEventTargetPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestEventTarget::s_info = { "TestEventTarget", &Base::s_info, &JSTestEventTargetTable, CREATE_METHOD_TABLE(JSTestEventTarget) };
 
 JSTestEventTarget::JSTestEventTarget(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestEventTarget>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestEventTarget>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -166,11 +165,6 @@ void JSTestEventTarget::destroy(JSC::JSCell* cell)
     thisObject->JSTestEventTarget::~JSTestEventTarget();
 }
 
-JSTestEventTarget::~JSTestEventTarget()
-{
-    releaseImpl();
-}
-
 bool JSTestEventTarget::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestEventTarget*>(object);
index a21b7ef..d2b9983 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestEventTarget : public JSDOMWrapper {
+class JSTestEventTarget : public JSDOMWrapperWithImplementation<TestEventTarget> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestEventTarget> Base;
     static JSTestEventTarget* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestEventTarget>&& impl)
     {
         globalObject->masqueradesAsUndefinedWatchpoint()->fireAll("Allocated masquerading object");
@@ -44,7 +44,6 @@ public:
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestEventTarget();
 
     DECLARE_INFO;
 
@@ -57,11 +56,6 @@ public:
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
-    TestEventTarget& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestEventTarget* m_impl;
 public:
     static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::MasqueradesAsUndefined | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
 protected:
index 159fc73..44b6711 100644 (file)
@@ -129,8 +129,7 @@ void JSTestExceptionPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestException::s_info = { "TestException", &Base::s_info, &JSTestExceptionTable, CREATE_METHOD_TABLE(JSTestException) };
 
 JSTestException::JSTestException(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestException>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestException>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -150,11 +149,6 @@ void JSTestException::destroy(JSC::JSCell* cell)
     thisObject->JSTestException::~JSTestException();
 }
 
-JSTestException::~JSTestException()
-{
-    releaseImpl();
-}
-
 bool JSTestException::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestException*>(object);
index 38b4f6a..3e1570c 100644 (file)
@@ -28,9 +28,9 @@
 
 namespace WebCore {
 
-class JSTestException : public JSDOMWrapper {
+class JSTestException : public JSDOMWrapperWithImplementation<TestException> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestException> Base;
     static JSTestException* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestException>&& impl)
     {
         JSTestException* ptr = new (NotNull, JSC::allocateCell<JSTestException>(globalObject->vm().heap)) JSTestException(structure, globalObject, WTF::move(impl));
@@ -43,7 +43,6 @@ public:
     static TestException* toWrapped(JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestException();
 
     DECLARE_INFO;
 
@@ -53,11 +52,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestException& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestException* m_impl;
 public:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
index ab81272..917b38d 100644 (file)
@@ -112,8 +112,7 @@ void JSTestGenerateIsReachablePrototype::finishCreation(VM& vm)
 const ClassInfo JSTestGenerateIsReachable::s_info = { "TestGenerateIsReachable", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestGenerateIsReachable) };
 
 JSTestGenerateIsReachable::JSTestGenerateIsReachable(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestGenerateIsReachable>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestGenerateIsReachable>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -133,11 +132,6 @@ void JSTestGenerateIsReachable::destroy(JSC::JSCell* cell)
     thisObject->JSTestGenerateIsReachable::~JSTestGenerateIsReachable();
 }
 
-JSTestGenerateIsReachable::~JSTestGenerateIsReachable()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestGenerateIsReachableConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSTestGenerateIsReachablePrototype* domObject = jsDynamicCast<JSTestGenerateIsReachablePrototype*>(baseValue);
index fe380a0..92933aa 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestGenerateIsReachable : public JSDOMWrapper {
+class JSTestGenerateIsReachable : public JSDOMWrapperWithImplementation<TestGenerateIsReachable> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestGenerateIsReachable> Base;
     static JSTestGenerateIsReachable* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestGenerateIsReachable>&& impl)
     {
         JSTestGenerateIsReachable* ptr = new (NotNull, JSC::allocateCell<JSTestGenerateIsReachable>(globalObject->vm().heap)) JSTestGenerateIsReachable(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestGenerateIsReachable* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestGenerateIsReachable();
 
     DECLARE_INFO;
 
@@ -51,11 +50,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestGenerateIsReachable& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestGenerateIsReachable* m_impl;
 protected:
     JSTestGenerateIsReachable(JSC::Structure*, JSDOMGlobalObject*, Ref<TestGenerateIsReachable>&&);
 
index f2a9341..498c73f 100644 (file)
@@ -410,8 +410,7 @@ void JSTestInterfacePrototype::finishCreation(VM& vm)
 const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, &JSTestInterfaceTable, CREATE_METHOD_TABLE(JSTestInterface) };
 
 JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestInterface>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestInterface>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -431,11 +430,6 @@ void JSTestInterface::destroy(JSC::JSCell* cell)
     thisObject->JSTestInterface::~JSTestInterface();
 }
 
-JSTestInterface::~JSTestInterface()
-{
-    releaseImpl();
-}
-
 bool JSTestInterface::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestInterface*>(object);
index f20eef0..6a62502 100644 (file)
@@ -29,9 +29,9 @@
 
 namespace WebCore {
 
-class WEBCORE_EXPORT JSTestInterface : public JSDOMWrapper {
+class WEBCORE_EXPORT JSTestInterface : public JSDOMWrapperWithImplementation<TestInterface> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestInterface> Base;
     static JSTestInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestInterface>&& impl)
     {
         JSTestInterface* ptr = new (NotNull, JSC::allocateCell<JSTestInterface>(globalObject->vm().heap)) JSTestInterface(structure, globalObject, WTF::move(impl));
@@ -47,7 +47,6 @@ public:
     static void putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow);
     bool putDelegate(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestInterface();
 
     DECLARE_INFO;
 
@@ -79,11 +78,6 @@ public:
 #if ENABLE(Condition11) || ENABLE(Condition12)
     JSC::JSValue supplementalMethod3(JSC::ExecState&);
 #endif
-    TestInterface& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestInterface* m_impl;
 public:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
index 44f9cd4..3659b24 100644 (file)
@@ -146,10 +146,6 @@ void JSTestJSBuiltinConstructor::destroy(JSC::JSCell* cell)
     thisObject->JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor();
 }
 
-JSTestJSBuiltinConstructor::~JSTestJSBuiltinConstructor()
-{
-}
-
 EncodedJSValue jsTestJSBuiltinConstructorConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSTestJSBuiltinConstructorPrototype* domObject = jsDynamicCast<JSTestJSBuiltinConstructorPrototype*>(baseValue);
index cb8feca..ccb2044 100644 (file)
@@ -38,7 +38,6 @@ public:
     static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static void destroy(JSC::JSCell*);
-    ~JSTestJSBuiltinConstructor();
 
     DECLARE_INFO;
 
index 357edba..bdff176 100644 (file)
@@ -120,8 +120,7 @@ void JSTestMediaQueryListListenerPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestMediaQueryListListener::s_info = { "TestMediaQueryListListener", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestMediaQueryListListener) };
 
 JSTestMediaQueryListListener::JSTestMediaQueryListListener(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestMediaQueryListListener>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestMediaQueryListListener>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -141,11 +140,6 @@ void JSTestMediaQueryListListener::destroy(JSC::JSCell* cell)
     thisObject->JSTestMediaQueryListListener::~JSTestMediaQueryListListener();
 }
 
-JSTestMediaQueryListListener::~JSTestMediaQueryListListener()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestMediaQueryListListenerConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSTestMediaQueryListListenerPrototype* domObject = jsDynamicCast<JSTestMediaQueryListListenerPrototype*>(baseValue);
index e1690b4..1c731c0 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestMediaQueryListListener : public JSDOMWrapper {
+class JSTestMediaQueryListListener : public JSDOMWrapperWithImplementation<TestMediaQueryListListener> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestMediaQueryListListener> Base;
     static JSTestMediaQueryListListener* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestMediaQueryListListener>&& impl)
     {
         JSTestMediaQueryListListener* ptr = new (NotNull, JSC::allocateCell<JSTestMediaQueryListListener>(globalObject->vm().heap)) JSTestMediaQueryListListener(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestMediaQueryListListener* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestMediaQueryListListener();
 
     DECLARE_INFO;
 
@@ -51,11 +50,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestMediaQueryListListener& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestMediaQueryListListener* m_impl;
 protected:
     JSTestMediaQueryListListener(JSC::Structure*, JSDOMGlobalObject*, Ref<TestMediaQueryListListener>&&);
 
index edead67..b1ccebe 100644 (file)
@@ -185,8 +185,7 @@ void JSTestNamedConstructorPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestNamedConstructor::s_info = { "TestNamedConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNamedConstructor) };
 
 JSTestNamedConstructor::JSTestNamedConstructor(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedConstructor>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestNamedConstructor>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -206,11 +205,6 @@ void JSTestNamedConstructor::destroy(JSC::JSCell* cell)
     thisObject->JSTestNamedConstructor::~JSTestNamedConstructor();
 }
 
-JSTestNamedConstructor::~JSTestNamedConstructor()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestNamedConstructorConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSTestNamedConstructorPrototype* domObject = jsDynamicCast<JSTestNamedConstructorPrototype*>(baseValue);
index e3a5366..c475216 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestNamedConstructor : public JSDOMWrapper {
+class JSTestNamedConstructor : public JSDOMWrapperWithImplementation<TestNamedConstructor> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestNamedConstructor> Base;
     static JSTestNamedConstructor* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNamedConstructor>&& impl)
     {
         JSTestNamedConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestNamedConstructor>(globalObject->vm().heap)) JSTestNamedConstructor(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestNamedConstructor* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestNamedConstructor();
 
     DECLARE_INFO;
 
@@ -52,11 +51,6 @@ public:
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
     static JSC::JSValue getNamedConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestNamedConstructor& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestNamedConstructor* m_impl;
 protected:
     JSTestNamedConstructor(JSC::Structure*, JSDOMGlobalObject*, Ref<TestNamedConstructor>&&);
 
index af2dbbc..a8ca4e1 100644 (file)
@@ -141,8 +141,7 @@ void JSTestNondeterministicPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestNondeterministic::s_info = { "TestNondeterministic", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNondeterministic) };
 
 JSTestNondeterministic::JSTestNondeterministic(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNondeterministic>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestNondeterministic>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -162,11 +161,6 @@ void JSTestNondeterministic::destroy(JSC::JSCell* cell)
     thisObject->JSTestNondeterministic::~JSTestNondeterministic();
 }
 
-JSTestNondeterministic::~JSTestNondeterministic()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
 {
     UNUSED_PARAM(state);
index c5d6633..737cb8f 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestNondeterministic : public JSDOMWrapper {
+class JSTestNondeterministic : public JSDOMWrapperWithImplementation<TestNondeterministic> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestNondeterministic> Base;
     static JSTestNondeterministic* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestNondeterministic>&& impl)
     {
         JSTestNondeterministic* ptr = new (NotNull, JSC::allocateCell<JSTestNondeterministic>(globalObject->vm().heap)) JSTestNondeterministic(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestNondeterministic* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestNondeterministic();
 
     DECLARE_INFO;
 
@@ -51,11 +50,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestNondeterministic& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestNondeterministic* m_impl;
 protected:
     JSTestNondeterministic(JSC::Structure*, JSDOMGlobalObject*, Ref<TestNondeterministic>&&);
 
index a87d772..872336e 100644 (file)
@@ -707,8 +707,7 @@ void JSTestObjPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestObj::s_info = { "TestObject", &Base::s_info, &JSTestObjTable, CREATE_METHOD_TABLE(JSTestObj) };
 
 JSTestObj::JSTestObj(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestObj>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestObj>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -728,11 +727,6 @@ void JSTestObj::destroy(JSC::JSCell* cell)
     thisObject->JSTestObj::~JSTestObj();
 }
 
-JSTestObj::~JSTestObj()
-{
-    releaseImpl();
-}
-
 bool JSTestObj::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestObj*>(object);
index 3a06c80..a473a84 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestObj : public JSDOMWrapper {
+class JSTestObj : public JSDOMWrapperWithImplementation<TestObj> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestObj> Base;
     static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestObj>&& impl)
     {
         JSTestObj* ptr = new (NotNull, JSC::allocateCell<JSTestObj>(globalObject->vm().heap)) JSTestObj(structure, globalObject, WTF::move(impl));
@@ -42,7 +42,6 @@ public:
     static TestObj* toWrapped(JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestObj();
 
     DECLARE_INFO;
 
@@ -65,11 +64,6 @@ public:
     JSC::JSValue customMethod(JSC::ExecState&);
     JSC::JSValue customMethodWithArgs(JSC::ExecState&);
     static JSC::JSValue classMethod2(JSC::ExecState&);
-    TestObj& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestObj* m_impl;
 public:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
index 66ef3d5..e1d1331 100644 (file)
@@ -206,8 +206,7 @@ void JSTestOverloadedConstructorsPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestOverloadedConstructors::s_info = { "TestOverloadedConstructors", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestOverloadedConstructors) };
 
 JSTestOverloadedConstructors::JSTestOverloadedConstructors(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestOverloadedConstructors>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestOverloadedConstructors>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -227,11 +226,6 @@ void JSTestOverloadedConstructors::destroy(JSC::JSCell* cell)
     thisObject->JSTestOverloadedConstructors::~JSTestOverloadedConstructors();
 }
 
-JSTestOverloadedConstructors::~JSTestOverloadedConstructors()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestOverloadedConstructorsConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSTestOverloadedConstructorsPrototype* domObject = jsDynamicCast<JSTestOverloadedConstructorsPrototype*>(baseValue);
index 11e2919..8ade576 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestOverloadedConstructors : public JSDOMWrapper {
+class JSTestOverloadedConstructors : public JSDOMWrapperWithImplementation<TestOverloadedConstructors> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestOverloadedConstructors> Base;
     static JSTestOverloadedConstructors* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestOverloadedConstructors>&& impl)
     {
         JSTestOverloadedConstructors* ptr = new (NotNull, JSC::allocateCell<JSTestOverloadedConstructors>(globalObject->vm().heap)) JSTestOverloadedConstructors(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestOverloadedConstructors* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestOverloadedConstructors();
 
     DECLARE_INFO;
 
@@ -51,11 +50,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestOverloadedConstructors& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestOverloadedConstructors* m_impl;
 protected:
     JSTestOverloadedConstructors(JSC::Structure*, JSDOMGlobalObject*, Ref<TestOverloadedConstructors>&&);
 
index ca10df6..df1c965 100644 (file)
@@ -135,8 +135,7 @@ void JSTestOverrideBuiltinsPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestOverrideBuiltins::s_info = { "TestOverrideBuiltins", &Base::s_info, &JSTestOverrideBuiltinsTable, CREATE_METHOD_TABLE(JSTestOverrideBuiltins) };
 
 JSTestOverrideBuiltins::JSTestOverrideBuiltins(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestOverrideBuiltins>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestOverrideBuiltins>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -156,11 +155,6 @@ void JSTestOverrideBuiltins::destroy(JSC::JSCell* cell)
     thisObject->JSTestOverrideBuiltins::~JSTestOverrideBuiltins();
 }
 
-JSTestOverrideBuiltins::~JSTestOverrideBuiltins()
-{
-    releaseImpl();
-}
-
 bool JSTestOverrideBuiltins::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestOverrideBuiltins*>(object);
index 0c9a7f1..e4e200c 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestOverrideBuiltins : public JSDOMWrapper {
+class JSTestOverrideBuiltins : public JSDOMWrapperWithImplementation<TestOverrideBuiltins> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestOverrideBuiltins> Base;
     static JSTestOverrideBuiltins* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestOverrideBuiltins>&& impl)
     {
         JSTestOverrideBuiltins* ptr = new (NotNull, JSC::allocateCell<JSTestOverrideBuiltins>(globalObject->vm().heap)) JSTestOverrideBuiltins(structure, globalObject, WTF::move(impl));
@@ -43,7 +43,6 @@ public:
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestOverrideBuiltins();
 
     DECLARE_INFO;
 
@@ -54,11 +53,6 @@ public:
 
     static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestOverrideBuiltins& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestOverrideBuiltins* m_impl;
 public:
     static const unsigned StructureFlags = JSC::HasImpureGetOwnPropertySlot | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
 protected:
index 47fca44..badea0c 100644 (file)
@@ -131,8 +131,7 @@ void JSTestSerializedScriptValueInterfacePrototype::finishCreation(VM& vm)
 const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestSerializedScriptValueInterface) };
 
 JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestSerializedScriptValueInterface>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestSerializedScriptValueInterface>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -152,11 +151,6 @@ void JSTestSerializedScriptValueInterface::destroy(JSC::JSCell* cell)
     thisObject->JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface();
 }
 
-JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsTestSerializedScriptValueInterfaceValue(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
 {
     UNUSED_PARAM(state);
index a3287b8..eb9246b 100644 (file)
@@ -29,9 +29,9 @@
 
 namespace WebCore {
 
-class JSTestSerializedScriptValueInterface : public JSDOMWrapper {
+class JSTestSerializedScriptValueInterface : public JSDOMWrapperWithImplementation<TestSerializedScriptValueInterface> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestSerializedScriptValueInterface> Base;
     static JSTestSerializedScriptValueInterface* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestSerializedScriptValueInterface>&& impl)
     {
         JSTestSerializedScriptValueInterface* ptr = new (NotNull, JSC::allocateCell<JSTestSerializedScriptValueInterface>(globalObject->vm().heap)) JSTestSerializedScriptValueInterface(structure, globalObject, WTF::move(impl));
@@ -43,7 +43,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static TestSerializedScriptValueInterface* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSTestSerializedScriptValueInterface();
 
     DECLARE_INFO;
 
@@ -57,11 +56,6 @@ public:
     mutable JSC::WriteBarrier<JSC::Unknown> m_cachedReadonlyValue;
     static void visitChildren(JSCell*, JSC::SlotVisitor&);
 
-    TestSerializedScriptValueInterface& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestSerializedScriptValueInterface* m_impl;
 protected:
     JSTestSerializedScriptValueInterface(JSC::Structure*, JSDOMGlobalObject*, Ref<TestSerializedScriptValueInterface>&&);
 
index 717a1ff..c9eae47 100644 (file)
@@ -214,8 +214,7 @@ void JSTestTypedefsPrototype::finishCreation(VM& vm)
 const ClassInfo JSTestTypedefs::s_info = { "TestTypedefs", &Base::s_info, &JSTestTypedefsTable, CREATE_METHOD_TABLE(JSTestTypedefs) };
 
 JSTestTypedefs::JSTestTypedefs(Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestTypedefs>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<TestTypedefs>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -235,11 +234,6 @@ void JSTestTypedefs::destroy(JSC::JSCell* cell)
     thisObject->JSTestTypedefs::~JSTestTypedefs();
 }
 
-JSTestTypedefs::~JSTestTypedefs()
-{
-    releaseImpl();
-}
-
 bool JSTestTypedefs::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
 {
     auto* thisObject = jsCast<JSTestTypedefs*>(object);
index b3a5ad6..f2ce936 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSTestTypedefs : public JSDOMWrapper {
+class JSTestTypedefs : public JSDOMWrapperWithImplementation<TestTypedefs> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<TestTypedefs> Base;
     static JSTestTypedefs* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestTypedefs>&& impl)
     {
         JSTestTypedefs* ptr = new (NotNull, JSC::allocateCell<JSTestTypedefs>(globalObject->vm().heap)) JSTestTypedefs(structure, globalObject, WTF::move(impl));
@@ -42,7 +42,6 @@ public:
     static TestTypedefs* toWrapped(JSC::JSValue);
     static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
     static void destroy(JSC::JSCell*);
-    ~JSTestTypedefs();
 
     DECLARE_INFO;
 
@@ -52,11 +51,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    TestTypedefs& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    TestTypedefs* m_impl;
 public:
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 protected:
index ddcf73f..89c6d1a 100644 (file)
@@ -116,8 +116,7 @@ void JSattributePrototype::finishCreation(VM& vm)
 const ClassInfo JSattribute::s_info = { "attribute", &Base::s_info, 0, CREATE_METHOD_TABLE(JSattribute) };
 
 JSattribute::JSattribute(Structure* structure, JSDOMGlobalObject* globalObject, Ref<attribute>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<attribute>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -137,11 +136,6 @@ void JSattribute::destroy(JSC::JSCell* cell)
     thisObject->JSattribute::~JSattribute();
 }
 
-JSattribute::~JSattribute()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsattributeReadonly(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
 {
     UNUSED_PARAM(state);
index 578e05f..ca3b110 100644 (file)
@@ -28,9 +28,9 @@
 
 namespace WebCore {
 
-class JSattribute : public JSDOMWrapper {
+class JSattribute : public JSDOMWrapperWithImplementation<attribute> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<attribute> Base;
     static JSattribute* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<attribute>&& impl)
     {
         JSattribute* ptr = new (NotNull, JSC::allocateCell<JSattribute>(globalObject->vm().heap)) JSattribute(structure, globalObject, WTF::move(impl));
@@ -42,7 +42,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static attribute* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSattribute();
 
     DECLARE_INFO;
 
@@ -52,11 +51,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    attribute& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    attribute* m_impl;
 protected:
     JSattribute(JSC::Structure*, JSDOMGlobalObject*, Ref<attribute>&&);
 
index d03ecd1..673d3cf 100644 (file)
@@ -112,8 +112,7 @@ void JSreadonlyPrototype::finishCreation(VM& vm)
 const ClassInfo JSreadonly::s_info = { "readonly", &Base::s_info, 0, CREATE_METHOD_TABLE(JSreadonly) };
 
 JSreadonly::JSreadonly(Structure* structure, JSDOMGlobalObject* globalObject, Ref<readonly>&& impl)
-    : JSDOMWrapper(structure, globalObject)
-    , m_impl(&impl.leakRef())
+    : JSDOMWrapperWithImplementation<readonly>(structure, globalObject, WTF::move(impl))
 {
 }
 
@@ -133,11 +132,6 @@ void JSreadonly::destroy(JSC::JSCell* cell)
     thisObject->JSreadonly::~JSreadonly();
 }
 
-JSreadonly::~JSreadonly()
-{
-    releaseImpl();
-}
-
 EncodedJSValue jsreadonlyConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
 {
     JSreadonlyPrototype* domObject = jsDynamicCast<JSreadonlyPrototype*>(baseValue);
index 245eb71..fc48af8 100644 (file)
@@ -27,9 +27,9 @@
 
 namespace WebCore {
 
-class JSreadonly : public JSDOMWrapper {
+class JSreadonly : public JSDOMWrapperWithImplementation<readonly> {
 public:
-    typedef JSDOMWrapper Base;
+    typedef JSDOMWrapperWithImplementation<readonly> Base;
     static JSreadonly* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<readonly>&& impl)
     {
         JSreadonly* ptr = new (NotNull, JSC::allocateCell<JSreadonly>(globalObject->vm().heap)) JSreadonly(structure, globalObject, WTF::move(impl));
@@ -41,7 +41,6 @@ public:
     static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
     static readonly* toWrapped(JSC::JSValue);
     static void destroy(JSC::JSCell*);
-    ~JSreadonly();
 
     DECLARE_INFO;
 
@@ -51,11 +50,6 @@ public:
     }
 
     static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
-    readonly& impl() const { return *m_impl; }
-    void releaseImpl() { std::exchange(m_impl, nullptr)->deref(); }
-
-private:
-    readonly* m_impl;
 protected:
     JSreadonly(JSC::Structure*, JSDOMGlobalObject*, Ref<readonly>&&);