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

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

Issue 1029093003: [WIP] IDL: Add limited serializer support and use for RTCIceCandidate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use V8ObjectBuilder in modules/crypto Created 5 years, 9 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
OLDNEW
1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %} 1 {% from 'conversions.cpp' import v8_value_to_local_cpp_value %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro generate_method(method, world_suffix) %} 5 {% macro generate_method(method, world_suffix) %}
6 {% filter conditional(method.conditional_string) %} 6 {% filter conditional(method.conditional_string) %}
7 {% if method.returns_promise and method.has_exception_state %} 7 {% if method.returns_promise and method.has_exception_state %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
9 {% else %} 9 {% else %}
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())); 237 Document& document = *toDocument(currentExecutionContext(info.GetIsolate()));
238 {% endif %} 238 {% endif %}
239 {# Call #} 239 {# Call #}
240 {% if method.idl_type == 'void' %} 240 {% if method.idl_type == 'void' %}
241 {{cpp_value}}; 241 {{cpp_value}};
242 {% elif method.is_implemented_in_private_script %} 242 {% elif method.is_implemented_in_private_script %}
243 {{method.cpp_type}} result{{method.cpp_type_initializer}}; 243 {{method.cpp_type}} result{{method.cpp_type_initializer}};
244 if (!{{method.cpp_value}}) 244 if (!{{method.cpp_value}})
245 return; 245 return;
246 {% elif method.use_output_parameter_for_result %} 246 {% elif method.use_output_parameter_for_result %}
247 {{method.cpp_type}} result; 247 {{method.cpp_type}} result{{method.cpp_type_initializer}};
248 {{cpp_value}}; 248 {{cpp_value}};
249 {% elif method.is_constructor %} 249 {% elif method.is_constructor %}
250 {{method.cpp_type}} impl = {{cpp_value}}; 250 {{method.cpp_type}} impl = {{cpp_value}};
251 {% elif method.use_local_result %} 251 {% elif method.use_local_result %}
252 {{method.cpp_type}} result = {{cpp_value}}; 252 {{method.cpp_type}} result = {{cpp_value}};
253 {% endif %} 253 {% endif %}
254 {# Post-call #} 254 {# Post-call #}
255 {% if method.is_raises_exception %} 255 {% if method.is_raises_exception %}
256 if (exceptionState.hadException()) { 256 if (exceptionState.hadException()) {
257 {{propagate_error_with_exception_state(method) | indent}} 257 {{propagate_error_with_exception_state(method) | indent}}
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 if method.overloads else 653 if method.overloads else
654 method.runtime_enabled_function) %} 654 method.runtime_enabled_function) %}
655 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction()); 655 prototypeObject->Set(v8AtomicString(isolate, "{{method.name}}"), v8::Functio nTemplate::New(isolate, {{cpp_class_or_partial}}V8Internal::{{method.name}}Metho dCallback, v8Undefined(), defaultSignature, {{method.number_of_required_argument s}})->GetFunction());
656 {% endfilter %}{# runtime_enabled() #} 656 {% endfilter %}{# runtime_enabled() #}
657 {% endfilter %}{# exposed() #} 657 {% endfilter %}{# exposed() #}
658 {% endfilter %}{# per_context_enabled() #} 658 {% endfilter %}{# per_context_enabled() #}
659 {% endfor %} 659 {% endfor %}
660 {% endif %} 660 {% endif %}
661 } 661 }
662 {%- endmacro %} 662 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698