Diff
Modified: trunk/Source/WebCore/ChangeLog (199102 => 199103)
--- trunk/Source/WebCore/ChangeLog 2016-04-06 16:38:41 UTC (rev 199102)
+++ trunk/Source/WebCore/ChangeLog 2016-04-06 17:33:57 UTC (rev 199103)
@@ -1,3 +1,86 @@
+2016-04-06 Chris Dumez <cdu...@apple.com>
+
+ [IDL] Extend support for [EnabledAtRuntime] attributes / operations to all global objects, not just Window
+ https://bugs.webkit.org/show_bug.cgi?id=156291
+
+ Reviewed by Alex Christensen.
+
+ Extend support for [EnabledAtRuntime] attributes / operations to all
+ global objects, not just Window. This is needed by the Fetch API which
+ is enabled at runtime and exposed on both Window and WorkerGlobalScope.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (IsDOMGlobalObject):
+ (OperationShouldBeOnInstance):
+ (GenerateHeader):
+ (GeneratePropertiesHashTable):
+ (GenerateImplementation):
+ * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp: Added.
+ (WebKit::kit):
+ (WebKit::core):
+ (WebKit::wrapTestGlobalObject):
+ (webkit_dom_test_global_object_finalize):
+ (webkit_dom_test_global_object_set_property):
+ (webkit_dom_test_global_object_get_property):
+ (webkit_dom_test_global_object_constructor):
+ (webkit_dom_test_global_object_class_init):
+ (webkit_dom_test_global_object_init):
+ (webkit_dom_test_global_object_regular_operation):
+ (webkit_dom_test_global_object_enabled_at_runtime_operation):
+ (webkit_dom_test_global_object_get_regular_attribute):
+ (webkit_dom_test_global_object_set_regular_attribute):
+ (webkit_dom_test_global_object_get_enabled_at_runtime_attribute):
+ (webkit_dom_test_global_object_set_enabled_at_runtime_attribute):
+ * bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestGlobalObjectPrivate.h: Added.
+ * bindings/scripts/test/JS/JSTestGlobalObject.cpp: Added.
+ (WebCore::JSTestGlobalObjectConstructor::prototypeForStructure):
+ (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
+ (WebCore::JSTestGlobalObjectPrototype::getOwnPropertySlot):
+ (WebCore::JSTestGlobalObject::JSTestGlobalObject):
+ (WebCore::JSTestGlobalObject::finishCreation):
+ (WebCore::JSTestGlobalObject::destroy):
+ (WebCore::JSTestGlobalObject::getOwnPropertySlot):
+ (WebCore::jsTestGlobalObjectRegularAttribute):
+ (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute):
+ (WebCore::jsTestGlobalObjectConstructor):
+ (WebCore::setJSTestGlobalObjectConstructor):
+ (WebCore::setJSTestGlobalObjectRegularAttribute):
+ (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
+ (WebCore::JSTestGlobalObject::getConstructor):
+ (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
+ (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
+ (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
+ (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
+ (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots):
+ (WebCore::JSTestGlobalObjectOwner::finalize):
+ (WebCore::toJSNewlyCreated):
+ (WebCore::toJS):
+ (WebCore::JSTestGlobalObject::toWrapped):
+ * bindings/scripts/test/JS/JSTestGlobalObject.h: Added.
+ (WebCore::JSTestGlobalObject::create):
+ (WebCore::JSTestGlobalObject::createStructure):
+ (WebCore::JSTestGlobalObject::finishCreation):
+ (WebCore::wrapperOwner):
+ (WebCore::wrapperKey):
+ (WebCore::toJS):
+ (WebCore::JSTestGlobalObjectPrototype::create):
+ (WebCore::JSTestGlobalObjectPrototype::createStructure):
+ (WebCore::JSTestGlobalObjectPrototype::JSTestGlobalObjectPrototype):
+ * bindings/scripts/test/ObjC/DOMTestGlobalObject.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestGlobalObject.mm: Added.
+ (-[DOMTestGlobalObject dealloc]):
+ (-[DOMTestGlobalObject regularAttribute]):
+ (-[DOMTestGlobalObject setRegularAttribute:]):
+ (-[DOMTestGlobalObject enabledAtRuntimeAttribute]):
+ (-[DOMTestGlobalObject setEnabledAtRuntimeAttribute:]):
+ (-[DOMTestGlobalObject regularOperation:]):
+ (-[DOMTestGlobalObject enabledAtRuntimeOperation:]):
+ (core):
+ (kit):
+ * bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h: Added.
+ * bindings/scripts/test/TestGlobalObject.idl: Added.
+
2016-04-06 Brady Eidson <beid...@apple.com>
Update IndexedDB feature status to the much more correct "In Development"
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (199102 => 199103)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-06 16:38:41 UTC (rev 199102)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2016-04-06 17:33:57 UTC (rev 199103)
@@ -378,7 +378,7 @@
sub IsDOMGlobalObject
{
my $interface = shift;
- return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope");
+ return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope") || $interface->name eq "TestGlobalObject";
}
sub GenerateGetOwnPropertySlotBody
@@ -721,11 +721,11 @@
my $interface = shift;
my $function = shift;
- # FIXME: The bindings generator does not support putting runtime-enabled on the instance yet (except for Window).
- return 0 if $function->signature->extendedAttributes->{"EnabledAtRuntime"} && $interface->name ne "DOMWindow";
-
return 1 if IsDOMGlobalObject($interface);
+ # FIXME: The bindings generator does not support putting runtime-enabled on the instance yet (except for global objects).
+ return 0 if $function->signature->extendedAttributes->{"EnabledAtRuntime"};
+
# [Unforgeable] operations should be on the instance.
# https://heycam.github.io/webidl/#Unforgeable
return 1 if IsUnforgeable($interface, $function);
@@ -1247,7 +1247,6 @@
# Constructor
if ($interfaceName eq "DOMWindow") {
push(@headerContent, " $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&, JSDOMWindowShell*);\n");
- push(@headerContent, " void finishCreation(JSC::VM&, JSDOMWindowShell*);\n");
} elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
push(@headerContent, " $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&);\n");
} elsif (!NeedsImplementationClass($interface)) {
@@ -1261,6 +1260,14 @@
push(@headerContent, " }\n\n");
}
+ if (IsDOMGlobalObject($interface)) {
+ if ($interfaceName eq "DOMWindow") {
+ push(@headerContent, " void finishCreation(JSC::VM&, JSDOMWindowShell*);\n");
+ } else {
+ push(@headerContent, " void finishCreation(JSC::VM&);\n");
+ }
+ }
+
# Index setter
if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
push(@headerContent, " void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n");
@@ -1411,8 +1418,8 @@
next if ($attribute->isStatic);
next if AttributeShouldBeOnInstance($interface, $attribute) != $isInstance;
- # DOMWindow adds RuntimeEnabled attributes after creation so do not add them to the static table.
- if ($interfaceName eq "DOMWindow" && $attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
+ # Global objects add RuntimeEnabled attributes after creation so do not add them to the static table.
+ if (IsDOMGlobalObject($interface) && $attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
$propertyCount -= 1;
next;
}
@@ -1448,8 +1455,8 @@
next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
next if $function->signature->name eq "[Symbol.Iterator]";
- # DOMWindow adds RuntimeEnabled operations after creation so do not add them to the static table.
- if ($interfaceName eq "DOMWindow" && $function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
+ # Global objects add RuntimeEnabled operations after creation so do not add them to the static table.
+ if (IsDOMGlobalObject($interface) && $function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
$propertyCount -= 1;
next;
}
@@ -1472,7 +1479,7 @@
if ($function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
if ($isInstance) {
- die "We currently do not support [EnabledAtRuntime] operations on the instance.";
+ die "We currently do not support [EnabledAtRuntime] operations on the instance (except for global objects).";
} else {
push(@$runtimeEnabledFunctions, $function);
}
@@ -2197,11 +2204,33 @@
push(@implContent, " : $parentClassName(vm, structure, WTFMove(impl), shell)\n");
push(@implContent, "{\n");
push(@implContent, "}\n\n");
+ } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
+ AddIncludesForTypeInImpl($interfaceName);
+ push(@implContent, "${className}::$className(VM& vm, Structure* structure, Ref<$implType>&& impl)\n");
+ push(@implContent, " : $parentClassName(vm, structure, WTFMove(impl))\n");
+ push(@implContent, "{\n");
+ push(@implContent, "}\n\n");
+ } elsif (!NeedsImplementationClass($interface)) {
+ push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject& globalObject)\n");
+ push(@implContent, " : $parentClassName(structure, globalObject) { }\n\n");
+ } else {
+ push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject& globalObject, Ref<$implType>&& impl)\n");
+ push(@implContent, " : $parentClassName(structure, globalObject, WTFMove(impl))\n");
+ push(@implContent, "{\n");
+ push(@implContent, "}\n\n");
+ }
- push(@implContent, "void ${className}::finishCreation(VM& vm, JSDOMWindowShell* shell)\n");
- push(@implContent, "{\n");
- push(@implContent, " Base::finishCreation(vm, shell);\n\n");
- # Support for RuntimeEnabled attributes on DOMWindow.
+ if (IsDOMGlobalObject($interface)) {
+ if ($interfaceName eq "DOMWindow") {
+ push(@implContent, "void ${className}::finishCreation(VM& vm, JSDOMWindowShell* shell)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " Base::finishCreation(vm, shell);\n\n");
+ } else {
+ push(@implContent, "void ${className}::finishCreation(VM& vm)\n");
+ push(@implContent, "{\n");
+ push(@implContent, " Base::finishCreation(vm);\n\n");
+ }
+ # Support for RuntimeEnabled attributes on global objects.
foreach my $attribute (@{$interface->attributes}) {
next unless $attribute->signature->extendedAttributes->{"EnabledAtRuntime"};
@@ -2219,7 +2248,7 @@
push(@implContent, " }\n");
push(@implContent, "#endif\n") if $conditionalString;
}
- # Support for RuntimeEnabled operations on DOMWindow.
+ # Support for RuntimeEnabled operations on global objects.
foreach my $function (@{$interface->functions}) {
next unless $function->signature->extendedAttributes->{"EnabledAtRuntime"};
next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
@@ -2237,23 +2266,7 @@
push(@implContent, "#endif\n") if $conditionalString;
}
push(@implContent, "}\n\n");
- } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
- AddIncludesForTypeInImpl($interfaceName);
- push(@implContent, "${className}::$className(VM& vm, Structure* structure, Ref<$implType>&& impl)\n");
- push(@implContent, " : $parentClassName(vm, structure, WTFMove(impl))\n");
- push(@implContent, "{\n");
- push(@implContent, "}\n\n");
- } elsif (!NeedsImplementationClass($interface)) {
- push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject& globalObject)\n");
- push(@implContent, " : $parentClassName(structure, globalObject) { }\n\n");
} else {
- push(@implContent, "${className}::$className(Structure* structure, JSDOMGlobalObject& globalObject, Ref<$implType>&& impl)\n");
- push(@implContent, " : $parentClassName(structure, globalObject, WTFMove(impl))\n");
- push(@implContent, "{\n");
- push(@implContent, "}\n\n");
- }
-
- unless (IsDOMGlobalObject($interface)) {
push(@implContent, "JSObject* ${className}::createPrototype(VM& vm, JSGlobalObject* globalObject)\n");
push(@implContent, "{\n");
if ($hasParent && $parentClassName ne "JSC::DOMNodeFilter") {
Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,257 @@
+/*
+ * 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 "WebKitDOMTestGlobalObject.h"
+
+#include "CSSImportRule.h"
+#include "DOMObjectCache.h"
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "ExceptionCodeDescription.h"
+#include "JSMainThreadExecState.h"
+#include "WebKitDOMPrivate.h"
+#include "WebKitDOMTestGlobalObjectPrivate.h"
+#include "gobject/ConvertToUTF8String.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+#define WEBKIT_DOM_TEST_GLOBAL_OBJECT_GET_PRIVATE(obj) G_TYPE_INSTANCE_GET_PRIVATE(obj, WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT, WebKitDOMTestGlobalObjectPrivate)
+
+typedef struct _WebKitDOMTestGlobalObjectPrivate {
+ RefPtr<WebCore::TestGlobalObject> coreObject;
+} WebKitDOMTestGlobalObjectPrivate;
+
+namespace WebKit {
+
+WebKitDOMTestGlobalObject* kit(WebCore::TestGlobalObject* obj)
+{
+ if (!obj)
+ return 0;
+
+ if (gpointer ret = DOMObjectCache::get(obj))
+ return WEBKIT_DOM_TEST_GLOBAL_OBJECT(ret);
+
+ return wrapTestGlobalObject(obj);
+}
+
+WebCore::TestGlobalObject* core(WebKitDOMTestGlobalObject* request)
+{
+ return request ? static_cast<WebCore::TestGlobalObject*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0;
+}
+
+WebKitDOMTestGlobalObject* wrapTestGlobalObject(WebCore::TestGlobalObject* coreObject)
+{
+ ASSERT(coreObject);
+ return WEBKIT_DOM_TEST_GLOBAL_OBJECT(g_object_new(WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT, "core-object", coreObject, nullptr));
+}
+
+} // namespace WebKit
+
+G_DEFINE_TYPE(WebKitDOMTestGlobalObject, webkit_dom_test_global_object, WEBKIT_DOM_TYPE_OBJECT)
+
+enum {
+ PROP_0,
+ PROP_REGULAR_ATTRIBUTE,
+ PROP_ENABLED_AT_RUNTIME_ATTRIBUTE,
+};
+
+static void webkit_dom_test_global_object_finalize(GObject* object)
+{
+ WebKitDOMTestGlobalObjectPrivate* priv = WEBKIT_DOM_TEST_GLOBAL_OBJECT_GET_PRIVATE(object);
+
+ WebKit::DOMObjectCache::forget(priv->coreObject.get());
+
+ priv->~WebKitDOMTestGlobalObjectPrivate();
+ G_OBJECT_CLASS(webkit_dom_test_global_object_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_global_object_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
+{
+ WebKitDOMTestGlobalObject* self = WEBKIT_DOM_TEST_GLOBAL_OBJECT(object);
+
+ switch (propertyId) {
+ case PROP_REGULAR_ATTRIBUTE:
+ webkit_dom_test_global_object_set_regular_attribute(self, g_value_get_string(value));
+ break;
+ case PROP_ENABLED_AT_RUNTIME_ATTRIBUTE:
+ webkit_dom_test_global_object_set_enabled_at_runtime_attribute(self, g_value_get_string(value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
+ break;
+ }
+}
+
+static void webkit_dom_test_global_object_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
+{
+ WebKitDOMTestGlobalObject* self = WEBKIT_DOM_TEST_GLOBAL_OBJECT(object);
+
+ switch (propertyId) {
+ case PROP_REGULAR_ATTRIBUTE:
+ g_value_take_string(value, webkit_dom_test_global_object_get_regular_attribute(self));
+ break;
+ case PROP_ENABLED_AT_RUNTIME_ATTRIBUTE:
+ g_value_take_string(value, webkit_dom_test_global_object_get_enabled_at_runtime_attribute(self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
+ break;
+ }
+}
+
+static GObject* webkit_dom_test_global_object_constructor(GType type, guint constructPropertiesCount, GObjectConstructParam* constructProperties)
+{
+ GObject* object = G_OBJECT_CLASS(webkit_dom_test_global_object_parent_class)->constructor(type, constructPropertiesCount, constructProperties);
+
+ WebKitDOMTestGlobalObjectPrivate* priv = WEBKIT_DOM_TEST_GLOBAL_OBJECT_GET_PRIVATE(object);
+ priv->coreObject = static_cast<WebCore::TestGlobalObject*>(WEBKIT_DOM_OBJECT(object)->coreObject);
+ WebKit::DOMObjectCache::put(priv->coreObject.get(), object);
+
+ return object;
+}
+
+static void webkit_dom_test_global_object_class_init(WebKitDOMTestGlobalObjectClass* requestClass)
+{
+ GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);
+ g_type_class_add_private(gobjectClass, sizeof(WebKitDOMTestGlobalObjectPrivate));
+ gobjectClass->constructor = webkit_dom_test_global_object_constructor;
+ gobjectClass->finalize = webkit_dom_test_global_object_finalize;
+ gobjectClass->set_property = webkit_dom_test_global_object_set_property;
+ gobjectClass->get_property = webkit_dom_test_global_object_get_property;
+
+ g_object_class_install_property(
+ gobjectClass,
+ PROP_REGULAR_ATTRIBUTE,
+ g_param_spec_string(
+ "regular-attribute",
+ "TestGlobalObject:regular-attribute",
+ "read-write gchar* TestGlobalObject:regular-attribute",
+ "",
+ WEBKIT_PARAM_READWRITE));
+
+ g_object_class_install_property(
+ gobjectClass,
+ PROP_ENABLED_AT_RUNTIME_ATTRIBUTE,
+ g_param_spec_string(
+ "enabled-at-runtime-attribute",
+ "TestGlobalObject:enabled-at-runtime-attribute",
+ "read-write gchar* TestGlobalObject:enabled-at-runtime-attribute",
+ "",
+ WEBKIT_PARAM_READWRITE));
+
+}
+
+static void webkit_dom_test_global_object_init(WebKitDOMTestGlobalObject* request)
+{
+ WebKitDOMTestGlobalObjectPrivate* priv = WEBKIT_DOM_TEST_GLOBAL_OBJECT_GET_PRIVATE(request);
+ new (priv) WebKitDOMTestGlobalObjectPrivate();
+}
+
+void webkit_dom_test_global_object_regular_operation(WebKitDOMTestGlobalObject* self, const gchar* testParam)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self));
+ g_return_if_fail(testParam);
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ WTF::String convertedTestParam = WTF::String::fromUTF8(testParam);
+ item->regularOperation(convertedTestParam);
+}
+
+void webkit_dom_test_global_object_enabled_at_runtime_operation(WebKitDOMTestGlobalObject* self, const gchar* testParam)
+{
+#if ENABLE(TEST_FEATURE)
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self));
+ g_return_if_fail(testParam);
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ WTF::String convertedTestParam = WTF::String::fromUTF8(testParam);
+ item->enabledAtRuntimeOperation(convertedTestParam);
+#else
+ UNUSED_PARAM(self);
+ UNUSED_PARAM(testParam);
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Test Feature")
+#endif /* ENABLE(TEST_FEATURE) */
+}
+
+void webkit_dom_test_global_object_enabled_at_runtime_operation(WebKitDOMTestGlobalObject* self, glong testParam)
+{
+#if ENABLE(TEST_FEATURE)
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self));
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ item->enabledAtRuntimeOperation(testParam);
+#else
+ UNUSED_PARAM(self);
+ UNUSED_PARAM(testParam);
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Test Feature")
+#endif /* ENABLE(TEST_FEATURE) */
+}
+
+gchar* webkit_dom_test_global_object_get_regular_attribute(WebKitDOMTestGlobalObject* self)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self), 0);
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ gchar* result = convertToUTF8String(item->regularAttribute());
+ return result;
+}
+
+void webkit_dom_test_global_object_set_regular_attribute(WebKitDOMTestGlobalObject* self, const gchar* value)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self));
+ g_return_if_fail(value);
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ WTF::String convertedValue = WTF::String::fromUTF8(value);
+ item->setRegularAttribute(convertedValue);
+}
+
+gchar* webkit_dom_test_global_object_get_enabled_at_runtime_attribute(WebKitDOMTestGlobalObject* self)
+{
+#if ENABLE(TEST_FEATURE)
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self), 0);
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ gchar* result = convertToUTF8String(item->enabledAtRuntimeAttribute());
+ return result;
+#else
+ UNUSED_PARAM(self);
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Test Feature")
+ return 0;
+#endif /* ENABLE(TEST_FEATURE) */
+}
+
+void webkit_dom_test_global_object_set_enabled_at_runtime_attribute(WebKitDOMTestGlobalObject* self, const gchar* value)
+{
+#if ENABLE(TEST_FEATURE)
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(self));
+ g_return_if_fail(value);
+ WebCore::TestGlobalObject* item = WebKit::core(self);
+ WTF::String convertedValue = WTF::String::fromUTF8(value);
+ item->setEnabledAtRuntimeAttribute(convertedValue);
+#else
+ UNUSED_PARAM(self);
+ UNUSED_PARAM(value);
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Test Feature")
+#endif /* ENABLE(TEST_FEATURE) */
+}
+
Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,125 @@
+/*
+ * 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 WebKitDOMTestGlobalObject_h
+#define WebKitDOMTestGlobalObject_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_GLOBAL_OBJECT (webkit_dom_test_global_object_get_type())
+#define WEBKIT_DOM_TEST_GLOBAL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT, WebKitDOMTestGlobalObject))
+#define WEBKIT_DOM_TEST_GLOBAL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT, WebKitDOMTestGlobalObjectClass)
+#define WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT))
+#define WEBKIT_DOM_IS_TEST_GLOBAL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT))
+#define WEBKIT_DOM_TEST_GLOBAL_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_DOM_TYPE_TEST_GLOBAL_OBJECT, WebKitDOMTestGlobalObjectClass))
+
+struct _WebKitDOMTestGlobalObject {
+ WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestGlobalObjectClass {
+ WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_global_object_get_type(void);
+
+/**
+ * webkit_dom_test_global_object_regular_operation:
+ * @self: A #WebKitDOMTestGlobalObject
+ * @testParam: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_global_object_regular_operation(WebKitDOMTestGlobalObject* self, const gchar* testParam);
+
+/**
+ * webkit_dom_test_global_object_enabled_at_runtime_operation:
+ * @self: A #WebKitDOMTestGlobalObject
+ * @testParam: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_global_object_enabled_at_runtime_operation(WebKitDOMTestGlobalObject* self, const gchar* testParam);
+
+/**
+ * webkit_dom_test_global_object_enabled_at_runtime_operation:
+ * @self: A #WebKitDOMTestGlobalObject
+ * @testParam: A #glong
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_global_object_enabled_at_runtime_operation(WebKitDOMTestGlobalObject* self, glong testParam);
+
+/**
+ * webkit_dom_test_global_object_get_regular_attribute:
+ * @self: A #WebKitDOMTestGlobalObject
+ *
+ * Returns: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API gchar*
+webkit_dom_test_global_object_get_regular_attribute(WebKitDOMTestGlobalObject* self);
+
+/**
+ * webkit_dom_test_global_object_set_regular_attribute:
+ * @self: A #WebKitDOMTestGlobalObject
+ * @value: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_global_object_set_regular_attribute(WebKitDOMTestGlobalObject* self, const gchar* value);
+
+/**
+ * webkit_dom_test_global_object_get_enabled_at_runtime_attribute:
+ * @self: A #WebKitDOMTestGlobalObject
+ *
+ * Returns: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API gchar*
+webkit_dom_test_global_object_get_enabled_at_runtime_attribute(WebKitDOMTestGlobalObject* self);
+
+/**
+ * webkit_dom_test_global_object_set_enabled_at_runtime_attribute:
+ * @self: A #WebKitDOMTestGlobalObject
+ * @value: A #gchar
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_global_object_set_enabled_at_runtime_attribute(WebKitDOMTestGlobalObject* self, const gchar* value);
+
+G_END_DECLS
+
+#endif /* WEBKIT_DOM_USE_UNSTABLE_API */
+#endif /* WebKitDOMTestGlobalObject_h */
Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObjectPrivate.h (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObjectPrivate.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObjectPrivate.h 2016-04-06 17:33:57 UTC (rev 199103)
@@ -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 WebKitDOMTestGlobalObjectPrivate_h
+#define WebKitDOMTestGlobalObjectPrivate_h
+
+#include "TestGlobalObject.h"
+#include <webkitdom/WebKitDOMTestGlobalObject.h>
+
+namespace WebKit {
+WebKitDOMTestGlobalObject* wrapTestGlobalObject(WebCore::TestGlobalObject*);
+WebKitDOMTestGlobalObject* kit(WebCore::TestGlobalObject*);
+WebCore::TestGlobalObject* core(WebKitDOMTestGlobalObject*);
+} // namespace WebKit
+
+#endif /* WebKitDOMTestGlobalObjectPrivate_h */
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,389 @@
+/*
+ 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 "JSTestGlobalObject.h"
+
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "JSDOMConstructor.h"
+#include "RuntimeEnabledFeatures.h"
+#include "URL.h"
+#include <runtime/Error.h>
+#include <runtime/FunctionPrototype.h>
+#include <runtime/JSString.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestGlobalObjectInstanceFunctionRegularOperation(JSC::ExecState*);
+#if ENABLE(TEST_FEATURE)
+JSC::EncodedJSValue JSC_HOST_CALL jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation(JSC::ExecState*);
+#endif
+
+// Attributes
+
+JSC::EncodedJSValue jsTestGlobalObjectRegularAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestGlobalObjectRegularAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+#if ENABLE(TEST_FEATURE)
+JSC::EncodedJSValue jsTestGlobalObjectEnabledAtRuntimeAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestGlobalObjectEnabledAtRuntimeAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+#endif
+JSC::EncodedJSValue jsTestGlobalObjectConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+bool setJSTestGlobalObjectConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+
+typedef JSDOMConstructorNotConstructable<JSTestGlobalObject> JSTestGlobalObjectConstructor;
+
+/* Hash table */
+
+static const struct CompactHashIndex JSTestGlobalObjectTableIndex[8] = {
+ { -1, -1 },
+ { 1, -1 },
+ { -1, -1 },
+ { 0, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+ { -1, -1 },
+};
+
+
+static const HashTableValue JSTestGlobalObjectTableValues[] =
+{
+ { "regularAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectRegularAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectRegularAttribute) } },
+ { "regularOperation", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestGlobalObjectInstanceFunctionRegularOperation), (intptr_t) (1) } },
+};
+
+static const HashTable JSTestGlobalObjectTable = { 2, 7, true, JSTestGlobalObjectTableValues, JSTestGlobalObjectTableIndex };
+template<> JSValue JSTestGlobalObjectConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
+{
+ UNUSED_PARAM(vm);
+ return globalObject.functionPrototype();
+}
+
+template<> void JSTestGlobalObjectConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
+{
+ putDirect(vm, vm.propertyNames->prototype, globalObject.getPrototypeDirect(), DontDelete | ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestGlobalObject"))), ReadOnly | DontEnum);
+ putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
+}
+
+template<> const ClassInfo JSTestGlobalObjectConstructor::s_info = { "TestGlobalObject", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestGlobalObjectConstructor) };
+
+/* Hash table for prototype */
+
+static const struct CompactHashIndex JSTestGlobalObjectPrototypeTableIndex[2] = {
+ { -1, -1 },
+ { 0, -1 },
+};
+
+
+static const HashTableValue JSTestGlobalObjectPrototypeTableValues[] =
+{
+ { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestGlobalObjectConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestGlobalObjectConstructor) } },
+};
+
+static const HashTable JSTestGlobalObjectPrototypeTable = { 1, 1, true, JSTestGlobalObjectPrototypeTableValues, JSTestGlobalObjectPrototypeTableIndex };
+const ClassInfo JSTestGlobalObjectPrototype::s_info = { "TestGlobalObjectPrototype", &Base::s_info, &JSTestGlobalObjectPrototypeTable, CREATE_METHOD_TABLE(JSTestGlobalObjectPrototype) };
+
+bool JSTestGlobalObjectPrototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+ VM& vm = state->vm();
+ UNUSED_PARAM(vm);
+ auto* thisObject = jsCast<JSTestGlobalObjectPrototype*>(object);
+ return getStaticPropertySlot<JSTestGlobalObjectPrototype, JSObject>(state, JSTestGlobalObjectPrototypeTable, thisObject, propertyName, slot);
+}
+
+const ClassInfo JSTestGlobalObject::s_info = { "TestGlobalObject", &Base::s_info, &JSTestGlobalObjectTable, CREATE_METHOD_TABLE(JSTestGlobalObject) };
+
+JSTestGlobalObject::JSTestGlobalObject(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestGlobalObject>&& impl)
+ : JSDOMWrapper<TestGlobalObject>(structure, globalObject, WTFMove(impl))
+{
+}
+
+void JSTestGlobalObject::finishCreation(VM& vm)
+{
+ Base::finishCreation(vm);
+
+#if ENABLE(TEST_FEATURE)
+ if (RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled()) {
+ auto* customGetterSetter = CustomGetterSetter::create(vm, jsTestGlobalObjectEnabledAtRuntimeAttribute, setJSTestGlobalObjectEnabledAtRuntimeAttribute);
+ putDirectCustomAccessor(vm, vm.propertyNames->enabledAtRuntimeAttribute, customGetterSetter, attributesForStructure(CustomAccessor));
+ }
+#endif
+#if ENABLE(TEST_FEATURE)
+ if (RuntimeEnabledFeatures::sharedFeatures().testFeatureEnabled())
+ putDirectNativeFunction(vm, this, vm.propertyNames->enabledAtRuntimeOperation, 1, jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation, NoIntrinsic, attributesForStructure(JSC::Function));
+#endif
+}
+
+void JSTestGlobalObject::destroy(JSC::JSCell* cell)
+{
+ JSTestGlobalObject* thisObject = static_cast<JSTestGlobalObject*>(cell);
+ thisObject->JSTestGlobalObject::~JSTestGlobalObject();
+}
+
+bool JSTestGlobalObject::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
+{
+ auto* thisObject = jsCast<JSTestGlobalObject*>(object);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, info());
+ if (getStaticPropertySlot<JSTestGlobalObject, Base>(state, JSTestGlobalObjectTable, thisObject, propertyName, slot))
+ return true;
+ return false;
+}
+
+EncodedJSValue jsTestGlobalObjectRegularAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(thisValue);
+ JSValue decodedThisValue = JSValue::decode(thisValue);
+ auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue);
+ if (UNLIKELY(!castedThis)) {
+ return throwGetterTypeError(*state, "TestGlobalObject", "regularAttribute");
+ }
+ auto& impl = castedThis->wrapped();
+ JSValue result = jsStringWithCache(state, impl.regularAttribute());
+ return JSValue::encode(result);
+}
+
+
+#if ENABLE(TEST_FEATURE)
+EncodedJSValue jsTestGlobalObjectEnabledAtRuntimeAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(thisValue);
+ JSValue decodedThisValue = JSValue::decode(thisValue);
+ auto* castedThis = jsDynamicCast<JSTestGlobalObject*>(decodedThisValue);
+ if (UNLIKELY(!castedThis)) {
+ return throwGetterTypeError(*state, "TestGlobalObject", "enabledAtRuntimeAttribute");
+ }
+ auto& impl = castedThis->wrapped();
+ JSValue result = jsStringWithCache(state, impl.enabledAtRuntimeAttribute());
+ return JSValue::encode(result);
+}
+
+#endif
+
+EncodedJSValue jsTestGlobalObjectConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+ JSTestGlobalObjectPrototype* domObject = jsDynamicCast<JSTestGlobalObjectPrototype*>(JSValue::decode(thisValue));
+ if (!domObject)
+ return throwVMTypeError(state);
+ return JSValue::encode(JSTestGlobalObject::getConstructor(state->vm(), domObject->globalObject()));
+}
+
+bool setJSTestGlobalObjectConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ JSTestGlobalObjectPrototype* domObject = jsDynamicCast<JSTestGlobalObjectPrototype*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!domObject)) {
+ throwVMTypeError(state);
+ return false;
+ }
+ // Shadowing a built-in constructor
+ return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
+}
+
+bool setJSTestGlobalObjectRegularAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(thisValue);
+ JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ return throwSetterTypeError(*state, "TestGlobalObject", "regularAttribute");
+ }
+ auto& impl = castedThis->wrapped();
+ String nativeValue = value.toString(state)->value(state);
+ if (UNLIKELY(state->hadException()))
+ return false;
+ impl.setRegularAttribute(nativeValue);
+ return true;
+}
+
+
+#if ENABLE(TEST_FEATURE)
+bool setJSTestGlobalObjectEnabledAtRuntimeAttribute(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(thisValue);
+ JSTestGlobalObject* castedThis = jsDynamicCast<JSTestGlobalObject*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ return throwSetterTypeError(*state, "TestGlobalObject", "enabledAtRuntimeAttribute");
+ }
+ auto& impl = castedThis->wrapped();
+ String nativeValue = value.toString(state)->value(state);
+ if (UNLIKELY(state->hadException()))
+ return false;
+ impl.setEnabledAtRuntimeAttribute(nativeValue);
+ return true;
+}
+
+#endif
+
+JSValue JSTestGlobalObject::getConstructor(VM& vm, const JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestGlobalObjectConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestGlobalObjectInstanceFunctionRegularOperation(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestGlobalObject*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestGlobalObject", "regularOperation");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestGlobalObject::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ String testParam = state->argument(0).toString(state)->value(state);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.regularOperation(testParam);
+ return JSValue::encode(jsUndefined());
+}
+
+#if ENABLE(TEST_FEATURE)
+static inline EncodedJSValue jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestGlobalObject*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestGlobalObject", "enabledAtRuntimeOperation");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestGlobalObject::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ String testParam = state->argument(0).toString(state)->value(state);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.enabledAtRuntimeOperation(testParam);
+ return JSValue::encode(jsUndefined());
+}
+
+#endif
+
+#if ENABLE(TEST_FEATURE)
+static inline EncodedJSValue jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(ExecState* state)
+{
+ JSValue thisValue = state->thisValue();
+ auto castedThis = jsDynamicCast<JSTestGlobalObject*>(thisValue);
+ if (UNLIKELY(!castedThis))
+ return throwThisTypeError(*state, "TestGlobalObject", "enabledAtRuntimeOperation");
+ ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestGlobalObject::info());
+ auto& impl = castedThis->wrapped();
+ if (UNLIKELY(state->argumentCount() < 1))
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ int testParam = toInt32(state, state->argument(0), NormalConversion);
+ if (UNLIKELY(state->hadException()))
+ return JSValue::encode(jsUndefined());
+ impl.enabledAtRuntimeOperation(testParam);
+ return JSValue::encode(jsUndefined());
+}
+
+#endif
+
+EncodedJSValue JSC_HOST_CALL jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation(ExecState* state)
+{
+ size_t argsCount = std::min<size_t>(1, state->argumentCount());
+#if ENABLE(TEST_FEATURE)
+ if (argsCount == 1)
+ return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1(state);
+#endif
+
+#if ENABLE(TEST_FEATURE)
+ if (argsCount == 1)
+ return jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2(state);
+#endif
+
+ if (argsCount < 1)
+ return throwVMError(state, createNotEnoughArgumentsError(state));
+ return throwVMTypeError(state);
+}
+
+bool JSTestGlobalObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ UNUSED_PARAM(handle);
+ UNUSED_PARAM(visitor);
+ return false;
+}
+
+void JSTestGlobalObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+ auto* jsTestGlobalObject = jsCast<JSTestGlobalObject*>(handle.slot()->asCell());
+ auto& world = *static_cast<DOMWrapperWorld*>(context);
+ uncacheWrapper(world, &jsTestGlobalObject->wrapped(), jsTestGlobalObject);
+}
+
+#if ENABLE(BINDING_INTEGRITY)
+#if PLATFORM(WIN)
+#pragma warning(disable: 4483)
+extern "C" { extern void (*const __identifier("??_7TestGlobalObject@WebCore@@6B@")[])(); }
+#else
+extern "C" { extern void* _ZTVN7WebCore16TestGlobalObjectE[]; }
+#endif
+#endif
+
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGlobalObject* impl)
+{
+ if (!impl)
+ return jsNull();
+ return createNewWrapper<JSTestGlobalObject>(globalObject, impl);
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestGlobalObject* impl)
+{
+ if (!impl)
+ return jsNull();
+ if (JSValue result = getExistingWrapper<JSTestGlobalObject>(globalObject, impl))
+ return result;
+
+#if ENABLE(BINDING_INTEGRITY)
+ void* actualVTablePointer = *(reinterpret_cast<void**>(impl));
+#if PLATFORM(WIN)
+ void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestGlobalObject@WebCore@@6B@"));
+#else
+ void* expectedVTablePointer = &_ZTVN7WebCore16TestGlobalObjectE[2];
+#if COMPILER(CLANG)
+ // If this fails TestGlobalObject does not have a vtable, so you need to add the
+ // ImplementationLacksVTable attribute to the interface definition
+ COMPILE_ASSERT(__is_polymorphic(TestGlobalObject), TestGlobalObject_is_not_polymorphic);
+#endif
+#endif
+ // If you hit this assertion you either have a use after free bug, or
+ // TestGlobalObject has subclasses. If TestGlobalObject has subclasses that get passed
+ // to toJS() we currently require TestGlobalObject you to opt out of binding hardening
+ // by adding the SkipVTableValidation attribute to the interface IDL definition
+ RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
+#endif
+ return createNewWrapper<JSTestGlobalObject>(globalObject, impl);
+}
+
+TestGlobalObject* JSTestGlobalObject::toWrapped(JSC::JSValue value)
+{
+ if (auto* wrapper = jsDynamicCast<JSTestGlobalObject*>(value))
+ return &wrapper->wrapped();
+ return nullptr;
+}
+
+}
Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,123 @@
+/*
+ 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 JSTestGlobalObject_h
+#define JSTestGlobalObject_h
+
+#include "JSDOMWrapper.h"
+#include "TestGlobalObject.h"
+#include <wtf/NeverDestroyed.h>
+
+namespace WebCore {
+
+class TestGlobalObject;
+
+class JSTestGlobalObject : public JSDOMWrapper<TestGlobalObject> {
+public:
+ typedef JSDOMWrapper<TestGlobalObject> Base;
+ static JSTestGlobalObject* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestGlobalObject>&& impl)
+ {
+ JSTestGlobalObject* ptr = new (NotNull, JSC::allocateCell<JSTestGlobalObject>(globalObject->vm().heap)) JSTestGlobalObject(structure, *globalObject, WTFMove(impl));
+ ptr->finishCreation(globalObject->vm());
+ return ptr;
+ }
+
+ static const bool needsDestruction = false;
+
+ static const bool hasStaticPropertyTable = true;
+
+ static TestGlobalObject* toWrapped(JSC::JSValue);
+ static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+ static void destroy(JSC::JSCell*);
+
+ 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::GlobalObjectType, StructureFlags), info());
+ }
+
+ static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
+public:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+protected:
+ JSTestGlobalObject(JSC::Structure*, JSDOMGlobalObject&, Ref<TestGlobalObject>&&);
+
+ void finishCreation(JSC::VM& vm)
+ {
+ Base::finishCreation(vm);
+ ASSERT(inherits(info()));
+ }
+
+ void finishCreation(JSC::VM&);
+};
+
+class JSTestGlobalObjectOwner : 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&, TestGlobalObject*)
+{
+ static NeverDestroyed<JSTestGlobalObjectOwner> owner;
+ return &owner.get();
+}
+
+inline void* wrapperKey(TestGlobalObject* wrappableObject)
+{
+ return wrappableObject;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestGlobalObject*);
+inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestGlobalObject& impl) { return toJS(state, globalObject, &impl); }
+JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, TestGlobalObject*);
+
+class JSTestGlobalObjectPrototype : public JSC::JSNonFinalObject {
+public:
+ typedef JSC::JSNonFinalObject Base;
+ static JSTestGlobalObjectPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSTestGlobalObjectPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestGlobalObjectPrototype>(vm.heap)) JSTestGlobalObjectPrototype(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:
+ JSTestGlobalObjectPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
+ : JSC::JSNonFinalObject(vm, structure)
+ {
+ }
+
+ static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
+public:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+
+} // namespace WebCore
+
+#endif
Added: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.h (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.h 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.wei...@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>
+
+@class NSString;
+
+WEBKIT_CLASS_AVAILABLE_MAC(9876_5)
+WEBCORE_EXPORT @interface DOMTestGlobalObject : DOMObject
+@property (copy) NSString *regularAttribute;
+@property (copy) NSString *enabledAtRuntimeAttribute;
+
+- (void)regularOperation:(NSString *)testParam;
+@end
Added: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.mm (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.mm (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.mm 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,128 @@
+/*
+ * 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 "DOMTestGlobalObject.h"
+
+#import "DOMNodeInternal.h"
+#import "DOMTestGlobalObjectInternal.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "TestGlobalObject.h"
+#import "ThreadCheck.h"
+#import "URL.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestGlobalObject*>(_internal)
+
+@implementation DOMTestGlobalObject
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestGlobalObject class], self))
+ return;
+
+ if (_internal)
+ IMPL->deref();
+ [super dealloc];
+}
+
+- (NSString *)regularAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->regularAttribute();
+}
+
+- (void)setRegularAttribute:(NSString *)newRegularAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setRegularAttribute(newRegularAttribute);
+}
+
+#if ENABLE(TEST_FEATURE)
+- (NSString *)enabledAtRuntimeAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->enabledAtRuntimeAttribute();
+}
+
+- (void)setEnabledAtRuntimeAttribute:(NSString *)newEnabledAtRuntimeAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setEnabledAtRuntimeAttribute(newEnabledAtRuntimeAttribute);
+}
+#endif
+
+- (void)regularOperation:(NSString *)testParam
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->regularOperation(testParam);
+}
+
+
+#if ENABLE(TEST_FEATURE)
+- (void)enabledAtRuntimeOperation:(NSString *)testParam
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->enabledAtRuntimeOperation(testParam);
+}
+
+#endif
+
+
+#if ENABLE(TEST_FEATURE)
+- (void)enabledAtRuntimeOperation:(int)testParam
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->enabledAtRuntimeOperation(testParam);
+}
+
+#endif
+
+@end
+
+WebCore::TestGlobalObject* core(DOMTestGlobalObject *wrapper)
+{
+ return wrapper ? reinterpret_cast<WebCore::TestGlobalObject*>(wrapper->_internal) : 0;
+}
+
+DOMTestGlobalObject *kit(WebCore::TestGlobalObject* value)
+{
+ WebCoreThreadViolationCheckRoundOne();
+ if (!value)
+ return nil;
+ if (DOMTestGlobalObject *wrapper = getDOMWrapper(value))
+ return [[wrapper retain] autorelease];
+ DOMTestGlobalObject *wrapper = [[DOMTestGlobalObject alloc] _init];
+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+ value->ref();
+ addDOMWrapper(wrapper, value);
+ return [wrapper autorelease];
+}
Added: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h 2016-04-06 17:33:57 UTC (rev 199103)
@@ -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/DOMTestGlobalObject.h>
+
+namespace WebCore {
+class TestGlobalObject;
+}
+
+WEBCORE_EXPORT WebCore::TestGlobalObject* core(DOMTestGlobalObject *);
+WEBCORE_EXPORT DOMTestGlobalObject *kit(WebCore::TestGlobalObject*);
Added: trunk/Source/WebCore/bindings/scripts/test/TestGlobalObject.idl (0 => 199103)
--- trunk/Source/WebCore/bindings/scripts/test/TestGlobalObject.idl (rev 0)
+++ trunk/Source/WebCore/bindings/scripts/test/TestGlobalObject.idl 2016-04-06 17:33:57 UTC (rev 199103)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+// This interface is recognized as a global object by the bindings generator.
+interface TestGlobalObject {
+ attribute DOMString regularAttribute;
+ [Conditional=TEST_FEATURE, EnabledAtRuntime=TestFeature] attribute DOMString enabledAtRuntimeAttribute;
+ void regularOperation(DOMString testParam);
+ [Conditional=TEST_FEATURE, EnabledAtRuntime=TestFeature] void enabledAtRuntimeOperation(DOMString testParam);
+ [Conditional=TEST_FEATURE, EnabledAtRuntime=TestFeature] void enabledAtRuntimeOperation(long testParam);
+};