OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro generate_method(method, world_suffix) %} | 2 {% macro generate_method(method, world_suffix) %} |
3 {% filter conditional(method.conditional_string) %} | 3 {% filter conditional(method.conditional_string) %} |
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
5 { | 5 { |
6 {% if method.has_exception_state %} | 6 {% if method.has_exception_state %} |
7 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 7 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
8 {% endif %} | 8 {% endif %} |
9 {% if method.name in ['addEventListener', 'removeEventListener'] %} | 9 {% if method.name in ['addEventListener', 'removeEventListener'] %} |
10 {{add_remove_event_listener_method(method.name) | indent}} | 10 {{add_remove_event_listener_method(method.name) | indent}} |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 and delete toVectorOfArguments #} | 253 and delete toVectorOfArguments #} |
254 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 254 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
255 contextData->activityLogger()->log("{{interface_name}}.{{method.name}}",
info.Length(), loggerArgs.data(), "Method"); | 255 contextData->activityLogger()->log("{{interface_name}}.{{method.name}}",
info.Length(), loggerArgs.data(), "Method"); |
256 } | 256 } |
257 {% endif %} | 257 {% endif %} |
258 {% if method.is_custom %} | 258 {% if method.is_custom %} |
259 {{v8_class}}::{{method.name}}MethodCustom(info); | 259 {{v8_class}}::{{method.name}}MethodCustom(info); |
260 {% else %} | 260 {% else %} |
261 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); | 261 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); |
262 {% endif %} | 262 {% endif %} |
263 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 263 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
264 } | 264 } |
265 {% endfilter %} | 265 {% endfilter %} |
266 {% endmacro %} | 266 {% endmacro %} |
267 | 267 |
268 | 268 |
269 {##############################################################################} | 269 {##############################################################################} |
270 {% macro origin_safe_method_getter(method, world_suffix) %} | 270 {% macro origin_safe_method_getter(method, world_suffix) %} |
271 static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 271 static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
272 { | 272 { |
273 {# FIXME: don't call GetIsolate() so often #} | 273 {# FIXME: don't call GetIsolate() so often #} |
(...skipping 25 matching lines...) Expand all Loading... |
299 return; | 299 return; |
300 } | 300 } |
301 | 301 |
302 v8SetReturnValue(info, privateTemplate->GetFunction()); | 302 v8SetReturnValue(info, privateTemplate->GetFunction()); |
303 } | 303 } |
304 | 304 |
305 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo
cal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 305 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo
cal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
306 { | 306 { |
307 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 307 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
308 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix
}}(info); | 308 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix
}}(info); |
309 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 309 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
310 } | 310 } |
311 {% endmacro %} | 311 {% endmacro %} |
312 | 312 |
313 | 313 |
314 {##############################################################################} | 314 {##############################################################################} |
315 {% macro generate_constructor(constructor) %} | 315 {% macro generate_constructor(constructor) %} |
316 static void constructor{{constructor.overload_index}}(const v8::FunctionCallback
Info<v8::Value>& info) | 316 static void constructor{{constructor.overload_index}}(const v8::FunctionCallback
Info<v8::Value>& info) |
317 { | 317 { |
318 {% if interface_length and not constructor.overload_index %} | 318 {% if interface_length and not constructor.overload_index %} |
319 {# FIXME: remove this UNLIKELY: constructors are heavy, so no difference. #} | 319 {# FIXME: remove this UNLIKELY: constructors are heavy, so no difference. #} |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 v8::Handle<v8::Object> wrapper = info.Holder(); | 390 v8::Handle<v8::Object> wrapper = info.Holder(); |
391 {% if is_constructor_raises_exception %} | 391 {% if is_constructor_raises_exception %} |
392 if (exceptionState.throwIfNeeded()) | 392 if (exceptionState.throwIfNeeded()) |
393 return; | 393 return; |
394 {% endif %} | 394 {% endif %} |
395 | 395 |
396 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8
_class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfigu
ration::Dependent); | 396 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8
_class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfigu
ration::Dependent); |
397 v8SetReturnValue(info, wrapper); | 397 v8SetReturnValue(info, wrapper); |
398 } | 398 } |
399 {% endmacro %} | 399 {% endmacro %} |
OLD | NEW |