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

Side by Side Diff: sky/engine/bindings/templates/methods.cpp

Issue 676723003: Remove postMessage, MessageChannel and MessagePort. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « sky/engine/bindings/core/v8/v8.gypi ('k') | sky/engine/core/core.gni » ('j') | 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 {# Local variables #} 6 {# Local variables #}
7 {% if method.has_exception_state %} 7 {% if method.has_exception_state %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {# Overloaded methods have length checked during overload resolution #} 10 {# Overloaded methods have length checked during overload resolution #}
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 {% if method.idl_type == 'Promise' %} 168 {% if method.idl_type == 'Promise' %}
169 TONATIVE_VOID_PROMISE_INTERNAL({{argument.name}}NativeValue, info[{{argument.ind ex}}]->NumberValue(), info); 169 TONATIVE_VOID_PROMISE_INTERNAL({{argument.name}}NativeValue, info[{{argument.ind ex}}]->NumberValue(), info);
170 {% else %} 170 {% else %}
171 TONATIVE_VOID_INTERNAL({{argument.name}}NativeValue, info[{{argument.index}}]->N umberValue()); 171 TONATIVE_VOID_INTERNAL({{argument.name}}NativeValue, info[{{argument.index}}]->N umberValue());
172 {% endif %} 172 {% endif %}
173 if (!std::isnan({{argument.name}}NativeValue)) 173 if (!std::isnan({{argument.name}}NativeValue))
174 {# IDL type is used for clamping, for the right bounds, since different 174 {# IDL type is used for clamping, for the right bounds, since different
175 IDL integer types have same internal C++ type (int or unsigned) #} 175 IDL integer types have same internal C++ type (int or unsigned) #}
176 {{argument.name}} = clampTo<{{argument.idl_type}}>({{argument.name}}NativeVa lue); 176 {{argument.name}} = clampTo<{{argument.idl_type}}>({{argument.name}}NativeVa lue);
177 {% elif argument.idl_type == 'SerializedScriptValue' %} 177 {% elif argument.idl_type == 'SerializedScriptValue' %}
178 {{argument.name}} = SerializedScriptValue::create(info[{{argument.index}}], 0, 0 , exceptionState, info.GetIsolate()); 178 {{argument.name}} = SerializedScriptValue::create(info[{{argument.index}}], 0, e xceptionState, info.GetIsolate());
179 if (exceptionState.hadException()) { 179 if (exceptionState.hadException()) {
180 {{throw_from_exception_state(method)}}; 180 {{throw_from_exception_state(method)}};
181 return; 181 return;
182 } 182 }
183 {% elif argument.is_variadic_wrapper_type %} 183 {% elif argument.is_variadic_wrapper_type %}
184 for (int i = {{argument.index}}; i < info.Length(); ++i) { 184 for (int i = {{argument.index}}; i < info.Length(); ++i) {
185 if (!V8{{argument.idl_type}}::hasInstance(info[i], info.GetIsolate())) { 185 if (!V8{{argument.idl_type}}::hasInstance(info[i], info.GetIsolate())) {
186 {{throw_type_error(method, '"parameter %s is not of type \'%s\'."' % 186 {{throw_type_error(method, '"parameter %s is not of type \'%s\'."' %
187 (argument.index + 1, argument.idl_type)) | in dent(8)}} 187 (argument.index + 1, argument.idl_type)) | in dent(8)}}
188 return; 188 return;
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if method.is_per_world_bindings else '0' %} 629 if method.is_per_world_bindings else '0' %}
630 {% set property_attribute = 630 {% set property_attribute =
631 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es) 631 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attribut es)
632 if method.property_attributes else 'v8::None' %} 632 if method.property_attributes else 'v8::None' %}
633 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %} 633 {% set only_exposed_to_private_script = 'V8DOMConfiguration::OnlyExposedToPrivat eScript' if method.only_exposed_to_private_script else 'V8DOMConfiguration::Expo sedToAllScripts' %}
634 static const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfig uration = { 634 static const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfig uration = {
635 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{only_exposed_to_private_script}}, 635 "{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{only_exposed_to_private_script}},
636 }; 636 };
637 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate); 637 V8DOMConfiguration::installMethod({{method.function_template}}, {{method.signatu re}}, {{property_attribute}}, {{method.name}}MethodConfiguration, isolate);
638 {%- endmacro %} 638 {%- endmacro %}
OLDNEW
« no previous file with comments | « sky/engine/bindings/core/v8/v8.gypi ('k') | sky/engine/core/core.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698