+2012-01-18 Pablo Flouret <pablof@motorola.com>
+
+ Add [CallWith] support for attributes in JSC/V8 idl code generators.
+ Part of https://bugs.webkit.org/show_bug.cgi?id=76035
+
+ Reviewed by Adam Barth.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateAttributeCallWith):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNormalAttrGetter):
+ (GenerateNormalAttrSetter):
+ (GenerateAttributeCallWith):
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ (WebDOMTestObj::withScriptStateAttribute):
+ (WebDOMTestObj::setWithScriptStateAttribute):
+ (WebDOMTestObj::withScriptExecutionContextAttribute):
+ (WebDOMTestObj::setWithScriptExecutionContextAttribute):
+ (WebDOMTestObj::withScriptStateAttributeRaises):
+ (WebDOMTestObj::setWithScriptStateAttributeRaises):
+ (WebDOMTestObj::withScriptExecutionContextAttributeRaises):
+ (WebDOMTestObj::setWithScriptExecutionContextAttributeRaises):
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_get_with_script_state_attribute):
+ (webkit_dom_test_obj_set_with_script_state_attribute):
+ (webkit_dom_test_obj_get_with_script_execution_context_attribute):
+ (webkit_dom_test_obj_set_with_script_execution_context_attribute):
+ (webkit_dom_test_obj_get_with_script_state_attribute_raises):
+ (webkit_dom_test_obj_set_with_script_state_attribute_raises):
+ (webkit_dom_test_obj_get_with_script_execution_context_attribute_raises):
+ (webkit_dom_test_obj_set_with_script_execution_context_attribute_raises):
+ (webkit_dom_test_obj_set_property):
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjWithScriptStateAttribute):
+ (WebCore::jsTestObjWithScriptExecutionContextAttribute):
+ (WebCore::jsTestObjWithScriptStateAttributeRaises):
+ (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
+ (WebCore::setJSTestObjWithScriptStateAttribute):
+ (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
+ (WebCore::setJSTestObjWithScriptStateAttributeRaises):
+ (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ (-[DOMTestObj withScriptStateAttribute]):
+ (-[DOMTestObj setWithScriptStateAttribute:]):
+ (-[DOMTestObj withScriptExecutionContextAttribute]):
+ (-[DOMTestObj setWithScriptExecutionContextAttribute:]):
+ (-[DOMTestObj withScriptStateAttributeRaises]):
+ (-[DOMTestObj setWithScriptStateAttributeRaises:]):
+ (-[DOMTestObj withScriptExecutionContextAttributeRaises]):
+ (-[DOMTestObj setWithScriptExecutionContextAttributeRaises:]):
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::withScriptStateAttributeAttrGetter):
+ (WebCore::TestObjInternal::withScriptStateAttributeAttrSetter):
+ (WebCore::TestObjInternal::withScriptExecutionContextAttributeAttrGetter):
+ (WebCore::TestObjInternal::withScriptExecutionContextAttributeAttrSetter):
+ (WebCore::TestObjInternal::withScriptStateAttributeRaisesAttrGetter):
+ (WebCore::TestObjInternal::withScriptStateAttributeRaisesAttrSetter):
+ (WebCore::TestObjInternal::withScriptExecutionContextAttributeRaisesAttrGetter):
+ (WebCore::TestObjInternal::withScriptExecutionContextAttributeRaisesAttrSetter):
+
2012-01-18 Tim Horton <timothy_horton@apple.com>
[CG] Rasterized scaling of transformed SVG shapes with gradient fill and -webkit-svg-shadow applied
# Once JSDOMWrappers have a back-pointer to the globalObject we can pass castedThis->globalObject()
push(@implContent, " return JS" . $constructorType . "::getConstructor(exec, castedThis);\n");
} elsif (!@{$attribute->getterExceptions}) {
- push(@implContent, " UNUSED_PARAM(exec);\n");
+ my $callWith = $attribute->signature->extendedAttributes->{"CallWith"};
+ my $callWithArg = "";
+
+ push(@implContent, " UNUSED_PARAM(exec);\n") if (!$callWith);
+
my $cacheIndex = 0;
if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
$cacheIndex = $currentCachedAttribute;
push(@implContent, " return cachedValue;\n");
}
+ if ($callWith) {
+ $callWithArg = GenerateCallWith($callWith, \@implContent, "jsUndefined()");
+ }
+
if ($svgListPropertyType) {
- push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName()", "castedThis") . ";\n");
+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "castedThis->impl()->$implGetterFunctionName($callWithArg)", "castedThis") . ";\n");
} elsif ($svgPropertyOrListPropertyType) {
push(@implContent, " $svgPropertyOrListPropertyType& impl = castedThis->impl()->propertyReference();\n");
if ($svgPropertyOrListPropertyType eq "float") { # Special case for JSSVGNumber
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl", "castedThis") . ";\n");
} else {
- push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName()", "castedThis") . ";\n");
+ push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName($callWithArg)", "castedThis") . ";\n");
+
}
} else {
my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
$functionName = "impl->${functionName}";
}
+ if ($callWith) {
+ unshift(@arguments, $callWithArg);
+ }
+
my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, "${functionName}(" . join(", ", @arguments) . ")", "castedThis");
push(@implContent, " $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
if ($codeGenerator->IsSVGAnimatedType($type)) {
push(@implContent, " return result;\n");
} else {
+ my $callWith = $attribute->signature->extendedAttributes->{"CallWith"};
+ my @arguments = ("ec");
+
push(@implContent, " ExceptionCode ec = 0;\n");
+
+ if ($callWith) {
+ unshift(@arguments, GenerateCallWith($callWith, \@implContent, "jsUndefined()"));
+ }
+
if ($svgPropertyOrListPropertyType) {
push(@implContent, " $svgPropertyOrListPropertyType impl(*castedThis->impl());\n");
- push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(ec)", "castedThis") . ";\n");
+ push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl.$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
} else {
push(@implContent, " $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
- push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName(ec)", "castedThis") . ";\n");
+ push(@implContent, " JSC::JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName(" . join(", ", @arguments) . ")", "castedThis") . ";\n");
}
push(@implContent, " setDOMException(exec, ec);\n");
} else {
$functionName = "impl->${functionName}";
}
+
+ my $callWith = $attribute->signature->extendedAttributes->{"CallWith"};
+ if ($callWith) {
+ unshift(@arguments, GenerateCallWith($callWith, \@implContent, ""));
+ }
+
push(@arguments, "ec") if @{$attribute->setterExceptions};
push(@implContent, " ${functionName}(" . join(", ", @arguments) . ");\n");
push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
}
+sub GenerateCallWith
+{
+ my $callWith = shift;
+ my $outputArray = shift;
+ my $returnValue = shift;
+ my $callWithArg = "COMPILE_ASSERT(false)";
+
+ if ($callWith eq "ScriptState") {
+ $callWithArg = "exec";
+ } elsif ($callWith eq "ScriptExecutionContext") {
+ push(@$outputArray, " ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
+ push(@$outputArray, " if (!scriptContext)\n");
+ push(@$outputArray, " return" . ($returnValue ? " " . $returnValue : "") . ";\n");
+ $callWithArg = "scriptContext";
+ }
+
+ return $callWithArg;
+}
+
sub GenerateArgumentsCountCheck
{
my $outputArray = shift;
my $callWith = $function->signature->extendedAttributes->{"CallWith"};
if ($callWith and !$function->signature->extendedAttributes->{"Constructor"}) {
- my $callWithArg = "COMPILE_ASSERT(false)";
- if ($callWith eq "ScriptState") {
- $callWithArg = "exec";
- } elsif ($callWith eq "ScriptExecutionContext") {
- push(@$outputArray, " ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
- push(@$outputArray, " if (!scriptContext)\n");
- push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
- $callWithArg = "scriptContext";
- }
- push @arguments, $callWithArg;
+ push(@arguments, GenerateCallWith($callWith, \@$outputArray, "JSValue::encode(jsUndefined())"));
}
$implIncludes{"ExceptionCode.h"} = 1;
my $returnType = GetTypeFromSignature($attribute->signature);
my $getterString;
+ my $callWith = $attribute->signature->extendedAttributes->{"CallWith"} || "";
+
if ($getterStringUsesImp) {
my ($functionName, @arguments) = $codeGenerator->GetterExpression(\%implIncludes, $interfaceName, $attribute);
+
+ if ($callWith) {
+ push(@arguments, GenerateCallWith($callWith, \@implContentDecls, " ", 0, 0));
+ }
+
push(@arguments, "ec") if $useExceptions;
if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
my $implementedBy = $attribute->signature->extendedAttributes->{"ImplementedBy"};
push(@implContentDecls, " $nativeType v = $getterString;\n");
}
push(@implContentDecls, GenerateSetDOMException(" "));
+
+ if ($callWith eq "ScriptState") {
+ push(@implContentDecls, " if (state.hadException())\n");
+ push(@implContentDecls, " return throwError(state.exception());\n");
+ }
+
$result = "v";
$result .= ".release()" if (IsRefPtrType($returnType));
} else {
push(@implContentDecls, " ExceptionCode ec = 0;\n");
}
+ my $callWith = $attribute->signature->extendedAttributes->{"CallWith"} || "";
+
if ($implClassName eq "SVGNumber") {
push(@implContentDecls, " *imp = $result;\n");
} else {
push(@implContentDecls, ");\n");
} else {
my ($functionName, @arguments) = $codeGenerator->SetterExpression(\%implIncludes, $interfaceName, $attribute);
+
+ if ($callWith) {
+ push(@arguments, GenerateCallWith($callWith, \@implContentDecls, " ", 1, 0));
+ }
+
push(@arguments, $result);
push(@arguments, "ec") if $useExceptions;
if ($attribute->signature->extendedAttributes->{"ImplementedBy"}) {
push(@implContentDecls, " V8Proxy::setDOMException(ec);\n");
}
+ if ($callWith eq "ScriptState") {
+ push(@implContentDecls, " if (state.hadException())\n");
+ push(@implContentDecls, " throwError(state.exception());\n");
+ }
+
if ($svgNativeType) {
if ($useExceptions) {
push(@implContentDecls, " if (!ec)\n");
push(@implContentDecls, "#endif // ${conditionalString}\n\n") if $conditionalString;
}
+sub GenerateCallWith
+{
+ my $callWith = shift;
+ my $outputArray = shift;
+ my $indent = shift;
+ my $returnVoid = shift;
+ my $emptyContext = shift;
+ my $callWithArg = "COMPILE_ASSERT(false)";
+
+ if ($callWith eq "ScriptState") {
+ if ($emptyContext) {
+ push(@$outputArray, $indent . "EmptyScriptState state;\n");
+ $callWithArg = "&state";
+ } else {
+ push(@$outputArray, $indent . "ScriptState* state = ScriptState::current();\n");
+ push(@$outputArray, $indent . "if (!state)\n");
+ push(@$outputArray, $indent . " return" . ($returnVoid ? "" : " v8::Undefined()") . ";\n");
+ $callWithArg = "state";
+ }
+ } elsif ($callWith eq "ScriptExecutionContext") {
+ push(@$outputArray, $indent . "ScriptExecutionContext* scriptContext = getScriptExecutionContext();\n");
+ push(@$outputArray, $indent . "if (!scriptContext)\n");
+ push(@$outputArray, $indent . " return" . ($returnVoid ? "" : " v8::Undefined()") . ";\n");
+ $callWithArg = "scriptContext";
+ }
+
+ return $callWithArg;
+}
+
sub GenerateArgumentsCountCheck
{
my $function = shift;
$functionName = "imp->${name}";
}
- my $callWith = $function->signature->extendedAttributes->{"CallWith"};
+ my $callWith = $function->signature->extendedAttributes->{"CallWith"} || "";
if ($callWith) {
- my $callWithArg = "COMPILE_ASSERT(false)";
- if ($callWith eq "ScriptState") {
- $result .= $indent . "EmptyScriptState state;\n";
- $callWithArg = "&state";
- $hasScriptState = 1;
- } elsif ($callWith eq "ScriptExecutionContext") {
- $result .= $indent . "ScriptExecutionContext* scriptContext = getScriptExecutionContext();\n";
- $result .= $indent . "if (!scriptContext)\n";
- $result .= $indent . " return v8::Undefined();\n";
- $callWithArg = "scriptContext";
- }
- push @arguments, $callWithArg;
+ my @callWithOutput = ();
+ push(@arguments, GenerateCallWith($callWith, \@callWithOutput, $indent, 0, 1));
+ $result .= join("", @callWithOutput);
$index++;
$numberOfParameters++
}
if ($returnType eq "void") {
$result .= $indent . "$functionString;\n";
- } elsif ($hasScriptState or @{$function->raisesExceptions}) {
+ } elsif ($callWith eq "ScriptState" or @{$function->raisesExceptions}) {
$result .= $indent . $nativeReturnType . " result = $functionString;\n";
} else {
# Can inline the function call into the return statement to avoid overhead of using a Ref<> temporary
$result .= $indent . " goto fail;\n";
}
- if ($hasScriptState) {
+ if ($callWith eq "ScriptState") {
$result .= $indent . "if (state.hadException())\n";
$result .= $indent . " return throwError(state.exception());\n"
}
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
}
+int WebDOMTestObj::withScriptStateAttribute() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->withScriptStateAttribute();
+}
+
+void WebDOMTestObj::setWithScriptStateAttribute(int newWithScriptStateAttribute)
+{
+ if (!impl())
+ return;
+
+ impl()->setWithScriptStateAttribute(newWithScriptStateAttribute);
+}
+
+WebDOMTestObj WebDOMTestObj::withScriptExecutionContextAttribute() const
+{
+ if (!impl())
+ return WebDOMTestObj();
+
+ return toWebKit(WTF::getPtr(impl()->withScriptExecutionContextAttribute()));
+}
+
+void WebDOMTestObj::setWithScriptExecutionContextAttribute(const WebDOMTestObj& newWithScriptExecutionContextAttribute)
+{
+ if (!impl())
+ return;
+
+ impl()->setWithScriptExecutionContextAttribute(toWebCore(newWithScriptExecutionContextAttribute));
+}
+
+WebDOMTestObj WebDOMTestObj::withScriptStateAttributeRaises() const
+{
+ if (!impl())
+ return WebDOMTestObj();
+
+ WebCore::ExceptionCode ec = 0;
+ WebDOMTestObj result = toWebKit(WTF::getPtr(impl()->withScriptStateAttributeRaises(ec)));
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return result;
+}
+
+void WebDOMTestObj::setWithScriptStateAttributeRaises(const WebDOMTestObj& newWithScriptStateAttributeRaises)
+{
+ if (!impl())
+ return;
+
+ WebCore::ExceptionCode ec = 0;
+ impl()->setWithScriptStateAttributeRaises(toWebCore(newWithScriptStateAttributeRaises), ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+}
+
+WebDOMTestObj WebDOMTestObj::withScriptExecutionContextAttributeRaises() const
+{
+ if (!impl())
+ return WebDOMTestObj();
+
+ WebCore::ExceptionCode ec = 0;
+ WebDOMTestObj result = toWebKit(WTF::getPtr(impl()->withScriptExecutionContextAttributeRaises(ec)));
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return result;
+}
+
+void WebDOMTestObj::setWithScriptExecutionContextAttributeRaises(const WebDOMTestObj& newWithScriptExecutionContextAttributeRaises)
+{
+ if (!impl())
+ return;
+
+ WebCore::ExceptionCode ec = 0;
+ impl()->setWithScriptExecutionContextAttributeRaises(toWebCore(newWithScriptExecutionContextAttributeRaises), ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+}
+
WebDOMString WebDOMTestObj::scriptStringAttr() const
{
if (!impl())
void setStringAttrWithGetterException(const WebDOMString&);
WebDOMString stringAttrWithSetterException() const;
void setStringAttrWithSetterException(const WebDOMString&);
+ int withScriptStateAttribute() const;
+ void setWithScriptStateAttribute(int);
+ WebDOMTestObj withScriptExecutionContextAttribute() const;
+ void setWithScriptExecutionContextAttribute(const WebDOMTestObj&);
+ WebDOMTestObj withScriptStateAttributeRaises() const;
+ void setWithScriptStateAttributeRaises(const WebDOMTestObj&);
+ WebDOMTestObj withScriptExecutionContextAttributeRaises() const;
+ void setWithScriptExecutionContextAttributeRaises(const WebDOMTestObj&);
WebDOMString scriptStringAttr() const;
#if ENABLE(Condition1)
int conditionalAttr1() const;
}
}
+glong
+webkit_dom_test_obj_get_with_script_state_attribute(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->withScriptStateAttribute();
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_with_script_state_attribute(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setWithScriptStateAttribute(value);
+}
+
+WebKitDOMTestObj*
+webkit_dom_test_obj_get_with_script_execution_context_attribute(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptExecutionContextAttribute());
+ WebKitDOMTestObj* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_with_script_execution_context_attribute(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::TestObj * converted_value = NULL;
+ if (value != NULL) {
+ converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ }
+ item->setWithScriptExecutionContextAttribute(converted_value);
+}
+
+WebKitDOMTestObj*
+webkit_dom_test_obj_get_with_script_state_attribute_raises(WebKitDOMTestObj* self, GError **error)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ WebCore::ExceptionCode ec = 0;
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateAttributeRaises(ec));
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+ WebKitDOMTestObj* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_with_script_state_attribute_raises(WebKitDOMTestObj* self, WebKitDOMTestObj* value, GError **error)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::TestObj * converted_value = NULL;
+ if (value != NULL) {
+ converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ }
+ WebCore::ExceptionCode ec = 0;
+ item->setWithScriptStateAttributeRaises(converted_value, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+}
+
+WebKitDOMTestObj*
+webkit_dom_test_obj_get_with_script_execution_context_attribute_raises(WebKitDOMTestObj* self, GError **error)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ WebCore::ExceptionCode ec = 0;
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptExecutionContextAttributeRaises(ec));
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+ WebKitDOMTestObj* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_with_script_execution_context_attribute_raises(WebKitDOMTestObj* self, WebKitDOMTestObj* value, GError **error)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::TestObj * converted_value = NULL;
+ if (value != NULL) {
+ converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ }
+ WebCore::ExceptionCode ec = 0;
+ item->setWithScriptExecutionContextAttributeRaises(converted_value, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+}
+
gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self)
{
PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
PROP_CUSTOM_ATTR,
+ PROP_WITH_SCRIPT_STATE_ATTRIBUTE,
+ PROP_WITH_SCRIPT_EXECUTION_CONTEXT_ATTRIBUTE,
+ PROP_WITH_SCRIPT_STATE_ATTRIBUTE_RAISES,
+ PROP_WITH_SCRIPT_EXECUTION_CONTEXT_ATTRIBUTE_RAISES,
PROP_SCRIPT_STRING_ATTR,
#if ENABLE(Condition1)
PROP_CONDITIONAL_ATTR1,
coreSelf->setStringAttrWithSetterException(WTF::String::fromUTF8(g_value_get_string(value)), ec);
break;
}
+ case PROP_WITH_SCRIPT_STATE_ATTRIBUTE:
+ {
+ coreSelf->setWithScriptStateAttribute((g_value_get_long(value)));
+ break;
+ }
#if ENABLE(Condition1)
case PROP_CONDITIONAL_ATTR1:
{
g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithSetterException()));
break;
}
+ case PROP_WITH_SCRIPT_STATE_ATTRIBUTE:
+ {
+ g_value_set_long(value, coreSelf->withScriptStateAttribute());
+ break;
+ }
+ case PROP_WITH_SCRIPT_EXECUTION_CONTEXT_ATTRIBUTE:
+ {
+ RefPtr<WebCore::TestObj> ptr = coreSelf->withScriptExecutionContextAttribute();
+ g_value_set_object(value, WebKit::kit(ptr.get()));
+ break;
+ }
+ case PROP_WITH_SCRIPT_STATE_ATTRIBUTE_RAISES:
+ {
+ WebCore::ExceptionCode ec = 0;
+ RefPtr<WebCore::TestObj> ptr = coreSelf->withScriptStateAttributeRaises(ec);
+ g_value_set_object(value, WebKit::kit(ptr.get()));
+ break;
+ }
+ case PROP_WITH_SCRIPT_EXECUTION_CONTEXT_ATTRIBUTE_RAISES:
+ {
+ WebCore::ExceptionCode ec = 0;
+ RefPtr<WebCore::TestObj> ptr = coreSelf->withScriptExecutionContextAttributeRaises(ec);
+ g_value_set_object(value, WebKit::kit(ptr.get()));
+ break;
+ }
case PROP_SCRIPT_STRING_ATTR:
{
g_value_take_string(value, convertToUTF8String(coreSelf->scriptStringAttr()));
"", /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
+ PROP_WITH_SCRIPT_STATE_ATTRIBUTE,
+ g_param_spec_long("with-script-state-attribute", /* name */
+ "test_obj_with-script-state-attribute", /* short description */
+ "read-write glong TestObj.with-script-state-attribute", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_WITH_SCRIPT_EXECUTION_CONTEXT_ATTRIBUTE,
+ g_param_spec_object("with-script-execution-context-attribute", /* name */
+ "test_obj_with-script-execution-context-attribute", /* short description */
+ "read-write WebKitDOMTestObj* TestObj.with-script-execution-context-attribute", /* longer - could do with some extra doc stuff here */
+ WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_WITH_SCRIPT_STATE_ATTRIBUTE_RAISES,
+ g_param_spec_object("with-script-state-attribute-raises", /* name */
+ "test_obj_with-script-state-attribute-raises", /* short description */
+ "read-write WebKitDOMTestObj* TestObj.with-script-state-attribute-raises", /* longer - could do with some extra doc stuff here */
+ WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_WITH_SCRIPT_EXECUTION_CONTEXT_ATTRIBUTE_RAISES,
+ g_param_spec_object("with-script-execution-context-attribute-raises", /* name */
+ "test_obj_with-script-execution-context-attribute-raises", /* short description */
+ "read-write WebKitDOMTestObj* TestObj.with-script-execution-context-attribute-raises", /* longer - could do with some extra doc stuff here */
+ WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
PROP_SCRIPT_STRING_ATTR,
g_param_spec_string("script-string-attr", /* name */
"test_obj_script-string-attr", /* short description */
webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, const gchar* value, GError **error);
/**
+ * webkit_dom_test_obj_get_with_script_state_attribute:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API glong
+webkit_dom_test_obj_get_with_script_state_attribute(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_with_script_state_attribute:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #glong
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_with_script_state_attribute(WebKitDOMTestObj* self, glong value);
+
+/**
+ * webkit_dom_test_obj_get_with_script_execution_context_attribute:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_obj_get_with_script_execution_context_attribute(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_with_script_execution_context_attribute:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_with_script_execution_context_attribute(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
+
+/**
+ * webkit_dom_test_obj_get_with_script_state_attribute_raises:
+ * @self: A #WebKitDOMTestObj
+ * @error: #GError
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_obj_get_with_script_state_attribute_raises(WebKitDOMTestObj* self, GError **error);
+
+/**
+ * webkit_dom_test_obj_set_with_script_state_attribute_raises:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #WebKitDOMTestObj
+ * @error: #GError
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_with_script_state_attribute_raises(WebKitDOMTestObj* self, WebKitDOMTestObj* value, GError **error);
+
+/**
+ * webkit_dom_test_obj_get_with_script_execution_context_attribute_raises:
+ * @self: A #WebKitDOMTestObj
+ * @error: #GError
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_obj_get_with_script_execution_context_attribute_raises(WebKitDOMTestObj* self, GError **error);
+
+/**
+ * webkit_dom_test_obj_set_with_script_execution_context_attribute_raises:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #WebKitDOMTestObj
+ * @error: #GError
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_with_script_execution_context_attribute_raises(WebKitDOMTestObj* self, WebKitDOMTestObj* value, GError **error);
+
+/**
* webkit_dom_test_obj_get_script_string_attr:
* @self: A #WebKitDOMTestObj
*
{ "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException, NoIntrinsic },
{ "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException, NoIntrinsic },
{ "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr, NoIntrinsic },
+ { "withScriptStateAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttribute), (intptr_t)setJSTestObjWithScriptStateAttribute, NoIntrinsic },
+ { "withScriptExecutionContextAttribute", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttribute), (intptr_t)setJSTestObjWithScriptExecutionContextAttribute, NoIntrinsic },
+ { "withScriptStateAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptStateAttributeRaises), (intptr_t)setJSTestObjWithScriptStateAttributeRaises, NoIntrinsic },
+ { "withScriptExecutionContextAttributeRaises", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjWithScriptExecutionContextAttributeRaises), (intptr_t)setJSTestObjWithScriptExecutionContextAttributeRaises, NoIntrinsic },
{ "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0, NoIntrinsic },
#if ENABLE(Condition1)
{ "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1, NoIntrinsic },
{ 0, 0, 0, 0, NoIntrinsic }
};
-static const HashTable JSTestObjTable = { 136, 127, JSTestObjTableValues, 0 };
+static const HashTable JSTestObjTable = { 137, 127, JSTestObjTableValues, 0 };
/* Hash table for constructor */
static const HashTableValue JSTestObjConstructorTableValues[] =
}
+JSValue jsTestObjWithScriptStateAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(impl->withScriptStateAttribute(exec));
+ return result;
+}
+
+
+JSValue jsTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+ if (!scriptContext)
+ return jsUndefined();
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttribute(scriptContext)));
+ return result;
+}
+
+
+JSValue jsTestObjWithScriptStateAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ ExceptionCode ec = 0;
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptStateAttributeRaises(exec, ec)));
+ setDOMException(exec, ec);
+ return result;
+}
+
+
+JSValue jsTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ ExceptionCode ec = 0;
+ ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+ if (!scriptContext)
+ return jsUndefined();
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->withScriptExecutionContextAttributeRaises(scriptContext, ec)));
+ setDOMException(exec, ec);
+ return result;
+}
+
+
JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
}
+void setJSTestObjWithScriptStateAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ impl->setWithScriptStateAttribute(exec, value.toInt32(exec));
+}
+
+
+void setJSTestObjWithScriptExecutionContextAttribute(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+ if (!scriptContext)
+ return;
+ impl->setWithScriptExecutionContextAttribute(scriptContext, toTestObj(value));
+}
+
+
+void setJSTestObjWithScriptStateAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ impl->setWithScriptStateAttributeRaises(exec, toTestObj(value), ec);
+ setDOMException(exec, ec);
+}
+
+
+void setJSTestObjWithScriptExecutionContextAttributeRaises(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+ if (!scriptContext)
+ return;
+ impl->setWithScriptExecutionContextAttributeRaises(scriptContext, toTestObj(value), ec);
+ setDOMException(exec, ec);
+}
+
+
#if ENABLE(Condition1)
void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
{
void setJSTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjCustomAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjCustomAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjWithScriptStateAttribute(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjWithScriptStateAttribute(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjWithScriptExecutionContextAttribute(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjWithScriptExecutionContextAttribute(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjWithScriptStateAttributeRaises(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjWithScriptStateAttributeRaises(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjWithScriptExecutionContextAttributeRaises(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjWithScriptExecutionContextAttributeRaises(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjScriptStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjConditionalAttr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjConditionalAttr1(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException;
- (int)customAttr;
- (void)setCustomAttr:(int)newCustomAttr;
+- (int)withScriptStateAttribute;
+- (void)setWithScriptStateAttribute:(int)newWithScriptStateAttribute;
+- (DOMTestObj *)withScriptExecutionContextAttribute;
+- (void)setWithScriptExecutionContextAttribute:(DOMTestObj *)newWithScriptExecutionContextAttribute;
+- (DOMTestObj *)withScriptStateAttributeRaises;
+- (void)setWithScriptStateAttributeRaises:(DOMTestObj *)newWithScriptStateAttributeRaises;
+- (DOMTestObj *)withScriptExecutionContextAttributeRaises;
+- (void)setWithScriptExecutionContextAttributeRaises:(DOMTestObj *)newWithScriptExecutionContextAttributeRaises;
- (NSString *)scriptStringAttr;
#if ENABLE(Condition1)
- (int)conditionalAttr1;
IMPL->setCustomAttr(newCustomAttr);
}
+- (int)withScriptStateAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->withScriptStateAttribute();
+}
+
+- (void)setWithScriptStateAttribute:(int)newWithScriptStateAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setWithScriptStateAttribute(newWithScriptStateAttribute);
+}
+
+- (DOMTestObj *)withScriptExecutionContextAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(IMPL->withScriptExecutionContextAttribute()));
+}
+
+- (void)setWithScriptExecutionContextAttribute:(DOMTestObj *)newWithScriptExecutionContextAttribute
+{
+ WebCore::JSMainThreadNullState state;
+ ASSERT(newWithScriptExecutionContextAttribute);
+
+ IMPL->setWithScriptExecutionContextAttribute(core(newWithScriptExecutionContextAttribute));
+}
+
+- (DOMTestObj *)withScriptStateAttributeRaises
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ DOMTestObj *result = kit(WTF::getPtr(IMPL->withScriptStateAttributeRaises(ec)));
+ WebCore::raiseOnDOMError(ec);
+ return result;
+}
+
+- (void)setWithScriptStateAttributeRaises:(DOMTestObj *)newWithScriptStateAttributeRaises
+{
+ WebCore::JSMainThreadNullState state;
+ ASSERT(newWithScriptStateAttributeRaises);
+
+ WebCore::ExceptionCode ec = 0;
+ IMPL->setWithScriptStateAttributeRaises(core(newWithScriptStateAttributeRaises), ec);
+ WebCore::raiseOnDOMError(ec);
+}
+
+- (DOMTestObj *)withScriptExecutionContextAttributeRaises
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ DOMTestObj *result = kit(WTF::getPtr(IMPL->withScriptExecutionContextAttributeRaises(ec)));
+ WebCore::raiseOnDOMError(ec);
+ return result;
+}
+
+- (void)setWithScriptExecutionContextAttributeRaises:(DOMTestObj *)newWithScriptExecutionContextAttributeRaises
+{
+ WebCore::JSMainThreadNullState state;
+ ASSERT(newWithScriptExecutionContextAttributeRaises);
+
+ WebCore::ExceptionCode ec = 0;
+ IMPL->setWithScriptExecutionContextAttributeRaises(core(newWithScriptExecutionContextAttributeRaises), ec);
+ WebCore::raiseOnDOMError(ec);
+}
+
- (NSString *)scriptStringAttr
{
WebCore::JSMainThreadNullState state;
raises(DOMException);
[CallWith=ScriptExecutionContext] void withScriptExecutionContext();
+ attribute [CallWith=ScriptState] long withScriptStateAttribute;
+ attribute [CallWith=ScriptExecutionContext] TestObj withScriptExecutionContextAttribute;
+ attribute [CallWith=ScriptState] TestObj withScriptStateAttributeRaises
+ getter raises(DOMException);
+ attribute [CallWith=ScriptExecutionContext] TestObj withScriptExecutionContextAttributeRaises
+ getter raises(DOMException);
+
// 'Optional' extended attribute
void methodWithOptionalArg(in [Optional] long opt);
void methodWithNonOptionalArgAndOptionalArg(in long nonOpt, in [Optional] long opt);
return;
}
+static v8::Handle<v8::Value> withScriptStateAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptStateAttribute._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ ScriptState* state = ScriptState::current();
+ if (!state)
+ return v8::Undefined();
+ return v8::Integer::New(imp->withScriptStateAttribute(state));
+}
+
+static void withScriptStateAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptStateAttribute._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ ScriptState* state = ScriptState::current();
+ if (!state)
+ return;
+ imp->setWithScriptStateAttribute(state, v);
+ if (state.hadException())
+ throwError(state.exception());
+ return;
+}
+
+static v8::Handle<v8::Value> withScriptExecutionContextAttributeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptExecutionContextAttribute._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ ScriptExecutionContext* scriptContext = getScriptExecutionContext();
+ if (!scriptContext)
+ return v8::Undefined();
+ return toV8(imp->withScriptExecutionContextAttribute(scriptContext));
+}
+
+static void withScriptExecutionContextAttributeAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptExecutionContextAttribute._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+ ScriptExecutionContext* scriptContext = getScriptExecutionContext();
+ if (!scriptContext)
+ return;
+ imp->setWithScriptExecutionContextAttribute(scriptContext, WTF::getPtr(v));
+ return;
+}
+
+static v8::Handle<v8::Value> withScriptStateAttributeRaisesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptStateAttributeRaises._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ ExceptionCode ec = 0;
+ ScriptState* state = ScriptState::current();
+ if (!state)
+ return v8::Undefined();
+ RefPtr<TestObj> v = imp->withScriptStateAttributeRaises(state, ec);
+ if (UNLIKELY(ec)) {
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+ }
+ if (state.hadException())
+ return throwError(state.exception());
+ return toV8(v.release());
+}
+
+static void withScriptStateAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptStateAttributeRaises._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+ ExceptionCode ec = 0;
+ ScriptState* state = ScriptState::current();
+ if (!state)
+ return;
+ imp->setWithScriptStateAttributeRaises(state, WTF::getPtr(v), ec);
+ if (UNLIKELY(ec))
+ V8Proxy::setDOMException(ec);
+ if (state.hadException())
+ throwError(state.exception());
+ return;
+}
+
+static v8::Handle<v8::Value> withScriptExecutionContextAttributeRaisesAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptExecutionContextAttributeRaises._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ ExceptionCode ec = 0;
+ ScriptExecutionContext* scriptContext = getScriptExecutionContext();
+ if (!scriptContext)
+ return v8::Undefined();
+ RefPtr<TestObj> v = imp->withScriptExecutionContextAttributeRaises(scriptContext, ec);
+ if (UNLIKELY(ec)) {
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+ }
+ return toV8(v.release());
+}
+
+static void withScriptExecutionContextAttributeRaisesAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.withScriptExecutionContextAttributeRaises._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ TestObj* v = V8TestObj::HasInstance(value) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+ ExceptionCode ec = 0;
+ ScriptExecutionContext* scriptContext = getScriptExecutionContext();
+ if (!scriptContext)
+ return;
+ imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr(v), ec);
+ if (UNLIKELY(ec))
+ V8Proxy::setDOMException(ec);
+ return;
+}
+
static v8::Handle<v8::Value> scriptStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.scriptStringAttr._get");
{"stringAttrWithSetterException", TestObjInternal::stringAttrWithSetterExceptionAttrGetter, TestObjInternal::stringAttrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom')
{"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'withScriptStateAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
+ {"withScriptStateAttribute", TestObjInternal::withScriptStateAttributeAttrGetter, TestObjInternal::withScriptStateAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'withScriptExecutionContextAttribute' (Type: 'attribute' ExtAttr: 'CallWith')
+ {"withScriptExecutionContextAttribute", TestObjInternal::withScriptExecutionContextAttributeAttrGetter, TestObjInternal::withScriptExecutionContextAttributeAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'withScriptStateAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
+ {"withScriptStateAttributeRaises", TestObjInternal::withScriptStateAttributeRaisesAttrGetter, TestObjInternal::withScriptStateAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'withScriptExecutionContextAttributeRaises' (Type: 'attribute' ExtAttr: 'CallWith')
+ {"withScriptExecutionContextAttributeRaises", TestObjInternal::withScriptExecutionContextAttributeRaisesAttrGetter, TestObjInternal::withScriptExecutionContextAttributeRaisesAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'scriptStringAttr' (Type: 'readonly attribute' ExtAttr: 'ConvertScriptString')
{"scriptStringAttr", TestObjInternal::scriptStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
#if ENABLE(Condition1)