| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 static void animatedReflectedAttributeAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) | 82 static void animatedReflectedAttributeAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) |
| 83 { | 83 { |
| 84 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 84 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 85 v8SetReturnValueFast(info, imp->getAttribute(HTMLNames::animatedreflectedatt
ributeAttr), imp); | 85 v8SetReturnValueFast(info, imp->getAttribute(HTMLNames::animatedreflectedatt
ributeAttr), imp); |
| 86 } | 86 } |
| 87 | 87 |
| 88 static void animatedReflectedAttributeAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) | 88 static void animatedReflectedAttributeAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 89 { | 89 { |
| 90 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 90 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 91 TestSVGV8Internal::animatedReflectedAttributeAttributeGetter(info); | 91 TestSVGV8Internal::animatedReflectedAttributeAttributeGetter(info); |
| 92 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 92 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 93 } | 93 } |
| 94 | 94 |
| 95 static void animatedReflectedAttributeAttributeSetter(v8::Local<v8::Value> jsVal
ue, const v8::PropertyCallbackInfo<void>& info) | 95 static void animatedReflectedAttributeAttributeSetter(v8::Local<v8::Value> jsVal
ue, const v8::PropertyCallbackInfo<void>& info) |
| 96 { | 96 { |
| 97 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 97 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 98 V8TRYCATCH_VOID(SVGAnimatedString*, cppValue, V8SVGAnimatedString::hasInstan
ce(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGAnimatedStri
ng::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | 98 V8TRYCATCH_VOID(SVGAnimatedString*, cppValue, V8SVGAnimatedString::hasInstan
ce(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGAnimatedStri
ng::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 99 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 99 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| 100 imp->setAttribute(HTMLNames::animatedreflectedattributeAttr, WTF::getPtr(cpp
Value)); | 100 imp->setAttribute(HTMLNames::animatedreflectedattributeAttr, WTF::getPtr(cpp
Value)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 static void animatedReflectedAttributeAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 103 static void animatedReflectedAttributeAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 104 { | 104 { |
| 105 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 105 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 106 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; | 106 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
| 107 TestSVGV8Internal::animatedReflectedAttributeAttributeSetter(jsValue, info); | 107 TestSVGV8Internal::animatedReflectedAttributeAttributeSetter(jsValue, info); |
| 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 109 } | 109 } |
| 110 | 110 |
| 111 static void mutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value
>& info) | 111 static void mutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value
>& info) |
| 112 { | 112 { |
| 113 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 113 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 114 v8SetReturnValueFast(info, WTF::getPtr(SVGStaticPropertyTearOff<TestSVG, SVG
Point>::create(imp, imp->mutablePoint(), &TestSVG::updateMutablePoint)), imp); | 114 v8SetReturnValueFast(info, WTF::getPtr(SVGStaticPropertyTearOff<TestSVG, SVG
Point>::create(imp, imp->mutablePoint(), &TestSVG::updateMutablePoint)), imp); |
| 115 } | 115 } |
| 116 | 116 |
| 117 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) | 117 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) |
| 118 { | 118 { |
| 119 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 119 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 120 TestSVGV8Internal::mutablePointAttributeGetter(info); | 120 TestSVGV8Internal::mutablePointAttributeGetter(info); |
| 121 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 121 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 122 } | 122 } |
| 123 | 123 |
| 124 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) | 124 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) |
| 125 { | 125 { |
| 126 ExceptionState exceptionState(ExceptionState::SetterContext, "mutablePoint",
"TestSVG", info.Holder(), info.GetIsolate()); | 126 ExceptionState exceptionState(ExceptionState::SetterContext, "mutablePoint",
"TestSVG", info.Holder(), info.GetIsolate()); |
| 127 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 127 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 128 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | 128 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 129 if (!WTF::getPtr(cppValue)) { | 129 if (!WTF::getPtr(cppValue)) { |
| 130 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi
nt'."); | 130 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi
nt'."); |
| 131 exceptionState.throwIfNeeded(); | 131 exceptionState.throwIfNeeded(); |
| 132 return; | 132 return; |
| 133 } | 133 } |
| 134 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); | 134 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 137 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 138 { | 138 { |
| 139 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 139 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 140 TestSVGV8Internal::mutablePointAttributeSetter(jsValue, info); | 140 TestSVGV8Internal::mutablePointAttributeSetter(jsValue, info); |
| 141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 141 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 142 } | 142 } |
| 143 | 143 |
| 144 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 144 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
| 145 { | 145 { |
| 146 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 146 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 147 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(
imp->immutablePoint())), imp); | 147 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(
imp->immutablePoint())), imp); |
| 148 } | 148 } |
| 149 | 149 |
| 150 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 150 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) |
| 151 { | 151 { |
| 152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 153 TestSVGV8Internal::immutablePointAttributeGetter(info); | 153 TestSVGV8Internal::immutablePointAttributeGetter(info); |
| 154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 155 } | 155 } |
| 156 | 156 |
| 157 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) | 157 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) |
| 158 { | 158 { |
| 159 ExceptionState exceptionState(ExceptionState::SetterContext, "immutablePoint
", "TestSVG", info.Holder(), info.GetIsolate()); | 159 ExceptionState exceptionState(ExceptionState::SetterContext, "immutablePoint
", "TestSVG", info.Holder(), info.GetIsolate()); |
| 160 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 160 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 161 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | 161 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
| 162 if (!WTF::getPtr(cppValue)) { | 162 if (!WTF::getPtr(cppValue)) { |
| 163 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi
nt'."); | 163 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi
nt'."); |
| 164 exceptionState.throwIfNeeded(); | 164 exceptionState.throwIfNeeded(); |
| 165 return; | 165 return; |
| 166 } | 166 } |
| 167 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); | 167 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); |
| 168 } | 168 } |
| 169 | 169 |
| 170 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 170 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 171 { | 171 { |
| 172 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 172 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 173 TestSVGV8Internal::immutablePointAttributeSetter(jsValue, info); | 173 TestSVGV8Internal::immutablePointAttributeSetter(jsValue, info); |
| 174 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 174 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 175 } | 175 } |
| 176 | 176 |
| 177 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 177 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 178 { | 178 { |
| 179 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getSVGDocum
ent", "TestSVG", info.Holder(), info.GetIsolate()); | 179 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getSVGDocum
ent", "TestSVG", info.Holder(), info.GetIsolate()); |
| 180 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 180 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 181 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionS
tate), exceptionState)) { | 181 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionS
tate), exceptionState)) { |
| 182 v8SetReturnValueNull(info); | 182 v8SetReturnValueNull(info); |
| 183 exceptionState.throwIfNeeded(); | 183 exceptionState.throwIfNeeded(); |
| 184 return; | 184 return; |
| 185 } | 185 } |
| 186 RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState); | 186 RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState); |
| 187 if (exceptionState.throwIfNeeded()) | 187 if (exceptionState.throwIfNeeded()) |
| 188 return; | 188 return; |
| 189 v8SetReturnValue(info, result.release()); | 189 v8SetReturnValue(info, result.release()); |
| 190 } | 190 } |
| 191 | 191 |
| 192 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 192 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 193 { | 193 { |
| 194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 195 TestSVGV8Internal::getSVGDocumentMethod(info); | 195 TestSVGV8Internal::getSVGDocumentMethod(info); |
| 196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 197 } | 197 } |
| 198 | 198 |
| 199 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 199 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 200 { | 200 { |
| 201 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 201 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 202 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>mutablePointFunction()))); | 202 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>mutablePointFunction()))); |
| 203 } | 203 } |
| 204 | 204 |
| 205 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 205 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 206 { | 206 { |
| 207 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 207 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 208 TestSVGV8Internal::mutablePointFunctionMethod(info); | 208 TestSVGV8Internal::mutablePointFunctionMethod(info); |
| 209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 210 } | 210 } |
| 211 | 211 |
| 212 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 212 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 213 { | 213 { |
| 214 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 214 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 215 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunction()))); | 215 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunction()))); |
| 216 } | 216 } |
| 217 | 217 |
| 218 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 218 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
| 219 { | 219 { |
| 220 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 220 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 221 TestSVGV8Internal::immutablePointFunctionMethod(info); | 221 TestSVGV8Internal::immutablePointFunctionMethod(info); |
| 222 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 222 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 223 } | 223 } |
| 224 | 224 |
| 225 static void immutablePointFunctionTypedefMethod(const v8::FunctionCallbackInfo<v
8::Value>& info) | 225 static void immutablePointFunctionTypedefMethod(const v8::FunctionCallbackInfo<v
8::Value>& info) |
| 226 { | 226 { |
| 227 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 227 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 228 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunctionTypedef()))); | 228 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunctionTypedef()))); |
| 229 } | 229 } |
| 230 | 230 |
| 231 static void immutablePointFunctionTypedefMethodCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 231 static void immutablePointFunctionTypedefMethodCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
| 232 { | 232 { |
| 233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 234 TestSVGV8Internal::immutablePointFunctionTypedefMethod(info); | 234 TestSVGV8Internal::immutablePointFunctionTypedefMethod(info); |
| 235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 236 } | 236 } |
| 237 | 237 |
| 238 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 238 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
| 239 { | 239 { |
| 240 ExceptionState exceptionState(ExceptionState::ExecutionContext, "svgPointMet
hod", "TestSVG", info.Holder(), info.GetIsolate()); | 240 ExceptionState exceptionState(ExceptionState::ExecutionContext, "svgPointMet
hod", "TestSVG", info.Holder(), info.GetIsolate()); |
| 241 if (UNLIKELY(info.Length() < 2)) { | 241 if (UNLIKELY(info.Length() < 2)) { |
| 242 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 242 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 243 exceptionState.throwIfNeeded(); | 243 exceptionState.throwIfNeeded(); |
| 244 return; | 244 return; |
| 245 } | 245 } |
| 246 TestSVG* imp = V8TestSVG::toNative(info.Holder()); | 246 TestSVG* imp = V8TestSVG::toNative(info.Holder()); |
| 247 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); | 247 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::has
Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint:
:toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); |
| 248 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[1], exceptionState)
, exceptionState); | 248 V8TRYCATCH_EXCEPTION_VOID(unsigned, index, toUInt32(info[1], exceptionState)
, exceptionState); |
| 249 if (!item) { | 249 if (!item) { |
| 250 exceptionState.throwTypeError("parameter 1 is not of type 'SVGPoint'."); | 250 exceptionState.throwTypeError("parameter 1 is not of type 'SVGPoint'."); |
| 251 exceptionState.throwIfNeeded(); | 251 exceptionState.throwIfNeeded(); |
| 252 return; | 252 return; |
| 253 } | 253 } |
| 254 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); | 254 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); |
| 255 } | 255 } |
| 256 | 256 |
| 257 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 257 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
| 258 { | 258 { |
| 259 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 259 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 260 TestSVGV8Internal::svgPointMethodMethod(info); | 260 TestSVGV8Internal::svgPointMethodMethod(info); |
| 261 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 261 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 262 } | 262 } |
| 263 | 263 |
| 264 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 264 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
| 265 { | 265 { |
| 266 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPo
intMethod", "TestSVG", info.Holder(), info.GetIsolate()); | 266 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPo
intMethod", "TestSVG", info.Holder(), info.GetIsolate()); |
| 267 if (UNLIKELY(info.Length() < 2)) { | 267 if (UNLIKELY(info.Length() < 2)) { |
| 268 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 268 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 269 exceptionState.throwIfNeeded(); | 269 exceptionState.throwIfNeeded(); |
| 270 return; | 270 return; |
| 271 } | 271 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 285 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index
, exceptionState); | 285 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index
, exceptionState); |
| 286 if (exceptionState.throwIfNeeded()) | 286 if (exceptionState.throwIfNeeded()) |
| 287 return; | 287 return; |
| 288 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu
lt))); | 288 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu
lt))); |
| 289 } | 289 } |
| 290 | 290 |
| 291 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 291 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
| 292 { | 292 { |
| 293 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 293 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 294 TestSVGV8Internal::strictSVGPointMethodMethod(info); | 294 TestSVGV8Internal::strictSVGPointMethodMethod(info); |
| 295 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 295 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace TestSVGV8Internal | 298 } // namespace TestSVGV8Internal |
| 299 | 299 |
| 300 static const V8DOMConfiguration::AttributeConfiguration V8TestSVGAttributes[] =
{ | 300 static const V8DOMConfiguration::AttributeConfiguration V8TestSVGAttributes[] =
{ |
| 301 {"animatedReflectedAttribute", TestSVGV8Internal::animatedReflectedAttribute
AttributeGetterCallback, TestSVGV8Internal::animatedReflectedAttributeAttributeS
etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 301 {"animatedReflectedAttribute", TestSVGV8Internal::animatedReflectedAttribute
AttributeGetterCallback, TestSVGV8Internal::animatedReflectedAttributeAttributeS
etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast
<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 302 {"mutablePoint", TestSVGV8Internal::mutablePointAttributeGetterCallback, Tes
tSVGV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::Ac
cessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | 302 {"mutablePoint", TestSVGV8Internal::mutablePointAttributeGetterCallback, Tes
tSVGV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::Ac
cessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, |
| 303 {"immutablePoint", TestSVGV8Internal::immutablePointAttributeGetterCallback,
TestSVGV8Internal::immutablePointAttributeSetterCallback, 0, 0, 0, static_cast<
v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0
/* on instance */}, | 303 {"immutablePoint", TestSVGV8Internal::immutablePointAttributeGetterCallback,
TestSVGV8Internal::immutablePointAttributeSetterCallback, 0, 0, 0, static_cast<
v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0
/* on instance */}, |
| 304 }; | 304 }; |
| 305 | 305 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 fromInternalPointer(object)->deref(); | 381 fromInternalPointer(object)->deref(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 template<> | 384 template<> |
| 385 v8::Handle<v8::Value> toV8NoInline(TestSVG* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 385 v8::Handle<v8::Value> toV8NoInline(TestSVG* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
| 386 { | 386 { |
| 387 return toV8(impl, creationContext, isolate); | 387 return toV8(impl, creationContext, isolate); |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace WebCore | 390 } // namespace WebCore |
| OLD | NEW |