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/interface_base.cpp

Issue 1121703002: bindings: Uses V8's named property interceptor for Window. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 5 years, 4 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/interface_base.cpp
diff --git a/Source/bindings/templates/interface_base.cpp b/Source/bindings/templates/interface_base.cpp
index 93f3201b42db7c47494e6d1c719230e83a2d2304..04e6782ca7a7b43563018bb2f3a7a3580c0c7135 100644
--- a/Source/bindings/templates/interface_base.cpp
+++ b/Source/bindings/templates/interface_base.cpp
@@ -409,18 +409,14 @@ static void install{{v8_class}}Template(v8::Local<v8::FunctionTemplate> function
'%sV8Internal::namedPropertyEnumeratorCallback' % cpp_class
if named_property_getter.is_enumerable else '0' %}
{
- v8::NamedPropertyHandlerConfiguration config({{named_property_getter_callback}}, {{named_property_setter_callback}}, {{named_property_query_callback}}, {{named_property_deleter_callback}}, {{named_property_enumerator_callback}});
- {# TODO(yukishiino): Determine how to treat Window interface. #}
- {% if interface_name != 'Window' %}
- config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(config.flags) | static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings));
- {% endif %}
+ int flags = static_cast<int>(v8::PropertyHandlerFlags::kOnlyInterceptStrings);
{% if named_property_getter.do_not_check_security %}
- config.flags = v8::PropertyHandlerFlags::kAllCanRead;
+ flags |= static_cast<int>(v8::PropertyHandlerFlags::kAllCanRead);
{% endif %}
- {# TODO(yukishiino): Determine how to treat Window interface. #}
- {% if not is_override_builtins and interface_name != 'Window' %}
- config.flags = static_cast<v8::PropertyHandlerFlags>(static_cast<int>(config.flags) | static_cast<int>(v8::PropertyHandlerFlags::kNonMasking));
+ {% if not is_override_builtins %}
+ flags |= static_cast<int>(v8::PropertyHandlerFlags::kNonMasking);
{% endif %}
+ v8::NamedPropertyHandlerConfiguration config({{named_property_getter_callback}}, {{named_property_setter_callback}}, {{named_property_query_callback}}, {{named_property_deleter_callback}}, {{named_property_enumerator_callback}}, v8::Handle<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(flags));
functionTemplate->{{set_on_template}}()->SetHandler(config);
}
{% endif %}
« no previous file with comments | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/bindings/tests/results/core/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698