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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/interface.h

Issue 2296573003: binding: Reduces the binary size of binding's generated code. (Closed)
Patch Set: Created 4 years, 3 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 {% filter format_blink_cpp_source_code %} 1 {% filter format_blink_cpp_source_code %}
2 2
3 {% include 'copyright_block.txt' %} 3 {% include 'copyright_block.txt' %}
4 #ifndef {{v8_class}}_h 4 #ifndef {{v8_class}}_h
5 #define {{v8_class}}_h 5 #define {{v8_class}}_h
6 6
7 {% for filename in header_includes %} 7 {% for filename in header_includes %}
8 #include "{{filename}}" 8 #include "{{filename}}"
9 {% endfor %} 9 {% endfor %}
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun t + {{custom_internal_field_counter}}; 147 static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCoun t + {{custom_internal_field_counter}};
148 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %} 148 {% set custom_internal_field_counter = custom_internal_field_counter + 1 %}
149 {% endif %} 149 {% endif %}
150 {# persistentHandleIndex must be the last field, if it is present. 150 {# persistentHandleIndex must be the last field, if it is present.
151 Detailed explanation: https://codereview.chromium.org/139173012 151 Detailed explanation: https://codereview.chromium.org/139173012
152 FIXME: Remove this internal field, and share one field for either: 152 FIXME: Remove this internal field, and share one field for either:
153 * a persistent handle (if the object is in oilpan) or 153 * a persistent handle (if the object is in oilpan) or
154 * a C++ pointer to the DOM object (if the object is not in oilpan) #} 154 * a C++ pointer to the DOM object (if the object is not in oilpan) #}
155 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + { {custom_internal_field_counter}}; 155 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + { {custom_internal_field_counter}};
156 {# End custom internal fields #} 156 {# End custom internal fields #}
157 {% if has_conditional_attributes %} 157 {% if unscopeables or has_conditional_attributes_on_prototype or
158 static void installConditionallyEnabledProperties(v8::Local<v8::Object>, v8: :Isolate*); 158 methods | conditionally_exposed(is_partial) %}
159 {% endif %} 159 {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Con text>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local< v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate );
160 {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Con text>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local< v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate ){% if unscopeables or has_conditional_attributes_on_prototype or methods | cond itionally_exposed(is_partial) %};
161 {% else %} { }
162 {% endif %} 160 {% endif %}
163 {% if has_partial_interface %} 161 {% if has_partial_interface %}
164 {{exported}}static void updateWrapperTypeInfo(InstallTemplateFunction, Prepa rePrototypeAndInterfaceObjectFunction); 162 {{exported}}static void updateWrapperTypeInfo(InstallTemplateFunction, Prepa rePrototypeAndInterfaceObjectFunction);
165 {{exported}}static void install{{v8_class}}Template(v8::Isolate*, const DOMW rapperWorld&, v8::Local<v8::FunctionTemplate> interfaceTemplate); 163 {{exported}}static void install{{v8_class}}Template(v8::Isolate*, const DOMW rapperWorld&, v8::Local<v8::FunctionTemplate> interfaceTemplate);
166 {% for method in methods if method.overloads and method.overloads.has_partia l_overloads %} 164 {% for method in methods if method.overloads and method.overloads.has_partia l_overloads %}
167 {{exported}}static void register{{method.name | blink_capitalize}}MethodForP artialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&)); 165 {{exported}}static void register{{method.name | blink_capitalize}}MethodForP artialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
168 {% endfor %} 166 {% endfor %}
169 {% endif %} 167 {% endif %}
170 {% for origin_trial_feature in origin_trial_features %}{{newline}} 168 {% for origin_trial_feature in origin_trial_features %}{{newline}}
171 static void install{{origin_trial_feature.name}}(ScriptState*, v8::Local<v8: :Object> instance); 169 static void install{{origin_trial_feature.name}}(ScriptState*, v8::Local<v8: :Object> instance);
(...skipping 15 matching lines...) Expand all
187 template <> 185 template <>
188 struct V8TypeOf<{{cpp_class}}> { 186 struct V8TypeOf<{{cpp_class}}> {
189 typedef {{v8_class}} Type; 187 typedef {{v8_class}} Type;
190 }; 188 };
191 189
192 } // namespace blink 190 } // namespace blink
193 191
194 #endif // {{v8_class}}_h 192 #endif // {{v8_class}}_h
195 193
196 {% endfilter %}{# format_blink_cpp_source_code #} 194 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_interface.py ('k') | third_party/WebKit/Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698