WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
refactored some of the [CallWith] code for functions
bug-76517-20120118111159.patch (text/plain), 56.56 KB, created by
Pablo Flouret
on 2012-01-18 11:12:00 PST
(
hide
)
Description:
refactored some of the [CallWith] code for functions
Filename:
MIME Type:
Creator:
Pablo Flouret
Created:
2012-01-18 11:12:00 PST
Size:
56.56 KB
patch
obsolete
>Subversion Revision: 105131 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3c85219af1fcefcce09643c375a4f0c1f0c7dcb4..544dcc65f92e4fab3ad5b3178b9e855cddd238ec 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,71 @@ >+2012-01-17 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 NOBODY (OOPS!). >+ >+ * 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-16 Hajime Morrita <morrita@chromium.org> > > [Internals] member varaibles should follow naming convention. >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 04fa7bb67ecd217c698f5a84659f0cb5673fcdbc..d1f92278f28c24469830c0e4ed24b9615313cfe0 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -1764,7 +1764,11 @@ sub GenerateImplementation > # 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; >@@ -1773,14 +1777,19 @@ sub GenerateImplementation > 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); >@@ -1793,6 +1802,10 @@ sub GenerateImplementation > $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)) { >@@ -1807,13 +1820,21 @@ sub GenerateImplementation > 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"); >@@ -2009,6 +2030,12 @@ sub GenerateImplementation > } 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}; >@@ -2361,6 +2388,25 @@ sub GenerateImplementation > 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; >@@ -2422,16 +2468,7 @@ sub GenerateParametersCheck > > 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; >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >index 7b184a7a1c84fec041e896ced7f0509853413d79..fd1ef2a6448314a034ebc8a64cf1686195607a70 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm >@@ -899,8 +899,15 @@ END > > 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"}; >@@ -930,6 +937,12 @@ END > 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 { >@@ -1128,6 +1141,8 @@ END > push(@implContentDecls, " ExceptionCode ec = 0;\n"); > } > >+ my $callWith = $attribute->signature->extendedAttributes->{"CallWith"} || ""; >+ > if ($implClassName eq "SVGNumber") { > push(@implContentDecls, " *imp = $result;\n"); > } else { >@@ -1152,6 +1167,11 @@ END > 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"}) { >@@ -1171,6 +1191,11 @@ END > 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"); >@@ -1454,6 +1479,35 @@ END > 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; >@@ -3193,20 +3247,11 @@ sub GenerateFunctionCallString() > $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++ > } >@@ -3249,7 +3294,7 @@ sub GenerateFunctionCallString() > > 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 >@@ -3266,7 +3311,7 @@ sub GenerateFunctionCallString() > $result .= $indent . " goto fail;\n"; > } > >- if ($hasScriptState) { >+ if ($callWith eq "ScriptState") { > $result .= $indent . "if (state.hadException())\n"; > $result .= $indent . " return throwError(state.exception());\n" > } >diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp >index 9dac2da8a9ab0902fda2585e459e08052d3c46a3..9a9f3f182ecf8cd010b493bc0a4bdea570c659a8 100644 >--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp >@@ -519,6 +519,80 @@ void WebDOMTestObj::setStringAttrWithSetterException(const WebDOMString& newStri > 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()) >diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h >index 43fd98c029a64d4fde3f7f720aaa3955c7b4fc02..b3ccea296c63e42f366eb89aa93025ed75e025c3 100644 >--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h >@@ -124,6 +124,14 @@ public: > 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; >diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp >index 70147cb810bfb0f149b6c628c1e78c557423484e..9de498dbdefaa95e725d9ae84b3ff369e70c646e 100644 >--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp >@@ -1082,6 +1082,123 @@ webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self > } > } > >+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) > { >@@ -1334,6 +1451,10 @@ enum { > 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, >@@ -1480,6 +1601,11 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con > 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: > { >@@ -1664,6 +1790,31 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa > 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())); >@@ -1962,6 +2113,36 @@ G_MAXLONG, /* max */ > "", /* 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 */ >diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h >index a60b97eea38f02b75d15bd335c3a42eb4293bd73..7d83f9bf2f51b7c200fe447b4f9407b92736a015 100644 >--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h >@@ -974,6 +974,94 @@ WEBKIT_API void > 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 > * >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >index e91a114038966fc72d8957647b25655a5e9032f5..2c3d62981fb9fb6cb7e75ba167066f8c02d1193b 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp >@@ -107,6 +107,10 @@ static const HashTableValue JSTestObjTableValues[] = > { "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 }, >@@ -139,7 +143,7 @@ static const HashTableValue JSTestObjTableValues[] = > { 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[] = >@@ -631,6 +635,52 @@ JSValue jsTestObjCustomAttr(ExecState* exec, JSValue slotBase, const Identifier& > } > > >+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)); >@@ -1017,6 +1067,48 @@ void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value > } > > >+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) > { >diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >index ae4041de67a9bceaf5b4b136977ce8759416ff23..45f9fb7317cb3f512375dd73a320d811c915a2f8 100644 >--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h >@@ -249,6 +249,14 @@ JSC::JSValue jsTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSValu > 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); >diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h >index 282995ae8913a1b187e16b42f3ff8b94c6179aeb..f064fcee5d32b0dacbc6f2706549c2b432fa9162 100644 >--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h >+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h >@@ -119,6 +119,14 @@ enum { > - (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; >diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm >index 08f1f1e7ac3fd1ce8377043a0cf3b8a1c349a4f4..196d24d9e93cd752e3f30fff4246553750149ae7 100644 >--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm >+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm >@@ -436,6 +436,70 @@ > 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; >diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl >index ed338c6b21d718bcef3328c14122fab382648485..73fd19b7bc0bb7204afb098e9a03bf887051ce89 100644 >--- a/Source/WebCore/bindings/scripts/test/TestObj.idl >+++ b/Source/WebCore/bindings/scripts/test/TestObj.idl >@@ -109,6 +109,13 @@ module test { > 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); >diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >index 17c0a03ad2ae74a49bbb11bc76191f8ba17e2ae2..6336de46319ac2d9ffc3d5eceeee373bb1746adc 100644 >--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp >@@ -514,6 +514,118 @@ static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, > 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"); >@@ -1522,6 +1634,14 @@ static const BatchedAttribute TestObjAttrs[] = { > {"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)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 76517
:
122877
| 122967