| OLD | NEW |
| 1 {##############################################################################} | 1 {##############################################################################} |
| 2 {% macro attribute_getter(attribute, world_suffix) %} | 2 {% macro attribute_getter(attribute, world_suffix) %} |
| 3 {% filter conditional(attribute.conditional_string) %} | 3 {% filter conditional(attribute.conditional_string) %} |
| 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::Stri
ng> name, const v8::PropertyCallbackInfo<v8::Value>& info) | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}(v8::Local<v8::Stri
ng> name, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 5 { | 5 { |
| 6 {% if attribute.is_unforgeable %} | 6 {% if attribute.is_unforgeable %} |
| 7 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{
v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); | 7 v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain({{
v8_class_name}}::GetTemplate(info.GetIsolate(), worldType(info.GetIsolate()))); |
| 8 if (holder.IsEmpty()) | 8 if (holder.IsEmpty()) |
| 9 return; | 9 return; |
| 10 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder); | 10 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(holder); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 {% endfilter %} | 101 {% endfilter %} |
| 102 {% endmacro %} | 102 {% endmacro %} |
| 103 | 103 |
| 104 | 104 |
| 105 {##############################################################################} | 105 {##############################################################################} |
| 106 {% macro attribute_setter(attribute, world_suffix) %} | 106 {% macro attribute_setter(attribute, world_suffix) %} |
| 107 static void {{attribute.name}}AttributeSetter{{world_suffix}}(v8::Local<v8::Stri
ng> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) | 107 static void {{attribute.name}}AttributeSetter{{world_suffix}}(v8::Local<v8::Stri
ng> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& in
fo) |
| 108 { | 108 { |
| 109 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); | 109 {{cpp_class_name}}* imp = {{v8_class_name}}::toNative(info.Holder()); |
| 110 {{attribute.v8_value_to_local_cpp_value}}; | 110 {{attribute.v8_value_to_local_cpp_value}}; |
| 111 {% if attribute.is_call_with_script_execution_context %} |
| 112 ExecutionContext* scriptContext = getExecutionContext(); |
| 113 {% endif %} |
| 111 {{attribute.cpp_setter}}; | 114 {{attribute.cpp_setter}}; |
| 112 {% if attribute.cached_attribute_validation_method %} | 115 {% if attribute.cached_attribute_validation_method %} |
| 113 info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("{{attribute.name}}")
); // Invalidate the cached value. | 116 info.Holder()->DeleteHiddenValue(v8::String::NewSymbol("{{attribute.name}}")
); // Invalidate the cached value. |
| 114 {% endif %} | 117 {% endif %} |
| 115 } | 118 } |
| 116 {% endmacro %} | 119 {% endmacro %} |
| 117 | 120 |
| 118 | 121 |
| 119 {##############################################################################} | 122 {##############################################################################} |
| 120 {% macro attribute_setter_callback(attribute, world_suffix) %} | 123 {% macro attribute_setter_callback(attribute, world_suffix) %} |
| 121 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(v8::Local<
v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) | 124 static void {{attribute.name}}AttributeSetterCallback{{world_suffix}}(v8::Local<
v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) |
| 122 { | 125 { |
| 123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 126 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 124 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffi
x}}(name, jsValue, info); | 127 {{cpp_class_name}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffi
x}}(name, jsValue, info); |
| 125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 128 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 126 } | 129 } |
| 127 {% endmacro %} | 130 {% endmacro %} |
| OLD | NEW |