OLD | NEW |
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_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 %}) |
11 { | 11 { |
12 {% if attribute.is_api_experiment_enabled %} | 12 {% if attribute.is_origin_trial_enabled %} |
13 {{check_api_experiment(attribute) | indent}} | 13 {{check_origin_trial(attribute) | indent}} |
14 {% endif %} | 14 {% endif %} |
15 {% if attribute.is_reflect and not attribute.is_url | 15 {% if attribute.is_reflect and not attribute.is_url |
16 and attribute.idl_type == 'DOMString' and is_node | 16 and attribute.idl_type == 'DOMString' and is_node |
17 and not attribute.is_implemented_in_private_script %} | 17 and not attribute.is_implemented_in_private_script %} |
18 {% set cpp_class, v8_class = 'Element', 'V8Element' %} | 18 {% set cpp_class, v8_class = 'Element', 'V8Element' %} |
19 {% endif %} | 19 {% endif %} |
20 {# holder #} | 20 {# holder #} |
21 {% if not attribute.is_static %} | 21 {% if not attribute.is_static %} |
22 {% if attribute.is_lenient_this %} | 22 {% if attribute.is_lenient_this %} |
23 {# Make sure that info.Holder() really points to an instance if [LenientThis
]. #} | 23 {# Make sure that info.Holder() really points to an instance if [LenientThis
]. #} |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 {% if attribute.deprecate_as %} | 173 {% if attribute.deprecate_as %} |
174 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}}); |
175 {% endif %} | 175 {% endif %} |
176 {% if attribute.measure_as %} | 176 {% if attribute.measure_as %} |
177 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')}}); |
178 {% endif %} | 178 {% endif %} |
179 {% if attribute.is_api_experiment_enabled %} | 179 {% if attribute.is_origin_trial_enabled %} |
180 {{check_api_experiment(attribute) | indent}} | 180 {{check_origin_trial(attribute) | indent}} |
181 {% endif %} | 181 {% endif %} |
182 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} | 182 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} |
183 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 183 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
184 V8PerContextData* contextData = scriptState->perContextData(); | 184 V8PerContextData* contextData = scriptState->perContextData(); |
185 {% if attribute.activity_logging_world_check %} | 185 {% if attribute.activity_logging_world_check %} |
186 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 186 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
187 {% else %} | 187 {% else %} |
188 if (contextData && contextData->activityLogger()) | 188 if (contextData && contextData->activityLogger()) |
189 {% endif %} | 189 {% endif %} |
190 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); | 190 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); |
(...skipping 10 matching lines...) Expand all Loading... |
201 {##############################################################################} | 201 {##############################################################################} |
202 {% macro constructor_getter_callback(attribute, world_suffix) %} | 202 {% macro constructor_getter_callback(attribute, world_suffix) %} |
203 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) |
204 { | 204 { |
205 {% if attribute.deprecate_as %} | 205 {% if attribute.deprecate_as %} |
206 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}}); |
207 {% endif %} | 207 {% endif %} |
208 {% if attribute.measure_as %} | 208 {% if attribute.measure_as %} |
209 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')}}
); |
210 {% endif %} | 210 {% endif %} |
211 {% if attribute.is_api_experiment_enabled %} | 211 {% if attribute.is_origin_trial_enabled %} |
212 {{check_api_experiment(attribute) | indent}} | 212 {{check_origin_trial(attribute) | indent}} |
213 {% endif %} | 213 {% endif %} |
214 v8ConstructorAttributeGetter(property, info); | 214 v8ConstructorAttributeGetter(property, info); |
215 } | 215 } |
216 {% endmacro %} | 216 {% endmacro %} |
217 | 217 |
218 | 218 |
219 {##############################################################################} | 219 {##############################################################################} |
220 {% macro attribute_setter(attribute, world_suffix) %} | 220 {% macro attribute_setter(attribute, world_suffix) %} |
221 static void {{attribute.name}}AttributeSetter{{world_suffix}}( | 221 static void {{attribute.name}}AttributeSetter{{world_suffix}}( |
222 {%- if attribute.is_data_type_property %} | 222 {%- if attribute.is_data_type_property %} |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 return false; | 403 return false; |
404 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 404 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
405 if (!scriptStateInUserScript) | 405 if (!scriptStateInUserScript) |
406 return false; | 406 return false; |
407 | 407 |
408 ScriptState::Scope scope(scriptState); | 408 ScriptState::Scope scope(scriptState); |
409 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 409 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
410 if (holder.IsEmpty()) | 410 if (holder.IsEmpty()) |
411 return false; | 411 return false; |
412 | 412 |
413 {% if attribute.is_api_experiment_enabled %} | 413 {% if attribute.is_origin_trial_enabled %} |
414 {{check_api_experiment(attribute, "scriptState->isolate()") | indent}} | 414 {{check_origin_trial(attribute, "scriptState->isolate()") | indent}} |
415 {% endif %} | 415 {% endif %} |
416 | 416 |
417 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); | 417 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); |
418 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "{{cpp_class}}", "{{attribute.name}}", holde
r); | 418 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "{{cpp_class}}", "{{attribute.name}}", holde
r); |
419 if (v8Value.IsEmpty()) | 419 if (v8Value.IsEmpty()) |
420 return false; | 420 return false; |
421 {{v8_value_to_local_cpp_value(attribute.private_script_v8_value_to_local_cpp
_value) | indent}} | 421 {{v8_value_to_local_cpp_value(attribute.private_script_v8_value_to_local_cpp
_value) | indent}} |
422 RELEASE_ASSERT(!exceptionState.hadException()); | 422 RELEASE_ASSERT(!exceptionState.hadException()); |
423 *result = cppValue; | 423 *result = cppValue; |
424 return true; | 424 return true; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 setter_callback_for_main_world, | 502 setter_callback_for_main_world, |
503 wrapper_type_info, | 503 wrapper_type_info, |
504 access_control, | 504 access_control, |
505 property_attribute, | 505 property_attribute, |
506 only_exposed_to_private_script, | 506 only_exposed_to_private_script, |
507 property_location(attribute), | 507 property_location(attribute), |
508 holder_check, | 508 holder_check, |
509 ] %} | 509 ] %} |
510 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 510 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
511 {%- endmacro %} | 511 {%- endmacro %} |
OLD | NEW |