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

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: 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 {% macro install_unscopeables() %} 941 {% macro install_unscopeables() %}
942 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext()); 942 v8::Local<v8::Context> v8Context(prototypeObject->CreationContext());
943 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate)); 943 v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate));
944 v8::Local<v8::Object> unscopeables; 944 v8::Local<v8::Object> unscopeables;
945 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymbol)) ) 945 if (v8CallBoolean(prototypeObject->HasOwnProperty(v8Context, unscopablesSymbol)) )
946 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLocalChe cked().As<v8::Object>(); 946 unscopeables = prototypeObject->Get(v8Context, unscopablesSymbol).ToLocalChe cked().As<v8::Object>();
947 else 947 else
948 unscopeables = v8::Object::New(isolate); 948 unscopeables = v8::Object::New(isolate);
949 {% for name, runtime_enabled_function in unscopeables %} 949 {% for name, runtime_enabled_function in unscopeables %}
950 {% filter runtime_enabled(runtime_enabled_function) %} 950 {% filter runtime_enabled(runtime_enabled_function) %}
951 unscopeables->ForceSet(v8Context, v8AtomicString(isolate, "{{name}}"), v8::True( isolate)).FromJust(); 951 unscopeables->CreateDataProperty(v8Context, v8AtomicString(isolate, "{{name}}"), v8::True(isolate)).FromJust();
952 {% endfilter %} 952 {% endfilter %}
953 {% endfor %} 953 {% endfor %}
954 prototypeObject->ForceSet(v8Context, unscopablesSymbol, unscopeables).FromJust() ; 954 prototypeObject->CreateDataProperty(v8Context, unscopablesSymbol, unscopeables). FromJust();
955 {% endmacro %} 955 {% endmacro %}
956 956
957 957
958 {##############################################################################} 958 {##############################################################################}
959 {% block to_active_dom_object %} 959 {% block to_active_dom_object %}
960 {% if is_active_dom_object %} 960 {% if is_active_dom_object %}
961 ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Local<v8::Object> wrapper) 961 ActiveDOMObject* {{v8_class}}::toActiveDOMObject(v8::Local<v8::Object> wrapper)
962 { 962 {
963 return toImpl(wrapper); 963 return toImpl(wrapper);
964 } 964 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 } 1038 }
1039 1039
1040 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 1040 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
1041 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 1041 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
1042 { 1042 {
1043 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 1043 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
1044 } 1044 }
1045 {% endfor %} 1045 {% endfor %}
1046 {% endif %} 1046 {% endif %}
1047 {% endblock %} 1047 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698