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

Side by Side Diff: Source/bindings/templates/interface.cpp

Issue 1153613007: bindings: Use CreateDataProperty() instead of ForceSet() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninitialized error Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% block indexed_property_getter %} 5 {% block indexed_property_getter %}
6 {% if indexed_property_getter and not indexed_property_getter.is_custom %} 6 {% if indexed_property_getter and not indexed_property_getter.is_custom %}
7 {% set getter = indexed_property_getter %} 7 {% set getter = indexed_property_getter %}
8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 8 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
9 { 9 {
10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); 10 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 {% macro install_unscopeables() %} 846 {% macro install_unscopeables() %}
847 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext()); 847 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext());
848 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); 848 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate));
849 v8::Local<v8::Object> unscopeables; 849 v8::Local<v8::Object> unscopeables;
850 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymbol)) ) 850 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymbol)) )
851 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLocalChe cked().As<v8::Object>(); 851 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLocalChe cked().As<v8::Object>();
852 else 852 else
853 unscopeables = v8::Object::New(isolate); 853 unscopeables = v8::Object::New(isolate);
854 {% for name, runtime_enabled_function in unscopeables %} 854 {% for name, runtime_enabled_function in unscopeables %}
855 {% filter runtime_enabled(runtime_enabled_function) %} 855 {% filter runtime_enabled(runtime_enabled_function) %}
856 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "{{name}}"), v8::True( isolate)).FromJust(); 856 unscopeables->CreateDataProperty(v8Context, v8AtomicString(isolate, "{{name}}"), v8::True(isolate)).FromJust();
857 {% endfilter %} 857 {% endfilter %}
858 {% endfor %} 858 {% endfor %}
859 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJust() ; 859 prototypeObject->CreateDataProperty(v8Context, unscopablesSymbol, unscopeables). FromJust();
860 {% endmacro %} 860 {% endmacro %}
861 861
862 862
863 {##############################################################################} 863 {##############################################################################}
864 {% block to_active_dom_object %} 864 {% block to_active_dom_object %}
865 {% if is_active_dom_object %} 865 {% if is_active_dom_object %}
866 ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Local<v8::Object> wrapper) 866 ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Local<v8::Object> wrapper)
867 { 867 {
868 return toImpl(wrapper); 868 return toImpl(wrapper);
869 } 869 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 944
945 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 945 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
946 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 946 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
947 { 947 {
948 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 948 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
949 } 949 }
950 {% endfor %} 950 {% endfor %}
951 {% endif %} 951 {% endif %}
952 {% endblock %} 952 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/dictionary_v8.cpp ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698