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

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

Issue 139653005: IDL compiler: sync Python to r166626 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Refactored Created 6 years, 10 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/interface.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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 {% endif %} 337 {% endif %}
338 {% for argument in constructor.arguments %} 338 {% for argument in constructor.arguments %}
339 {{generate_argument(constructor, argument) | indent}} 339 {{generate_argument(constructor, argument) | indent}}
340 {% endfor %} 340 {% endfor %}
341 {% if is_constructor_call_with_execution_context %} 341 {% if is_constructor_call_with_execution_context %}
342 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); 342 ExecutionContext* context = currentExecutionContext(info.GetIsolate());
343 {% endif %} 343 {% endif %}
344 {% if is_constructor_call_with_document %} 344 {% if is_constructor_call_with_document %}
345 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 345 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
346 {% endif %} 346 {% endif %}
347 RefPtr<{{cpp_class}}> impl = {{cpp_class}}::create({{constructor.argument_li st | join(', ')}}); 347 {{ref_ptr}}<{{cpp_class}}> impl = {{cpp_class}}::create({{constructor.argume nt_list | join(', ')}});
348 v8::Handle<v8::Object> wrapper = info.Holder(); 348 v8::Handle<v8::Object> wrapper = info.Holder();
349 {% if is_constructor_raises_exception %} 349 {% if is_constructor_raises_exception %}
350 if (exceptionState.throwIfNeeded()) 350 if (exceptionState.throwIfNeeded())
351 return; 351 return;
352 {% endif %} 352 {% endif %}
353 353
354 {# FIXME: Should probably be Independent unless [ActiveDOMObject] 354 {# FIXME: Should probably be Independent unless [ActiveDOMObject]
355 or [DependentLifetime]. #} 355 or [DependentLifetime]. #}
356 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8 _class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep endent); 356 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8 _class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dep endent);
357 v8SetReturnValue(info, wrapper); 357 v8SetReturnValue(info, wrapper);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 v8::Handle<v8::Object> wrapper = info.Holder(); 398 v8::Handle<v8::Object> wrapper = info.Holder();
399 {% if is_constructor_raises_exception %} 399 {% if is_constructor_raises_exception %}
400 if (exceptionState.throwIfNeeded()) 400 if (exceptionState.throwIfNeeded())
401 return; 401 return;
402 {% endif %} 402 {% endif %}
403 403
404 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8 _class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfigu ration::Dependent); 404 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{v8 _class}}Constructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfigu ration::Dependent);
405 v8SetReturnValue(info, wrapper); 405 v8SetReturnValue(info, wrapper);
406 } 406 }
407 {% endmacro %} 407 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698