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

Unified Diff: Source/bindings/templates/attributes.cpp

Issue 1012713003: IDL: Improve CG for attributes with [CachedAttribute] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/templates/attributes.cpp
diff --git a/Source/bindings/templates/attributes.cpp b/Source/bindings/templates/attributes.cpp
index 5577e9946e33a12c009ed25cd319d791dca1a3cf..7b9f4398018d747c9f9b6c99415913d40f53b717 100644
--- a/Source/bindings/templates/attributes.cpp
+++ b/Source/bindings/templates/attributes.cpp
@@ -84,15 +84,16 @@ const v8::PropertyCallbackInfo<v8::Value>& info
}
{% endif %}
{% if attribute.cached_attribute_validation_method %}
- V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, {{attribute.cpp_value_to_v8_value}});
+ v8::Local<v8::Value> v8Value({{attribute.cpp_value_to_v8_value}});
+ V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Value);
{% endif %}
{# v8SetReturnValue #}
{% if attribute.is_keep_alive_for_gc %}
if ({{attribute.cpp_value}} && DOMDataStore::setReturnValue{{world_suffix}}(info.GetReturnValue(), {{attribute.cpp_value}}.get()))
return;
- v8::Local<v8::Value> wrapper = toV8({{attribute.cpp_value}}.get(), holder, info.GetIsolate());
- if (!wrapper.IsEmpty()) {
- V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "{{attribute.name}}"), wrapper);
+ v8::Local<v8::Value> v8Value(toV8({{attribute.cpp_value}}.get(), holder, info.GetIsolate()));
+ if (!v8Value.IsEmpty()) {
+ V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, v8AtomicString(info.GetIsolate(), "{{attribute.name}}"), v8Value);
{{attribute.v8_set_return_value}};
}
{% elif world_suffix %}
« no previous file with comments | « Source/bindings/scripts/v8_attributes.py ('k') | Source/bindings/tests/results/core/V8TestInterfaceEventConstructor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698