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

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

Issue 2692753003: [Bindings] Update runtime enabled features from partial interfaces (Closed)
Patch Set: Remove needless classname addition Created 3 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
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 * a C++ pointer to the DOM object (if the object is not in oilpan) #} 129 * a C++ pointer to the DOM object (if the object is not in oilpan) #}
130 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{c ustom_internal_field_counter}}; 130 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + {{c ustom_internal_field_counter}};
131 {# End custom internal fields #} 131 {# End custom internal fields #}
132 {% if unscopables or has_conditional_attributes_on_prototype or 132 {% if unscopables or has_conditional_attributes_on_prototype or
133 methods | conditionally_exposed(is_partial) %} 133 methods | conditionally_exposed(is_partial) %}
134 {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Conte xt>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8 ::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate); 134 {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Conte xt>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8 ::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate);
135 {% elif has_partial_interface %} 135 {% elif has_partial_interface %}
136 {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Conte xt>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8 ::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) {} 136 {{exported}}static void preparePrototypeAndInterfaceObject(v8::Local<v8::Conte xt>, const DOMWrapperWorld&, v8::Local<v8::Object> prototypeObject, v8::Local<v8 ::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfaceTemplate) {}
137 {% endif %} 137 {% endif %}
138 {% if has_partial_interface %} 138 {% if has_partial_interface %}
139 {{exported}}static void updateWrapperTypeInfo(InstallTemplateFunction, Prepare PrototypeAndInterfaceObjectFunction); 139 {{exported}}static void updateWrapperTypeInfo(InstallTemplateFunction, Install RuntimeEnabledFunction, PreparePrototypeAndInterfaceObjectFunction);
140 {{exported}}static void install{{v8_class}}Template(v8::Isolate*, const DOMWra pperWorld&, v8::Local<v8::FunctionTemplate> interfaceTemplate); 140 {{exported}}static void install{{v8_class}}Template(v8::Isolate*, const DOMWra pperWorld&, v8::Local<v8::FunctionTemplate> interfaceTemplate);
141 {% for method in methods if method.overloads and method.overloads.has_partial_ overloads %} 141 {% for method in methods if method.overloads and method.overloads.has_partial_ overloads %}
142 {{exported}}static void register{{method.name | blink_capitalize}}MethodForPar tialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&)); 142 {{exported}}static void register{{method.name | blink_capitalize}}MethodForPar tialInterface(void (*)(const v8::FunctionCallbackInfo<v8::Value>&));
143 {% endfor %} 143 {% endfor %}
144 {% endif %} 144 {% endif %}
145 145
146 {% if needs_runtime_enabled_installer %}
147 {{exported}}static void installRuntimeEnabledFeatures(
148 v8::Isolate* isolate,
149 const DOMWrapperWorld& world,
150 v8::Local<v8::Object> instance,
151 v8::Local<v8::Object> prototype,
152 v8::Local<v8::Function> interface);
153 {% endif %}
154
155 {% for feature in origin_trial_features %} 146 {% for feature in origin_trial_features %}
156 147
157 static void install{{feature.name}}(v8::Isolate*, const DOMWrapperWorld&, v8:: Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Funct ion> interface); 148 static void install{{feature.name}}(v8::Isolate*, const DOMWrapperWorld&, v8:: Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Funct ion> interface);
158 static void install{{feature.name}}(ScriptState*, v8::Local<v8::Object> instan ce); 149 static void install{{feature.name}}(ScriptState*, v8::Local<v8::Object> instan ce);
159 {% if not feature.needs_instance %} 150 {% if not feature.needs_instance %}
160 static void install{{feature.name}}(ScriptState*); 151 static void install{{feature.name}}(ScriptState*);
161 {% endif %} 152 {% endif %}
162 {% endfor %} 153 {% endfor %}
163 154
164 // Callback functions 155 // Callback functions
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 {% if indexed_property_getter or named_property_getter %} 242 {% if indexed_property_getter or named_property_getter %}
252 {{exported}}static void indexedPropertyGetterCallback(uint32_t index, const v8 ::PropertyCallbackInfo<v8::Value>&); 243 {{exported}}static void indexedPropertyGetterCallback(uint32_t index, const v8 ::PropertyCallbackInfo<v8::Value>&);
253 {% endif %} 244 {% endif %}
254 {% if indexed_property_setter or named_property_setter %} 245 {% if indexed_property_setter or named_property_setter %}
255 {{exported}}static void indexedPropertySetterCallback(uint32_t index, v8::Loca l<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&); 246 {{exported}}static void indexedPropertySetterCallback(uint32_t index, v8::Loca l<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
256 {% endif %} 247 {% endif %}
257 {% if indexed_property_deleter or named_property_deleter %} 248 {% if indexed_property_deleter or named_property_deleter %}
258 {{exported}}static void indexedPropertyDeleterCallback(uint32_t index, const v 8::PropertyCallbackInfo<v8::Boolean>&); 249 {{exported}}static void indexedPropertyDeleterCallback(uint32_t index, const v 8::PropertyCallbackInfo<v8::Boolean>&);
259 {% endif %} 250 {% endif %}
260 251
252 {% if needs_runtime_enabled_installer %}
253 {{exported}}static void installRuntimeEnabledFeatures(
254 v8::Isolate* isolate,
255 const DOMWrapperWorld& world,
256 v8::Local<v8::Object> instance,
257 v8::Local<v8::Object> prototype,
258 v8::Local<v8::Function> interface);
259
260 {% if has_partial_interface %}
261 static InstallRuntimeEnabledFunction install{{v8_class}}RuntimeEnabledFunction ;
262 {% endif %}
263 {% endif %}
264
261 {% if has_partial_interface %} 265 {% if has_partial_interface %}
262 private: 266 private:
263 static InstallTemplateFunction install{{v8_class}}TemplateFunction; 267 static InstallTemplateFunction install{{v8_class}}TemplateFunction;
264 {% endif %} 268 {% endif %}
265 }; 269 };
266 270
267 {% if has_event_constructor %} 271 {% if has_event_constructor %}
268 {{exported}}bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info); 272 {{exported}}bool initialize{{cpp_class}}({{cpp_class}}Init&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info);
269 273
270 {% endif %} 274 {% endif %}
271 template <> 275 template <>
272 struct V8TypeOf<{{cpp_class}}> { 276 struct V8TypeOf<{{cpp_class}}> {
273 typedef {{v8_class}} Type; 277 typedef {{v8_class}} Type;
274 }; 278 };
275 279
276 } // namespace blink 280 } // namespace blink
277 281
278 #endif // {{v8_class}}_h 282 #endif // {{v8_class}}_h
279 283
280 {% endfilter %}{# format_blink_cpp_source_code #} 284 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698