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

Unified Diff: Source/bindings/scripts/v8_attributes.py

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
« no previous file with comments | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/scripts/v8_attributes.py
diff --git a/Source/bindings/scripts/v8_attributes.py b/Source/bindings/scripts/v8_attributes.py
index ffa2a435b7f4a49c4d5181013c7941d05d238fdb..0b85ff8c7cd4b79f35b7f6f970c9e7fcd682ebe4 100644
--- a/Source/bindings/scripts/v8_attributes.py
+++ b/Source/bindings/scripts/v8_attributes.py
@@ -191,9 +191,11 @@ def getter_context(interface, attribute, context):
release = idl_type.release
def v8_set_return_value_statement(for_main_world=False):
- if context['is_keep_alive_for_gc']:
- return 'v8SetReturnValue(info, wrapper)'
- return idl_type.v8_set_return_value(cpp_value, extended_attributes=extended_attributes, script_wrappable='impl', release=release, for_main_world=for_main_world)
+ if context['is_keep_alive_for_gc'] or 'CachedAttribute' in extended_attributes:
+ return 'v8SetReturnValue(info, v8Value)'
+ return idl_type.v8_set_return_value(
+ cpp_value, extended_attributes=extended_attributes, script_wrappable='impl',
+ release=release, for_main_world=for_main_world)
context.update({
'cpp_value': cpp_value,
@@ -204,7 +206,6 @@ def getter_context(interface, attribute, context):
'v8_set_return_value': v8_set_return_value_statement(),
})
-
def getter_expression(interface, attribute, context):
arguments = []
this_getter_base_name = getter_base_name(interface, attribute, arguments)
« no previous file with comments | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698