<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[199103] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199103">199103</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-04-06 10:33:57 -0700 (Wed, 06 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>[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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestGlobalObjecth">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestGlobalObjectPrivateh">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObjectPrivate.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestGlobalObjecth">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestGlobalObjectmm">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestGlobalObjectInternalh">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestGlobalObjectidl">trunk/Source/WebCore/bindings/scripts/test/TestGlobalObject.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199102 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,86 @@
</span><ins>+2016-04-06 Chris Dumez <cdumez@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.
+
</ins><span class="cx"> 2016-04-06 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><span class="cx"> Update IndexedDB feature status to the much more correct "In Development"
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (199102 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx"> sub IsDOMGlobalObject
</span><span class="cx"> {
</span><span class="cx"> my $interface = shift;
</span><del>- return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope");
</del><ins>+ return $interface->name eq "DOMWindow" || $codeGenerator->InheritsInterface($interface, "WorkerGlobalScope") || $interface->name eq "TestGlobalObject";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> sub GenerateGetOwnPropertySlotBody
</span><span class="lines">@@ -721,11 +721,11 @@
</span><span class="cx"> my $interface = shift;
</span><span class="cx"> my $function = shift;
</span><span class="cx">
</span><del>- # 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";
-
</del><span class="cx"> return 1 if IsDOMGlobalObject($interface);
</span><span class="cx">
</span><ins>+ # 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"};
+
</ins><span class="cx"> # [Unforgeable] operations should be on the instance.
</span><span class="cx"> # https://heycam.github.io/webidl/#Unforgeable
</span><span class="cx"> return 1 if IsUnforgeable($interface, $function);
</span><span class="lines">@@ -1247,7 +1247,6 @@
</span><span class="cx"> # Constructor
</span><span class="cx"> if ($interfaceName eq "DOMWindow") {
</span><span class="cx"> push(@headerContent, " $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&, JSDOMWindowShell*);\n");
</span><del>- push(@headerContent, " void finishCreation(JSC::VM&, JSDOMWindowShell*);\n");
</del><span class="cx"> } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
</span><span class="cx"> push(@headerContent, " $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&);\n");
</span><span class="cx"> } elsif (!NeedsImplementationClass($interface)) {
</span><span class="lines">@@ -1261,6 +1260,14 @@
</span><span class="cx"> push(@headerContent, " }\n\n");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (IsDOMGlobalObject($interface)) {
+ if ($interfaceName eq "DOMWindow") {
+ push(@headerContent, " void finishCreation(JSC::VM&, JSDOMWindowShell*);\n");
+ } else {
+ push(@headerContent, " void finishCreation(JSC::VM&);\n");
+ }
+ }
+
</ins><span class="cx"> # Index setter
</span><span class="cx"> if ($interface->extendedAttributes->{"CustomIndexedSetter"}) {
</span><span class="cx"> push(@headerContent, " void indexSetter(JSC::ExecState*, unsigned index, JSC::JSValue);\n");
</span><span class="lines">@@ -1411,8 +1418,8 @@
</span><span class="cx"> next if ($attribute->isStatic);
</span><span class="cx"> next if AttributeShouldBeOnInstance($interface, $attribute) != $isInstance;
</span><span class="cx">
</span><del>- # DOMWindow adds RuntimeEnabled attributes after creation so do not add them to the static table.
- if ($interfaceName eq "DOMWindow" && $attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
</del><ins>+ # Global objects add RuntimeEnabled attributes after creation so do not add them to the static table.
+ if (IsDOMGlobalObject($interface) && $attribute->signature->extendedAttributes->{"EnabledAtRuntime"}) {
</ins><span class="cx"> $propertyCount -= 1;
</span><span class="cx"> next;
</span><span class="cx"> }
</span><span class="lines">@@ -1448,8 +1455,8 @@
</span><span class="cx"> next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
</span><span class="cx"> next if $function->signature->name eq "[Symbol.Iterator]";
</span><span class="cx">
</span><del>- # DOMWindow adds RuntimeEnabled operations after creation so do not add them to the static table.
- if ($interfaceName eq "DOMWindow" && $function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
</del><ins>+ # Global objects add RuntimeEnabled operations after creation so do not add them to the static table.
+ if (IsDOMGlobalObject($interface) && $function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
</ins><span class="cx"> $propertyCount -= 1;
</span><span class="cx"> next;
</span><span class="cx"> }
</span><span class="lines">@@ -1472,7 +1479,7 @@
</span><span class="cx">
</span><span class="cx"> if ($function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
</span><span class="cx"> if ($isInstance) {
</span><del>- die "We currently do not support [EnabledAtRuntime] operations on the instance.";
</del><ins>+ die "We currently do not support [EnabledAtRuntime] operations on the instance (except for global objects).";
</ins><span class="cx"> } else {
</span><span class="cx"> push(@$runtimeEnabledFunctions, $function);
</span><span class="cx"> }
</span><span class="lines">@@ -2197,11 +2204,33 @@
</span><span class="cx"> push(@implContent, " : $parentClassName(vm, structure, WTFMove(impl), shell)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="cx"> push(@implContent, "}\n\n");
</span><ins>+ } 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");
+ }
</ins><span class="cx">
</span><del>- 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.
</del><ins>+ 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.
</ins><span class="cx"> foreach my $attribute (@{$interface->attributes}) {
</span><span class="cx"> next unless $attribute->signature->extendedAttributes->{"EnabledAtRuntime"};
</span><span class="cx">
</span><span class="lines">@@ -2219,7 +2248,7 @@
</span><span class="cx"> push(@implContent, " }\n");
</span><span class="cx"> push(@implContent, "#endif\n") if $conditionalString;
</span><span class="cx"> }
</span><del>- # Support for RuntimeEnabled operations on DOMWindow.
</del><ins>+ # Support for RuntimeEnabled operations on global objects.
</ins><span class="cx"> foreach my $function (@{$interface->functions}) {
</span><span class="cx"> next unless $function->signature->extendedAttributes->{"EnabledAtRuntime"};
</span><span class="cx"> next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
</span><span class="lines">@@ -2237,23 +2266,7 @@
</span><span class="cx"> push(@implContent, "#endif\n") if $conditionalString;
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, "}\n\n");
</span><del>- } 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");
</del><span class="cx"> } else {
</span><del>- 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)) {
</del><span class="cx"> push(@implContent, "JSObject* ${className}::createPrototype(VM& vm, JSGlobalObject* globalObject)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="cx"> if ($hasParent && $parentClassName ne "JSC::DOMNodeFilter") {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestGlobalObjectcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.cpp (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,257 @@
</span><ins>+/*
+ * 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) */
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestGlobalObjecth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObject.h (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,125 @@
</span><ins>+/*
+ * 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 */
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestGlobalObjectPrivateh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestGlobalObjectPrivate.h (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * 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 */
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjectcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,389 @@
</span><ins>+/*
+ 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;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestGlobalObjecth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.h (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,123 @@
</span><ins>+/*
+ 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
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestGlobalObjecth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.h (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+/*
+ * 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>
+
+@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
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestGlobalObjectmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObject.mm (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,128 @@
</span><ins>+/*
+ * 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];
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestGlobalObjectInternalh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestGlobalObjectInternal.h (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+/*
+ * 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*);
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestGlobalObjectidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/bindings/scripts/test/TestGlobalObject.idl (0 => 199103)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * 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);
+};
</ins></span></pre>
</div>
</div>
</body>
</html>