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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/attributes.cpp

Issue 1914923002: Rename all existing custom element classes as V0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CustomElementV0 -> V0CustomElement Created 4 years, 7 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 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_origin_trial %} 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_origin_trial %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro attribute_getter(attribute, world_suffix) %} 4 {% macro attribute_getter(attribute, world_suffix) %}
5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}(
6 {%- if attribute.is_data_type_property %} 6 {%- if attribute.is_data_type_property %}
7 const v8::PropertyCallbackInfo<v8::Value>& info 7 const v8::PropertyCallbackInfo<v8::Value>& info
8 {%- else %} 8 {%- else %}
9 const v8::FunctionCallbackInfo<v8::Value>& info 9 const v8::FunctionCallbackInfo<v8::Value>& info
10 {%- endif %}) 10 {%- endif %})
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), "{{at tribute.enum_type}}", exceptionState)) { 318 if (!isValidEnum(cppValue, validValues, WTF_ARRAY_LENGTH(validValues), "{{at tribute.enum_type}}", exceptionState)) {
319 currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMes sage::create(JSMessageSource, WarningMessageLevel, exceptionState.message())); 319 currentExecutionContext(info.GetIsolate())->addConsoleMessage(ConsoleMes sage::create(JSMessageSource, WarningMessageLevel, exceptionState.message()));
320 return; 320 return;
321 } 321 }
322 {% endif %} 322 {% endif %}
323 {# Pre-set context #} 323 {# Pre-set context #}
324 {% if attribute.is_custom_element_callbacks or 324 {% if attribute.is_custom_element_callbacks or
325 (attribute.is_reflect and 325 (attribute.is_reflect and
326 not(attribute.idl_type == 'DOMString' and is_node)) %} 326 not(attribute.idl_type == 'DOMString' and is_node)) %}
327 {# Skip on compact node DOMString getters #} 327 {# Skip on compact node DOMString getters #}
328 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 328 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
329 {% endif %} 329 {% endif %}
330 {% if attribute.is_call_with_execution_context or 330 {% if attribute.is_call_with_execution_context or
331 attribute.is_setter_call_with_execution_context %} 331 attribute.is_setter_call_with_execution_context %}
332 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 332 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
333 {% endif %} 333 {% endif %}
334 {% if attribute.is_call_with_script_state %} 334 {% if attribute.is_call_with_script_state %}
335 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); 335 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
336 {% endif %} 336 {% endif %}
337 {# Set #} 337 {# Set #}
338 {% if attribute.cpp_setter %} 338 {% if attribute.cpp_setter %}
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 V8PerContextData* contextData = scriptState->perContextData(); 372 V8PerContextData* contextData = scriptState->perContextData();
373 {% if attribute.activity_logging_world_check %} 373 {% if attribute.activity_logging_world_check %}
374 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) { 374 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) {
375 {% else %} 375 {% else %}
376 if (contextData && contextData->activityLogger()) { 376 if (contextData && contextData->activityLogger()) {
377 {% endif %} 377 {% endif %}
378 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value); 378 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value);
379 } 379 }
380 {% endif %} 380 {% endif %}
381 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} 381 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %}
382 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 382 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
383 {% endif %} 383 {% endif %}
384 {% if attribute.has_custom_setter %} 384 {% if attribute.has_custom_setter %}
385 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); 385 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
386 {% else %} 386 {% else %}
387 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeSetter{{world _suffix}}(v8Value, info); 387 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeSetter{{world _suffix}}(v8Value, info);
388 {% endif %} 388 {% endif %}
389 } 389 }
390 {% endmacro %} 390 {% endmacro %}
391 391
392 392
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 setter_callback_for_main_world, 499 setter_callback_for_main_world,
500 wrapper_type_info, 500 wrapper_type_info,
501 access_control, 501 access_control,
502 property_attribute, 502 property_attribute,
503 only_exposed_to_private_script, 503 only_exposed_to_private_script,
504 property_location(attribute), 504 property_location(attribute),
505 holder_check, 505 holder_check,
506 ] %} 506 ] %}
507 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} 507 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}}
508 {%- endmacro %} 508 {%- endmacro %}
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_methods.py ('k') | third_party/WebKit/Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698