OLD | NEW |
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l
ocal_cpp_value %} | 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l
ocal_cpp_value %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% macro attribute_getter(attribute, world_suffix) %} | 5 {% macro attribute_getter(attribute, world_suffix) %} |
6 {% filter conditional(attribute.conditional_string) %} | 6 {% filter conditional(attribute.conditional_string) %} |
7 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 7 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
8 {%- if attribute.is_expose_js_accessors %} | 8 {%- if attribute.is_data_type_property %} |
| 9 const v8::PropertyCallbackInfo<v8::Value>& info |
| 10 {%- else %} |
9 const v8::FunctionCallbackInfo<v8::Value>& info | 11 const v8::FunctionCallbackInfo<v8::Value>& info |
10 {%- else %} | |
11 const v8::PropertyCallbackInfo<v8::Value>& info | |
12 {%- endif %}) | 12 {%- endif %}) |
13 { | 13 { |
14 {% if attribute.is_reflect and not attribute.is_url | 14 {% if attribute.is_reflect and not attribute.is_url |
15 and attribute.idl_type == 'DOMString' and is_node | 15 and attribute.idl_type == 'DOMString' and is_node |
16 and not attribute.is_implemented_in_private_script %} | 16 and not attribute.is_implemented_in_private_script %} |
17 {% set cpp_class, v8_class = 'Element', 'V8Element' %} | 17 {% set cpp_class, v8_class = 'Element', 'V8Element' %} |
18 {% endif %} | 18 {% endif %} |
19 {# holder #} | 19 {# holder #} |
20 {% if not attribute.is_static %} | 20 {% if not attribute.is_static %} |
21 {% if attribute.is_lenient_this %} | 21 {% if attribute.is_lenient_this %} |
(...skipping 26 matching lines...) Expand all Loading... |
48 {% endif %} | 48 {% endif %} |
49 {# Local variables #} | 49 {# Local variables #} |
50 {% if attribute.is_call_with_execution_context %} | 50 {% if attribute.is_call_with_execution_context %} |
51 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 51 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
52 {% endif %} | 52 {% endif %} |
53 {% if attribute.is_call_with_script_state %} | 53 {% if attribute.is_call_with_script_state %} |
54 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 54 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); |
55 {% endif %} | 55 {% endif %} |
56 {% if ((attribute.is_check_security_for_frame or | 56 {% if ((attribute.is_check_security_for_frame or |
57 attribute.is_check_security_for_window) and | 57 attribute.is_check_security_for_window) and |
58 attribute.is_expose_js_accessors) or | 58 not attribute.is_data_type_property) or |
59 attribute.is_check_security_for_node or | 59 attribute.is_check_security_for_node or |
60 attribute.is_getter_raises_exception %} | 60 attribute.is_getter_raises_exception %} |
61 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); | 61 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); |
62 {% endif %} | 62 {% endif %} |
63 {% if attribute.is_explicit_nullable %} | 63 {% if attribute.is_explicit_nullable %} |
64 bool isNull = false; | 64 bool isNull = false; |
65 {% endif %} | 65 {% endif %} |
66 {% if attribute.is_implemented_in_private_script %} | 66 {% if attribute.is_implemented_in_private_script %} |
67 {{attribute.cpp_type}} result{{attribute.cpp_type_initializer}}; | 67 {{attribute.cpp_type}} result{{attribute.cpp_type_initializer}}; |
68 if (!{{attribute.cpp_value_original}}) | 68 if (!{{attribute.cpp_value_original}}) |
69 return; | 69 return; |
70 {% elif attribute.cpp_value_original %} | 70 {% elif attribute.cpp_value_original %} |
71 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina
l}}); | 71 {{attribute.cpp_type}} {{attribute.cpp_value}}({{attribute.cpp_value_origina
l}}); |
72 {% endif %} | 72 {% endif %} |
73 {# Checks #} | 73 {# Checks #} |
74 {% if attribute.is_getter_raises_exception %} | 74 {% if attribute.is_getter_raises_exception %} |
75 if (UNLIKELY(exceptionState.throwIfNeeded())) | 75 if (UNLIKELY(exceptionState.throwIfNeeded())) |
76 return; | 76 return; |
77 {% endif %} | 77 {% endif %} |
78 {# Security checks #} | 78 {# Security checks #} |
79 {% if attribute.is_expose_js_accessors %} | 79 {% if not attribute.is_data_type_property %} |
80 {% if attribute.is_check_security_for_window %} | 80 {% if attribute.is_check_security_for_window %} |
81 if (LocalDOMWindow* window = impl->toDOMWindow()) { | 81 if (LocalDOMWindow* window = impl->toDOMWindow()) { |
82 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window
->frame(), exceptionState)) { | 82 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window
->frame(), exceptionState)) { |
83 v8SetReturnValueNull(info); | 83 v8SetReturnValueNull(info); |
84 exceptionState.throwIfNeeded(); | 84 exceptionState.throwIfNeeded(); |
85 return; | 85 return; |
86 } | 86 } |
87 if (!window->document()) | 87 if (!window->document()) |
88 return; | 88 return; |
89 } | 89 } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 {% if attribute.use_output_parameter_for_result %} | 133 {% if attribute.use_output_parameter_for_result %} |
134 {{attribute.cpp_type}} result; | 134 {{attribute.cpp_type}} result; |
135 {{attribute.cpp_value}}; | 135 {{attribute.cpp_value}}; |
136 {% endif %} | 136 {% endif %} |
137 {{attribute.v8_set_return_value}}; | 137 {{attribute.v8_set_return_value}}; |
138 {% endif %} | 138 {% endif %} |
139 } | 139 } |
140 {% endfilter %} | 140 {% endfilter %} |
141 {% endmacro %} | 141 {% endmacro %} |
142 | 142 |
| 143 |
143 {######################################} | 144 {######################################} |
144 {% macro release_only_check(reflect_only_values, reflect_missing, | 145 {% macro release_only_check(reflect_only_values, reflect_missing, |
145 reflect_invalid, reflect_empty, cpp_value) %} | 146 reflect_invalid, reflect_empty, cpp_value) %} |
146 {# Attribute is limited to only known values: check that the attribute value is | 147 {# Attribute is limited to only known values: check that the attribute value is |
147 one of those. If not, set it to the empty string. | 148 one of those. If not, set it to the empty string. |
148 http://www.whatwg.org/specs/web-apps/current-work/#limited-to-only-known-valu
es #} | 149 http://www.whatwg.org/specs/web-apps/current-work/#limited-to-only-known-valu
es #} |
149 {% if reflect_empty %} | 150 {% if reflect_empty %} |
150 if ({{cpp_value}}.isNull()) { | 151 if ({{cpp_value}}.isNull()) { |
151 {% if reflect_missing %} | 152 {% if reflect_missing %} |
152 {{cpp_value}} = "{{reflect_missing}}"; | 153 {{cpp_value}} = "{{reflect_missing}}"; |
(...skipping 18 matching lines...) Expand all Loading... |
171 } else { | 172 } else { |
172 {{cpp_value}} = "{{reflect_invalid}}"; | 173 {{cpp_value}} = "{{reflect_invalid}}"; |
173 } | 174 } |
174 {% endmacro %} | 175 {% endmacro %} |
175 | 176 |
176 | 177 |
177 {##############################################################################} | 178 {##############################################################################} |
178 {% macro attribute_getter_callback(attribute, world_suffix) %} | 179 {% macro attribute_getter_callback(attribute, world_suffix) %} |
179 {% filter conditional(attribute.conditional_string) %} | 180 {% filter conditional(attribute.conditional_string) %} |
180 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}( | 181 static void {{attribute.name}}AttributeGetterCallback{{world_suffix}}( |
181 {%- if attribute.is_expose_js_accessors %} | 182 {%- if attribute.is_data_type_property %} |
| 183 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info |
| 184 {%- else %} |
182 const v8::FunctionCallbackInfo<v8::Value>& info | 185 const v8::FunctionCallbackInfo<v8::Value>& info |
183 {%- else %} | |
184 v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info | |
185 {%- endif %}) | 186 {%- endif %}) |
186 { | 187 { |
187 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 188 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
188 {% if attribute.deprecate_as %} | 189 {% if attribute.deprecate_as %} |
189 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); | 190 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); |
190 {% endif %} | 191 {% endif %} |
191 {% if attribute.measure_as %} | 192 {% if attribute.measure_as %} |
192 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); | 193 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); |
193 {% endif %} | 194 {% endif %} |
194 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} | 195 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} |
(...skipping 13 matching lines...) Expand all Loading... |
208 {% endif %} | 209 {% endif %} |
209 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 210 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
210 } | 211 } |
211 {% endfilter %} | 212 {% endfilter %} |
212 {% endmacro %} | 213 {% endmacro %} |
213 | 214 |
214 | 215 |
215 {##############################################################################} | 216 {##############################################################################} |
216 {% macro constructor_getter_callback(attribute, world_suffix) %} | 217 {% macro constructor_getter_callback(attribute, world_suffix) %} |
217 {% filter conditional(attribute.conditional_string) %} | 218 {% filter conditional(attribute.conditional_string) %} |
218 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}( | 219 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca
l<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info) |
219 {%- if attribute.is_expose_js_accessors %} | |
220 const v8::FunctionCallbackInfo<v8::Value>& info | |
221 {%- else %} | |
222 v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info | |
223 {%- endif %}) | |
224 { | 220 { |
225 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 221 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
226 {% if attribute.deprecate_as %} | 222 {% if attribute.deprecate_as %} |
227 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); | 223 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); |
228 {% endif %} | 224 {% endif %} |
229 {% if attribute.measure_as %} | 225 {% if attribute.measure_as %} |
230 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}}
); | 226 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('ConstructorGetter')}}
); |
231 {% endif %} | 227 {% endif %} |
232 v8ConstructorAttributeGetter(property, info); | 228 v8ConstructorAttributeGetter(property, info); |
233 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 229 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
234 } | 230 } |
235 {% endfilter %} | 231 {% endfilter %} |
236 {% endmacro %} | 232 {% endmacro %} |
237 | 233 |
238 | 234 |
239 {##############################################################################} | 235 {##############################################################################} |
240 {% macro attribute_setter(attribute, world_suffix) %} | 236 {% macro attribute_setter(attribute, world_suffix) %} |
241 {% filter conditional(attribute.conditional_string) %} | 237 {% filter conditional(attribute.conditional_string) %} |
242 static void {{attribute.name}}AttributeSetter{{world_suffix}}( | 238 static void {{attribute.name}}AttributeSetter{{world_suffix}}( |
243 {%- if attribute.is_expose_js_accessors %} | 239 {%- if attribute.is_data_type_property %} |
| 240 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info |
| 241 {%- else %} |
244 v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info | 242 v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info |
245 {%- else %} | |
246 v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info | |
247 {%- endif %}) | 243 {%- endif %}) |
248 { | 244 { |
249 {% if attribute.is_reflect and attribute.idl_type == 'DOMString' | 245 {% if attribute.is_reflect and attribute.idl_type == 'DOMString' |
250 and is_node and not attribute.is_implemented_in_private_script %} | 246 and is_node and not attribute.is_implemented_in_private_script %} |
251 {% set cpp_class, v8_class = 'Element', 'V8Element' %} | 247 {% set cpp_class, v8_class = 'Element', 'V8Element' %} |
252 {% endif %} | 248 {% endif %} |
253 {% if attribute.has_setter_exception_state or | 249 {% if attribute.has_setter_exception_state or |
254 ((not attribute.is_replaceable and | 250 ((not attribute.is_replaceable and |
255 not attribute.constructor_type and | 251 not attribute.constructor_type and |
256 attribute.is_expose_js_accessors) and | 252 not attribute.is_data_type_property) and |
257 (attribute.is_check_security_for_frame or | 253 (attribute.is_check_security_for_frame or |
258 attribute.is_check_security_for_node or | 254 attribute.is_check_security_for_node or |
259 attribute.is_check_security_for_window)) %} | 255 attribute.is_check_security_for_window)) %} |
260 {% set raise_exception = 1 %} | 256 {% set raise_exception = 1 %} |
261 {% else %} | 257 {% else %} |
262 {% set raise_exception = 0 %} | 258 {% set raise_exception = 0 %} |
263 {% endif %} | 259 {% endif %} |
264 {# Local variables #} | 260 {# Local variables #} |
265 {% if (not attribute.is_static and | 261 {% if (not attribute.is_static and |
266 not attribute.is_replaceable and | 262 not attribute.is_replaceable and |
(...skipping 27 matching lines...) Expand all Loading... |
294 not attribute.constructor_type %} | 290 not attribute.constructor_type %} |
295 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); | 291 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
296 {% endif %} | 292 {% endif %} |
297 {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %} | 293 {% if attribute.idl_type == 'EventHandler' and interface_name == 'Window' %} |
298 if (!impl->document()) | 294 if (!impl->document()) |
299 return; | 295 return; |
300 {% endif %} | 296 {% endif %} |
301 {# Security checks #} | 297 {# Security checks #} |
302 {% if not attribute.is_replaceable and | 298 {% if not attribute.is_replaceable and |
303 not attribute.constructor_type %} | 299 not attribute.constructor_type %} |
304 {% if attribute.is_expose_js_accessors %} | 300 {% if not attribute.is_data_type_property %} |
305 {% if attribute.is_check_security_for_window %} | 301 {% if attribute.is_check_security_for_window %} |
306 if (LocalDOMWindow* window = impl->toDOMWindow()) { | 302 if (LocalDOMWindow* window = impl->toDOMWindow()) { |
307 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window
->frame(), exceptionState)) { | 303 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), window
->frame(), exceptionState)) { |
308 v8SetReturnValue(info, v8Value); | 304 v8SetReturnValue(info, v8Value); |
309 exceptionState.throwIfNeeded(); | 305 exceptionState.throwIfNeeded(); |
310 return; | 306 return; |
311 } | 307 } |
312 if (!window->document()) | 308 if (!window->document()) |
313 return; | 309 return; |
314 } | 310 } |
315 {% elif attribute.is_check_security_for_frame %} | 311 {% elif attribute.is_check_security_for_frame %} |
316 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { | 312 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram
e(), exceptionState)) { |
317 v8SetReturnValue(info, v8Value); | 313 v8SetReturnValue(info, v8Value); |
318 exceptionState.throwIfNeeded(); | 314 exceptionState.throwIfNeeded(); |
319 return; | 315 return; |
320 } | 316 } |
321 {% endif %} | 317 {% endif %} |
322 {% endif %} | 318 {% endif %} |
323 {% if attribute.is_check_security_for_node %} | 319 {% if attribute.is_check_security_for_node %} |
324 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), {{attribute
.cpp_value}}, exceptionState)) { | 320 if (!BindingSecurity::shouldAllowAccessToNode(info.GetIsolate(), {{attribute
.cpp_value}}, exceptionState)) { |
325 v8SetReturnValue(info, v8Value); | 321 v8SetReturnValue(info, v8Value); |
326 exceptionState.throwIfNeeded(); | 322 exceptionState.throwIfNeeded(); |
327 return; | 323 return; |
328 } | 324 } |
329 {% endif %} | 325 {% endif %} |
330 {% endif %}{# not attribute.is_replaceable #} | 326 {% endif %}{# not attribute.is_replaceable and |
| 327 not attribute.constructor_type #} |
331 {# Convert JS value to C++ value #} | 328 {# Convert JS value to C++ value #} |
332 {% if attribute.idl_type != 'EventHandler' %} | 329 {% if attribute.idl_type != 'EventHandler' %} |
333 {% if v8_value_to_local_cpp_value(attribute) %} | 330 {% if v8_value_to_local_cpp_value(attribute) %} |
334 {{v8_value_to_local_cpp_value(attribute) | indent}} | 331 {{v8_value_to_local_cpp_value(attribute) | indent}} |
335 {% endif %} | 332 {% endif %} |
336 {% elif not is_node %}{# EventHandler hack #} | 333 {% elif not is_node %}{# EventHandler hack #} |
337 moveEventListenerToNewWrapper(info.GetIsolate(), holder, {{attribute.event_h
andler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex); | 334 moveEventListenerToNewWrapper(info.GetIsolate(), holder, {{attribute.event_h
andler_getter_expression}}, v8Value, {{v8_class}}::eventListenerCacheIndex); |
338 {% endif %} | 335 {% endif %} |
339 {# Type checking, possibly throw a TypeError, per: | 336 {# Type checking, possibly throw a TypeError, per: |
340 http://www.w3.org/TR/WebIDL/#es-type-mapping #} | 337 http://www.w3.org/TR/WebIDL/#es-type-mapping #} |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 {% endif %} | 382 {% endif %} |
386 } | 383 } |
387 {% endfilter %} | 384 {% endfilter %} |
388 {% endmacro %} | 385 {% endmacro %} |
389 | 386 |
390 | 387 |
391 {##############################################################################} | 388 {##############################################################################} |
392 {% macro attribute_setter_callback(attribute, world_suffix) %} | 389 {% macro attribute_setter_callback(attribute, world_suffix) %} |
393 {% filter conditional(attribute.conditional_string) %} | 390 {% filter conditional(attribute.conditional_string) %} |
394 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}( | 391 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}( |
395 {%- if attribute.is_expose_js_accessors %} | 392 {%- if attribute.is_data_type_property %} |
| 393 v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf
o<void>& info |
| 394 {%- else %} |
396 const v8::FunctionCallbackInfo<v8::Value>& info | 395 const v8::FunctionCallbackInfo<v8::Value>& info |
397 {%- else %} | |
398 v8::Local<v8::Name>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInf
o<void>& info | |
399 {%- endif %}) | 396 {%- endif %}) |
400 { | 397 { |
401 {% if attribute.is_expose_js_accessors %} | 398 {% if not attribute.is_data_type_property %} |
402 v8::Local<v8::Value> v8Value = info[0]; | 399 v8::Local<v8::Value> v8Value = info[0]; |
403 {% endif %} | 400 {% endif %} |
404 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 401 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
405 {% if attribute.deprecate_as %} | 402 {% if attribute.deprecate_as %} |
406 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); | 403 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); |
407 {% endif %} | 404 {% endif %} |
408 {% if attribute.measure_as %} | 405 {% if attribute.measure_as %} |
409 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); | 406 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); |
410 {% endif %} | 407 {% endif %} |
411 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} | 408 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 {% set getter_callback_for_main_world = | 508 {% set getter_callback_for_main_world = |
512 '%sForMainWorld' % getter_callback | 509 '%sForMainWorld' % getter_callback |
513 if attribute.is_per_world_bindings else '0' %} | 510 if attribute.is_per_world_bindings else '0' %} |
514 {% set setter_callback_for_main_world = | 511 {% set setter_callback_for_main_world = |
515 '%sForMainWorld' % setter_callback | 512 '%sForMainWorld' % setter_callback |
516 if attribute.is_per_world_bindings and attribute.has_setter else '0' %} | 513 if attribute.is_per_world_bindings and attribute.has_setter else '0' %} |
517 {% set wrapper_type_info = | 514 {% set wrapper_type_info = |
518 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % | 515 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % |
519 attribute.constructor_type | 516 attribute.constructor_type |
520 if attribute.constructor_type else '0' %} | 517 if attribute.constructor_type else '0' %} |
| 518 {% if attribute.is_data_type_property %} |
521 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % | 519 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % |
522 ' | '.join(attribute.access_control_list) %} | 520 ' | '.join(attribute.access_control_list) %} |
| 521 {% else %} |
| 522 {% set access_control = 'v8::DEFAULT' %} |
| 523 {% endif %} |
523 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % | 524 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % |
524 ' | '.join(attribute.property_attributes) %} | 525 ' | '.join(attribute.property_attributes) %} |
525 {% set only_exposed_to_private_script = | 526 {% set only_exposed_to_private_script = |
526 'V8DOMConfiguration::OnlyExposedToPrivateScript' | 527 'V8DOMConfiguration::OnlyExposedToPrivateScript' |
527 if attribute.only_exposed_to_private_script else | 528 if attribute.only_exposed_to_private_script else |
528 'V8DOMConfiguration::ExposedToAllScripts' %} | 529 'V8DOMConfiguration::ExposedToAllScripts' %} |
529 {% set property_location_list = [] %} | 530 {% set property_location_list = [] %} |
530 {% if attribute.on_instance %} | 531 {% if attribute.on_instance %} |
531 {% set property_location_list = property_location_list + ['V8DOMConfiguration::O
nInstance'] %} | 532 {% set property_location_list = property_location_list + ['V8DOMConfiguration::O
nInstance'] %} |
532 {% endif %} | 533 {% endif %} |
(...skipping 14 matching lines...) Expand all Loading... |
547 setter_callback_for_main_world, | 548 setter_callback_for_main_world, |
548 wrapper_type_info, | 549 wrapper_type_info, |
549 access_control, | 550 access_control, |
550 property_attribute, | 551 property_attribute, |
551 only_exposed_to_private_script, | 552 only_exposed_to_private_script, |
552 property_location, | 553 property_location, |
553 holder_check, | 554 holder_check, |
554 ] %} | 555 ] %} |
555 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 556 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
556 {%- endmacro %} | 557 {%- endmacro %} |
OLD | NEW |