Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/templates/attributes.cpp |
| diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp b/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| index c5214d31fcee500ff52c725f4458158e5b256f5f..5a5ce963a2505663af7d54c44957bfb09255fe9e 100644 |
| --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp |
| @@ -27,9 +27,21 @@ const v8::FunctionCallbackInfo<v8::Value>& info |
| v8::Local<v8::Object> holder = info.Holder(); |
| {% endif %} |
| {# impl #} |
| + {% if not attribute.is_static %} |
| + {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
| + {% endif %} |
| + {% if attribute.is_same_object %} |
| + v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "sameobject_{{attribute.name}}"); |
| + { |
| + v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName); |
| + if (!v8Value.IsEmpty()) { |
| + v8SetReturnValue(info, v8Value); |
| + return; |
| + } |
| + } |
| + {% endif %} |
| {% if attribute.cached_attribute_validation_method %} |
| v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "{{attribute.name}}"); |
| - {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
| if (!impl->{{attribute.cached_attribute_validation_method}}()) { |
| v8::Local<v8::Value> v8Value = V8HiddenValue::getHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName); |
| if (!v8Value.IsEmpty() && !v8Value->IsUndefined()) { |
| @@ -37,8 +49,6 @@ const v8::FunctionCallbackInfo<v8::Value>& info |
| return; |
| } |
| } |
| - {% elif not attribute.is_static %} |
| - {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); |
| {% endif %} |
| {% if interface_name == 'Window' and attribute.idl_type == 'EventHandler' %} |
| if (!impl->document()) |
| @@ -123,6 +133,9 @@ const v8::FunctionCallbackInfo<v8::Value>& info |
| {% endif %} |
| {{attribute.v8_set_return_value}}; |
| {% endif %} |
| + {% if attribute.is_same_object %} |
| + V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), holder, propertyName, info.GetReturnValue().Get()); |
|
haraken
2016/05/16 09:17:44
Can we merge the branch with '{% if attribute.cach
Yuki
2016/05/16 09:32:14
I had the same idea, but it turned out that it's n
|
| + {% endif %} |
| } |
| {% endmacro %} |