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

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

Issue 1678003002: Remove sampling trace events from the binding layer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_api_experiment %} 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value, check_api_experiment %}
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 163
164 {##############################################################################} 164 {##############################################################################}
165 {% macro attribute_getter_callback(attribute, world_suffix) %} 165 {% macro attribute_getter_callback(attribute, world_suffix) %}
166 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}( 166 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}(
167 {%- if attribute.is_data_type_property %} 167 {%- if attribute.is_data_type_property %}
168 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info 168 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info
169 {%- else %} 169 {%- else %}
170 const v8::FunctionCallbackInfo<v8::Value>& info 170 const v8::FunctionCallbackInfo<v8::Value>& info
171 {%- endif %}) 171 {%- endif %})
172 { 172 {
173 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
174 {% if attribute.deprecate_as %} 173 {% if attribute.deprecate_as %}
175 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); 174 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
176 {% endif %} 175 {% endif %}
177 {% if attribute.measure_as %} 176 {% if attribute.measure_as %}
178 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); 177 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}});
179 {% endif %} 178 {% endif %}
180 {% if attribute.is_api_experiment_enabled %} 179 {% if attribute.is_api_experiment_enabled %}
181 {{check_api_experiment(attribute) | indent}} 180 {{check_api_experiment(attribute) | indent}}
182 {% endif %} 181 {% endif %}
183 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} 182 {% if world_suffix in attribute.activity_logging_world_list_for_getter %}
184 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); 183 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext());
185 V8PerContextData* contextData = scriptState->perContextData(); 184 V8PerContextData* contextData = scriptState->perContextData();
186 {% if attribute.activity_logging_world_check %} 185 {% if attribute.activity_logging_world_check %}
187 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) 186 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger())
188 {% else %} 187 {% else %}
189 if (contextData && contextData->activityLogger()) 188 if (contextData && contextData->activityLogger())
190 {% endif %} 189 {% endif %}
191 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute .name}}"); 190 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute .name}}");
192 {% endif %} 191 {% endif %}
193 {% if attribute.has_custom_getter %} 192 {% if attribute.has_custom_getter %}
194 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); 193 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info);
195 {% else %} 194 {% else %}
196 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeGetter{{world _suffix}}(info); 195 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeGetter{{world _suffix}}(info);
197 {% endif %} 196 {% endif %}
198 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
199 } 197 }
200 {% endmacro %} 198 {% endmacro %}
201 199
202 200
203 {##############################################################################} 201 {##############################################################################}
204 {% macro constructor_getter_callback(attribute, world_suffix) %} 202 {% macro constructor_getter_callback(attribute, world_suffix) %}
205 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca l<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) 203 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca l<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info)
206 { 204 {
207 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
208 {% if attribute.deprecate_as %} 205 {% if attribute.deprecate_as %}
209 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); 206 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
210 {% endif %} 207 {% endif %}
211 {% if attribute.measure_as %} 208 {% if attribute.measure_as %}
212 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}} ); 209 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}} );
213 {% endif %} 210 {% endif %}
214 {% if attribute.is_api_experiment_enabled %} 211 {% if attribute.is_api_experiment_enabled %}
215 {{check_api_experiment(attribute) | indent}} 212 {{check_api_experiment(attribute) | indent}}
216 {% endif %} 213 {% endif %}
217 v8ConstructorAttributeGetter(property, info); 214 v8ConstructorAttributeGetter(property, info);
218 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
219 } 215 }
220 {% endmacro %} 216 {% endmacro %}
221 217
222 218
223 {##############################################################################} 219 {##############################################################################}
224 {% macro attribute_setter(attribute, world_suffix) %} 220 {% macro attribute_setter(attribute, world_suffix) %}
225 static void {{attribute.name}}AttributeSetter{{world_suffix}}( 221 static void {{attribute.name}}AttributeSetter{{world_suffix}}(
226 {%- if attribute.is_data_type_property %} 222 {%- if attribute.is_data_type_property %}
227 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info 223 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info
228 {%- else %} 224 {%- else %}
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}( 354 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(
359 {%- if attribute.is_data_type_property %} 355 {%- if attribute.is_data_type_property %}
360 v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf o<void>& info 356 v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf o<void>& info
361 {%- else %} 357 {%- else %}
362 const v8::FunctionCallbackInfo<v8::Value>& info 358 const v8::FunctionCallbackInfo<v8::Value>& info
363 {%- endif %}) 359 {%- endif %})
364 { 360 {
365 {% if not attribute.is_data_type_property %} 361 {% if not attribute.is_data_type_property %}
366 v8::Local<v8::Value> v8Value = info[0]; 362 v8::Local<v8::Value> v8Value = info[0];
367 {% endif %} 363 {% endif %}
368 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
369 {% if attribute.deprecate_as %} 364 {% if attribute.deprecate_as %}
370 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); 365 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentExe cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}});
371 {% endif %} 366 {% endif %}
372 {% if attribute.measure_as %} 367 {% if attribute.measure_as %}
373 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); 368 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}});
374 {% endif %} 369 {% endif %}
375 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} 370 {% if world_suffix in attribute.activity_logging_world_list_for_setter %}
376 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); 371 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext());
377 V8PerContextData* contextData = scriptState->perContextData(); 372 V8PerContextData* contextData = scriptState->perContextData();
378 {% if attribute.activity_logging_world_check %} 373 {% if attribute.activity_logging_world_check %}
379 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) { 374 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) {
380 {% else %} 375 {% else %}
381 if (contextData && contextData->activityLogger()) { 376 if (contextData && contextData->activityLogger()) {
382 {% endif %} 377 {% endif %}
383 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value); 378 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute .name}}", v8Value);
384 } 379 }
385 {% endif %} 380 {% endif %}
386 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} 381 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %}
387 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; 382 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
388 {% endif %} 383 {% endif %}
389 {% if attribute.has_custom_setter %} 384 {% if attribute.has_custom_setter %}
390 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); 385 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info);
391 {% else %} 386 {% else %}
392 {{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);
393 {% endif %} 388 {% endif %}
394 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
395 } 389 }
396 {% endmacro %} 390 {% endmacro %}
397 391
398 392
399 {##############################################################################} 393 {##############################################################################}
400 {% macro attribute_getter_implemented_in_private_script(attribute) %} 394 {% macro attribute_getter_implemented_in_private_script(attribute) %}
401 bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame* frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result) 395 bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame* frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result)
402 { 396 {
403 if (!frame) 397 if (!frame)
404 return false; 398 return false;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 setter_callback_for_main_world, 502 setter_callback_for_main_world,
509 wrapper_type_info, 503 wrapper_type_info,
510 access_control, 504 access_control,
511 property_attribute, 505 property_attribute,
512 only_exposed_to_private_script, 506 only_exposed_to_private_script,
513 property_location(attribute), 507 property_location(attribute),
514 holder_check, 508 holder_check,
515 ] %} 509 ] %}
516 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} 510 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}}
517 {%- endmacro %} 511 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698