Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: Source/bindings/templates/methods.cpp

Issue 142593004: Revert of IDL compiler: sync Python to r165262 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 {% filter conditional(method.conditional_string) %} 239 {% filter conditional(method.conditional_string) %}
240 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall backInfo<v8::Value>& info) 240 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall backInfo<v8::Value>& info)
241 { 241 {
242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
243 {% if method.measure_as %} 243 {% if method.measure_as %}
244 UseCounter::count(activeExecutionContext(), UseCounter::{{method.measure_as} }); 244 UseCounter::count(activeExecutionContext(), UseCounter::{{method.measure_as} });
245 {% endif %} 245 {% endif %}
246 {% if method.deprecate_as %} 246 {% if method.deprecate_as %}
247 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{method. deprecate_as}}); 247 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::{{method. deprecate_as}});
248 {% endif %} 248 {% endif %}
249 {% for argument in method.arguments if argument.idl_type == 'Node' %}
250 if (V8DOMWrapper::isWrapperOfType(info[{{argument.index}}], &V8Attr::wrapper TypeInfo))
251 UseCounter::count(activeExecutionContext(), UseCounter::AttrUsedAsNodePa rameter);
252 {% endfor %}
253 {% if world_suffix in method.activity_logging_world_list %} 249 {% if world_suffix in method.activity_logging_world_list %}
254 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext()); 250 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge tCurrentContext());
255 if (contextData && contextData->activityLogger()) { 251 if (contextData && contextData->activityLogger()) {
256 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) 252 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0)
257 and delete toVectorOfArguments #} 253 and delete toVectorOfArguments #}
258 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);
259 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");
260 } 256 }
261 {% endif %} 257 {% endif %}
262 {% if method.is_custom %} 258 {% if method.is_custom %}
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 v8::Handle<v8::Object> wrapper = info.Holder(); 390 v8::Handle<v8::Object> wrapper = info.Holder();
395 {% if is_constructor_raises_exception %} 391 {% if is_constructor_raises_exception %}
396 if (exceptionState.throwIfNeeded()) 392 if (exceptionState.throwIfNeeded())
397 return; 393 return;
398 {% endif %} 394 {% endif %}
399 395
400 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);
401 v8SetReturnValue(info, wrapper); 397 v8SetReturnValue(info, wrapper);
402 } 398 }
403 {% endmacro %} 399 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/attributes.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698