Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 May 2015 10:12:46 +0000 (10:12 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 May 2015 10:12:46 +0000 (10:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145016

Reviewed by Darin Adler.

Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
It creates a constructor object and shadows the constructor property JS function with this object.
This ensures that only one constructor object is created per prototype.
The constructor is not exposed as it is not added to the global object constructor map.

NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
The case for having NoInterfaceObject and CustomConstructor is the following:
We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
One such case is https://streams.spec.whatwg.org/#globals

Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateAttributesHashTable):
(GenerateImplementation):
(HasConstructorProperty):
* bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
(WebKit::kit):
(WebKit::core):
(WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
(webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
(webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
(webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
(webkit_dom_test_custom_constructor_with_no_interface_object_init):
* bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
* bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
(WebCore::toJS):
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
(WebCore::wrapperOwner):
(WebCore::toJS):
* bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
* bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
(-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
(-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
(core):
(kit):
* bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
* bindings/scripts/test/TestCustomConstructor.idl: Added.

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h [new file with mode: 0644]
Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl [new file with mode: 0644]

index 74b676d..c605af1 100644 (file)
@@ -1,3 +1,71 @@
+2015-05-28  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
+        https://bugs.webkit.org/show_bug.cgi?id=145016
+
+        Reviewed by Darin Adler.
+
+        Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
+        In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
+        It creates a constructor object and shadows the constructor property JS function with this object.
+        This ensures that only one constructor object is created per prototype.
+        The constructor is not exposed as it is not added to the global object constructor map.
+
+        NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
+        The case for having NoInterfaceObject and CustomConstructor is the following:
+        We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
+        One such case is https://streams.spec.whatwg.org/#globals
+
+        Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateHeader):
+        (GenerateAttributesHashTable):
+        (GenerateImplementation):
+        (HasConstructorProperty):
+        * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
+        (WebKit::kit):
+        (WebKit::core):
+        (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
+        (webkit_dom_test_custom_constructor_with_no_interface_object_init):
+        * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
+        * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
+        (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
+        (WebCore::toJS):
+        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
+        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
+        (WebCore::wrapperOwner):
+        (WebCore::toJS):
+        * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
+        * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
+        (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
+        (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
+        (core):
+        (kit):
+        * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
+        * bindings/scripts/test/TestCustomConstructor.idl: Added.
+
 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
 
         [iOS] When viewing an MJPEG stream as the main resource, only the first
index 756fa79..58c07a7 100644 (file)
@@ -1301,7 +1301,7 @@ sub GenerateAttributesHashTable
 
     if (ConstructorShouldBeOnInstance($interface) == $isInstance) {
 
-        if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+        if (NeedsConstructorProperty($interface)) {
             die if !$numAttributes;
             push(@$hashKeys, "constructor");
             my $getter = "js" . $interfaceName . "Constructor";
@@ -1749,7 +1749,7 @@ sub GenerateImplementation
         push(@implContent, "\n");
     }
 
-    if ($numAttributes > 0 || !$interface->extendedAttributes->{"NoInterfaceObject"}) {
+    if ($numAttributes > 0 || NeedsConstructorProperty($interface)) {
         push(@implContent, "// Attributes\n\n");
         foreach my $attribute (@{$interface->attributes}) {
             next if $attribute->signature->extendedAttributes->{"ForwardDeclareInHeader"};
@@ -1765,7 +1765,7 @@ sub GenerateImplementation
             push(@implContent, "#endif\n") if $conditionalString;
         }
         
-        if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+        if (NeedsConstructorProperty($interface)) {
             my $getter = "js" . $interfaceName . "Constructor";
             push(@implContent, "JSC::EncodedJSValue ${getter}(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);\n");
         }
@@ -1784,7 +1784,7 @@ sub GenerateImplementation
     }
 
     # Add constructor declaration
-    if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+    if (NeedsConstructorProperty($interface)) {
         $implIncludes{"JSDOMBinding.h"} = 1;
         if ($interface->extendedAttributes->{"NamedConstructor"}) {
             $implIncludes{"DOMConstructorWithDocument.h"} = 1;
@@ -1811,7 +1811,7 @@ sub GenerateImplementation
         \%conditionals, 0) if $numInstanceAttributes > 0;
 
     # - Add all constants
-    if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+    if (NeedsConstructorProperty($interface)) {
         my $hashSize = 0;
         my $hashName = $className . "ConstructorTable";
 
@@ -2189,7 +2189,7 @@ sub GenerateImplementation
         }
 
     }
-    $numAttributes = $numAttributes + 1 if !$interface->extendedAttributes->{"NoInterfaceObject"};
+    $numAttributes = $numAttributes + 1 if NeedsConstructorProperty($interface);
     if ($numAttributes > 0) {
         foreach my $attribute (@{$interface->attributes}) {
             my $name = $attribute->signature->name;
@@ -2415,7 +2415,7 @@ sub GenerateImplementation
             push(@implContent, "\n");
         }
 
-        if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+        if (NeedsConstructorProperty($interface)) {
             my $constructorFunctionName = "js" . $interfaceName . "Constructor";
 
             if ($interface->extendedAttributes->{"CustomProxyToJSObject"}) {
@@ -2440,7 +2440,14 @@ sub GenerateImplementation
                 push(@implContent, "        return JSValue::encode(jsUndefined());\n");
             }
 
-            push(@implContent, "    return JSValue::encode(${className}::getConstructor(exec->vm(), domObject->globalObject()));\n");
+            if (!$interface->extendedAttributes->{"NoInterfaceObject"}) {
+                push(@implContent, "    return JSValue::encode(${className}::getConstructor(exec->vm(), domObject->globalObject()));\n");
+            } else {
+                push(@implContent, "    JSValue constructor = ${className}Constructor::create(exec->vm(), ${className}Constructor::createStructure(exec->vm(), domObject->globalObject(), domObject->globalObject()->objectPrototype()), jsCast<JSDOMGlobalObject*>(domObject->globalObject()));\n");
+                push(@implContent, "    // Shadowing constructor property to ensure reusing the same constructor object\n");
+                push(@implContent, "    domObject->putDirect(exec->vm(), exec->propertyNames().constructor, constructor, DontEnum | ReadOnly);\n");
+                push(@implContent, "    return JSValue::encode(constructor);\n");
+            }
             push(@implContent, "}\n\n");
         }
 
@@ -4763,6 +4770,13 @@ sub HasCustomMethod
     return $attrExt->{"Custom"};
 }
 
+sub NeedsConstructorProperty
+{
+    my $interface = shift;
+
+    return !$interface->extendedAttributes->{"NoInterfaceObject"} || $interface->extendedAttributes->{"CustomConstructor"};
+}
+
 sub IsConstructable
 {
     my $interface = shift;
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp
new file mode 100644 (file)
index 0000000..1c9bb6c
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ *  This file is part of the WebKit open source project.
+ *  This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitDOMTestCustomConstructorWithNoInterfaceObject.h"
+
+#include "CSSImportRule.h"
+#include "DOMObjectCache.h"
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "ExceptionCodeDescription.h"
+#include "JSMainThreadExecState.h"
+#include "WebKitDOMPrivate.h"
+#include "WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h"
+#include "gobject/ConvertToUTF8String.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+#define WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT, WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate)
+
+typedef struct _WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate {
+    RefPtr<WebCore::TestCustomConstructorWithNoInterfaceObject> coreObject;
+} WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate;
+
+namespace WebKit {
+
+WebKitDOMTestCustomConstructorWithNoInterfaceObject* kit(WebCore::TestCustomConstructorWithNoInterfaceObject* obj)
+{
+    if (!obj)
+        return 0;
+
+    if (gpointer ret = DOMObjectCache::get(obj))
+        return WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT(ret);
+
+    return wrapTestCustomConstructorWithNoInterfaceObject(obj);
+}
+
+WebCore::TestCustomConstructorWithNoInterfaceObject* core(WebKitDOMTestCustomConstructorWithNoInterfaceObject* request)
+{
+    return request ? static_cast<WebCore::TestCustomConstructorWithNoInterfaceObject*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0;
+}
+
+WebKitDOMTestCustomConstructorWithNoInterfaceObject* wrapTestCustomConstructorWithNoInterfaceObject(WebCore::TestCustomConstructorWithNoInterfaceObject* coreObject)
+{
+    ASSERT(coreObject);
+    return WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT(g_object_new(WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT, "core-object", coreObject, nullptr));
+}
+
+} // namespace WebKit
+
+G_DEFINE_TYPE(WebKitDOMTestCustomConstructorWithNoInterfaceObject, webkit_dom_test_custom_constructor_with_no_interface_object, WEBKIT_DOM_TYPE_OBJECT)
+
+static void webkit_dom_test_custom_constructor_with_no_interface_object_finalize(GObject* object)
+{
+    WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate* priv = WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_GET_PRIVATE(object);
+
+    WebKit::DOMObjectCache::forget(priv->coreObject.get());
+
+    priv->~WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate();
+    G_OBJECT_CLASS(webkit_dom_test_custom_constructor_with_no_interface_object_parent_class)->finalize(object);
+}
+
+static GObject* webkit_dom_test_custom_constructor_with_no_interface_object_constructor(GType type, guint constructPropertiesCount, GObjectConstructParam* constructProperties)
+{
+    GObject* object = G_OBJECT_CLASS(webkit_dom_test_custom_constructor_with_no_interface_object_parent_class)->constructor(type, constructPropertiesCount, constructProperties);
+
+    WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate* priv = WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_GET_PRIVATE(object);
+    priv->coreObject = static_cast<WebCore::TestCustomConstructorWithNoInterfaceObject*>(WEBKIT_DOM_OBJECT(object)->coreObject);
+    WebKit::DOMObjectCache::put(priv->coreObject.get(), object);
+
+    return object;
+}
+
+static void webkit_dom_test_custom_constructor_with_no_interface_object_class_init(WebKitDOMTestCustomConstructorWithNoInterfaceObjectClass* requestClass)
+{
+    GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);
+    g_type_class_add_private(gobjectClass, sizeof(WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate));
+    gobjectClass->constructor = webkit_dom_test_custom_constructor_with_no_interface_object_constructor;
+    gobjectClass->finalize = webkit_dom_test_custom_constructor_with_no_interface_object_finalize;
+}
+
+static void webkit_dom_test_custom_constructor_with_no_interface_object_init(WebKitDOMTestCustomConstructorWithNoInterfaceObject* request)
+{
+    WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate* priv = WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_GET_PRIVATE(request);
+    new (priv) WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate();
+}
+
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h
new file mode 100644 (file)
index 0000000..9ac4ca0
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ *  This file is part of the WebKit open source project.
+ *  This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitDOMTestCustomConstructorWithNoInterfaceObject_h
+#define WebKitDOMTestCustomConstructorWithNoInterfaceObject_h
+
+#ifdef WEBKIT_DOM_USE_UNSTABLE_API
+
+#include <glib-object.h>
+#include <webkitdom/WebKitDOMObject.h>
+#include <webkitdom/webkitdomdefines-unstable.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT            (webkit_dom_test_custom_constructor_with_no_interface_object_get_type())
+#define WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT, WebKitDOMTestCustomConstructorWithNoInterfaceObject))
+#define WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT, WebKitDOMTestCustomConstructorWithNoInterfaceObjectClass)
+#define WEBKIT_DOM_IS_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT))
+#define WEBKIT_DOM_IS_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT))
+#define WEBKIT_DOM_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_DOM_TYPE_TEST_CUSTOM_CONSTRUCTOR_WITH_NO_INTERFACE_OBJECT, WebKitDOMTestCustomConstructorWithNoInterfaceObjectClass))
+
+struct _WebKitDOMTestCustomConstructorWithNoInterfaceObject {
+    WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestCustomConstructorWithNoInterfaceObjectClass {
+    WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_custom_constructor_with_no_interface_object_get_type(void);
+
+G_END_DECLS
+
+#endif /* WEBKIT_DOM_USE_UNSTABLE_API */
+#endif /* WebKitDOMTestCustomConstructorWithNoInterfaceObject_h */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h
new file mode 100644 (file)
index 0000000..6ced471
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  This file is part of the WebKit open source project.
+ *  This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Library General Public License
+ *  along with this library; see the file COPYING.LIB.  If not, write to
+ *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ *  Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate_h
+#define WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate_h
+
+#include "TestCustomConstructorWithNoInterfaceObject.h"
+#include <webkitdom/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h>
+
+namespace WebKit {
+WebKitDOMTestCustomConstructorWithNoInterfaceObject* wrapTestCustomConstructorWithNoInterfaceObject(WebCore::TestCustomConstructorWithNoInterfaceObject*);
+WebKitDOMTestCustomConstructorWithNoInterfaceObject* kit(WebCore::TestCustomConstructorWithNoInterfaceObject*);
+WebCore::TestCustomConstructorWithNoInterfaceObject* core(WebKitDOMTestCustomConstructorWithNoInterfaceObject*);
+} // namespace WebKit
+
+#endif /* WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate_h */
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp
new file mode 100644 (file)
index 0000000..5c9d3be
--- /dev/null
@@ -0,0 +1,216 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestCustomConstructorWithNoInterfaceObject.h"
+
+#include "JSDOMBinding.h"
+#include "TestCustomConstructorWithNoInterfaceObject.h"
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Attributes
+
+JSC::EncodedJSValue jsTestCustomConstructorWithNoInterfaceObjectConstructor(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
+
+class JSTestCustomConstructorWithNoInterfaceObjectPrototype : public JSC::JSNonFinalObject {
+public:
+    typedef JSC::JSNonFinalObject Base;
+    static JSTestCustomConstructorWithNoInterfaceObjectPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+    {
+        JSTestCustomConstructorWithNoInterfaceObjectPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestCustomConstructorWithNoInterfaceObjectPrototype>(vm.heap)) JSTestCustomConstructorWithNoInterfaceObjectPrototype(vm, globalObject, structure);
+        ptr->finishCreation(vm);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+
+private:
+    JSTestCustomConstructorWithNoInterfaceObjectPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+        : JSC::JSNonFinalObject(vm, structure)
+    {
+    }
+
+    void finishCreation(JSC::VM&);
+};
+
+class JSTestCustomConstructorWithNoInterfaceObjectConstructor : public DOMConstructorObject {
+private:
+    JSTestCustomConstructorWithNoInterfaceObjectConstructor(JSC::Structure*, JSDOMGlobalObject*);
+    void finishCreation(JSC::VM&, JSDOMGlobalObject*);
+
+public:
+    typedef DOMConstructorObject Base;
+    static JSTestCustomConstructorWithNoInterfaceObjectConstructor* create(JSC::VM& vm, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
+    {
+        JSTestCustomConstructorWithNoInterfaceObjectConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestCustomConstructorWithNoInterfaceObjectConstructor>(vm.heap)) JSTestCustomConstructorWithNoInterfaceObjectConstructor(structure, globalObject);
+        ptr->finishCreation(vm, globalObject);
+        return ptr;
+    }
+
+    DECLARE_INFO;
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
+    }
+    static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
+};
+
+const ClassInfo JSTestCustomConstructorWithNoInterfaceObjectConstructor::s_info = { "TestCustomConstructorWithNoInterfaceObjectConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCustomConstructorWithNoInterfaceObjectConstructor) };
+
+JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
+    : DOMConstructorObject(structure, globalObject)
+{
+}
+
+void JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
+{
+    Base::finishCreation(vm);
+    ASSERT(inherits(info()));
+    putDirect(vm, vm.propertyNames->prototype, JSTestCustomConstructorWithNoInterfaceObject::getPrototype(vm, globalObject), DontDelete | ReadOnly);
+    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
+}
+
+ConstructType JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData(JSCell*, ConstructData& constructData)
+{
+    constructData.native.function = constructJSTestCustomConstructorWithNoInterfaceObject;
+    return ConstructTypeHost;
+}
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestCustomConstructorWithNoInterfaceObjectPrototypeTableValues[] =
+{
+    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestCustomConstructorWithNoInterfaceObjectConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
+};
+
+const ClassInfo JSTestCustomConstructorWithNoInterfaceObjectPrototype::s_info = { "TestCustomConstructorWithNoInterfaceObjectPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestCustomConstructorWithNoInterfaceObjectPrototype) };
+
+void JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation(VM& vm)
+{
+    Base::finishCreation(vm);
+    reifyStaticProperties(vm, JSTestCustomConstructorWithNoInterfaceObjectPrototypeTableValues, *this);
+}
+
+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())
+{
+}
+
+JSObject* JSTestCustomConstructorWithNoInterfaceObject::createPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return JSTestCustomConstructorWithNoInterfaceObjectPrototype::create(vm, globalObject, JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
+}
+
+JSObject* JSTestCustomConstructorWithNoInterfaceObject::getPrototype(VM& vm, JSGlobalObject* globalObject)
+{
+    return getDOMPrototype<JSTestCustomConstructorWithNoInterfaceObject>(vm, globalObject);
+}
+
+void JSTestCustomConstructorWithNoInterfaceObject::destroy(JSC::JSCell* cell)
+{
+    JSTestCustomConstructorWithNoInterfaceObject* thisObject = static_cast<JSTestCustomConstructorWithNoInterfaceObject*>(cell);
+    thisObject->JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject();
+}
+
+JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject()
+{
+    releaseImpl();
+}
+
+EncodedJSValue jsTestCustomConstructorWithNoInterfaceObjectConstructor(ExecState* exec, JSObject* baseValue, EncodedJSValue, PropertyName)
+{
+    JSTestCustomConstructorWithNoInterfaceObjectPrototype* domObject = jsDynamicCast<JSTestCustomConstructorWithNoInterfaceObjectPrototype*>(baseValue);
+    if (!domObject)
+        return throwVMTypeError(exec);
+    JSValue constructor = JSTestCustomConstructorWithNoInterfaceObjectConstructor::create(exec->vm(), JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure(exec->vm(), domObject->globalObject(), domObject->globalObject()->objectPrototype()), jsCast<JSDOMGlobalObject*>(domObject->globalObject()));
+    // Shadowing constructor property to ensure reusing the same constructor object
+    domObject->putDirect(exec->vm(), exec->propertyNames().constructor, constructor, DontEnum | ReadOnly);
+    return JSValue::encode(constructor);
+}
+
+bool JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    UNUSED_PARAM(handle);
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    auto* jsTestCustomConstructorWithNoInterfaceObject = jsCast<JSTestCustomConstructorWithNoInterfaceObject*>(handle.slot()->asCell());
+    auto& world = *static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, &jsTestCustomConstructorWithNoInterfaceObject->impl(), jsTestCustomConstructorWithNoInterfaceObject);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestCustomConstructorWithNoInterfaceObject@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore42TestCustomConstructorWithNoInterfaceObjectE[]; }
+#endif
+#endif
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject* impl)
+{
+    if (!impl)
+        return jsNull();
+    if (JSValue result = getExistingWrapper<JSTestCustomConstructorWithNoInterfaceObject>(globalObject, impl))
+        return result;
+
+#if ENABLE(BINDING_INTEGRITY)
+    void* actualVTablePointer = *(reinterpret_cast<void**>(impl));
+#if PLATFORM(WIN)
+    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestCustomConstructorWithNoInterfaceObject@WebCore@@6B@"));
+#else
+    void* expectedVTablePointer = &_ZTVN7WebCore42TestCustomConstructorWithNoInterfaceObjectE[2];
+#if COMPILER(CLANG)
+    // If this fails TestCustomConstructorWithNoInterfaceObject does not have a vtable, so you need to add the
+    // ImplementationLacksVTable attribute to the interface definition
+    COMPILE_ASSERT(__is_polymorphic(TestCustomConstructorWithNoInterfaceObject), TestCustomConstructorWithNoInterfaceObject_is_not_polymorphic);
+#endif
+#endif
+    // If you hit this assertion you either have a use after free bug, or
+    // TestCustomConstructorWithNoInterfaceObject has subclasses. If TestCustomConstructorWithNoInterfaceObject has subclasses that get passed
+    // to toJS() we currently require TestCustomConstructorWithNoInterfaceObject you to opt out of binding hardening
+    // by adding the SkipVTableValidation attribute to the interface IDL definition
+    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+    return createNewWrapper<JSTestCustomConstructorWithNoInterfaceObject>(globalObject, impl);
+}
+
+TestCustomConstructorWithNoInterfaceObject* JSTestCustomConstructorWithNoInterfaceObject::toWrapped(JSC::JSValue value)
+{
+    if (auto* wrapper = jsDynamicCast<JSTestCustomConstructorWithNoInterfaceObject*>(value))
+        return &wrapper->impl();
+    return nullptr;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h b/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h
new file mode 100644 (file)
index 0000000..738c392
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+    This file is part of the WebKit open source project.
+    This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#ifndef JSTestCustomConstructorWithNoInterfaceObject_h
+#define JSTestCustomConstructorWithNoInterfaceObject_h
+
+#include "JSDOMWrapper.h"
+#include "TestCustomConstructorWithNoInterfaceObject.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class JSTestCustomConstructorWithNoInterfaceObject : public JSDOMWrapper {
+public:
+    typedef JSDOMWrapper 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));
+        ptr->finishCreation(globalObject->vm());
+        return ptr;
+    }
+
+    static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
+    static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
+    static TestCustomConstructorWithNoInterfaceObject* toWrapped(JSC::JSValue);
+    static void destroy(JSC::JSCell*);
+    ~JSTestCustomConstructorWithNoInterfaceObject();
+
+    DECLARE_INFO;
+
+    static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+    {
+        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>&&);
+
+    void finishCreation(JSC::VM& vm)
+    {
+        Base::finishCreation(vm);
+        ASSERT(inherits(info()));
+    }
+
+};
+
+class JSTestCustomConstructorWithNoInterfaceObjectOwner : public JSC::WeakHandleOwner {
+public:
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestCustomConstructorWithNoInterfaceObject*)
+{
+    static NeverDestroyed<JSTestCustomConstructorWithNoInterfaceObjectOwner> owner;
+    return &owner.get();
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestCustomConstructorWithNoInterfaceObject*);
+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestCustomConstructorWithNoInterfaceObject& impl) { return toJS(exec, globalObject, &impl); }
+
+// Custom constructor
+JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState*);
+
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h
new file mode 100644 (file)
index 0000000..cd6c556
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <WebCore/DOMObject.h>
+
+WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
+WEBCORE_EXPORT @interface DOMTestCustomConstructorWithNoInterfaceObject : DOMObject
+@end
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm
new file mode 100644 (file)
index 0000000..977e6a8
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestCustomConstructorWithNoInterfaceObject.h"
+
+#import "DOMNodeInternal.h"
+#import "DOMTestCustomConstructorWithNoInterfaceObjectInternal.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "TestCustomConstructorWithNoInterfaceObject.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestCustomConstructorWithNoInterfaceObject*>(_internal)
+
+@implementation DOMTestCustomConstructorWithNoInterfaceObject
+
+- (void)dealloc
+{
+    if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestCustomConstructorWithNoInterfaceObject class], self))
+        return;
+
+    if (_internal)
+        IMPL->deref();
+    [super dealloc];
+}
+
+- (void)finalize
+{
+    if (_internal)
+        IMPL->deref();
+    [super finalize];
+}
+
+@end
+
+WebCore::TestCustomConstructorWithNoInterfaceObject* core(DOMTestCustomConstructorWithNoInterfaceObject *wrapper)
+{
+    return wrapper ? reinterpret_cast<WebCore::TestCustomConstructorWithNoInterfaceObject*>(wrapper->_internal) : 0;
+}
+
+DOMTestCustomConstructorWithNoInterfaceObject *kit(WebCore::TestCustomConstructorWithNoInterfaceObject* value)
+{
+    WebCoreThreadViolationCheckRoundOne();
+    if (!value)
+        return nil;
+    if (DOMTestCustomConstructorWithNoInterfaceObject *wrapper = getDOMWrapper(value))
+        return [[wrapper retain] autorelease];
+    DOMTestCustomConstructorWithNoInterfaceObject *wrapper = [[DOMTestCustomConstructorWithNoInterfaceObject alloc] _init];
+    wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+    value->ref();
+    addDOMWrapper(wrapper, value);
+    return [wrapper autorelease];
+}
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h
new file mode 100644 (file)
index 0000000..aba5472
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import <WebCore/DOMTestCustomConstructorWithNoInterfaceObject.h>
+
+namespace WebCore {
+class TestCustomConstructorWithNoInterfaceObject;
+}
+
+WEBCORE_EXPORT WebCore::TestCustomConstructorWithNoInterfaceObject* core(DOMTestCustomConstructorWithNoInterfaceObject *);
+WEBCORE_EXPORT DOMTestCustomConstructorWithNoInterfaceObject *kit(WebCore::TestCustomConstructorWithNoInterfaceObject*);
diff --git a/Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl b/Source/WebCore/bindings/scripts/test/TestCustomConstructor.idl
new file mode 100644 (file)
index 0000000..fd3bc85
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2015 Canon Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted, provided that the following conditions
+ * are required to be met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Canon Inc. nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    CustomConstructor,
+    NoInterfaceObject
+] interface TestCustomConstructorWithNoInterfaceObject {
+};
+