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

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

Issue 1938943002: Use v8::Object::CreateDataProperty() for object construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 389 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
390 { 390 {
391 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); 391 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
392 Vector<String> names; 392 Vector<String> names;
393 ExceptionState exceptionState(ExceptionState::EnumerationContext, "{{interfa ce_name}}", info.Holder(), info.GetIsolate()); 393 ExceptionState exceptionState(ExceptionState::EnumerationContext, "{{interfa ce_name}}", info.Holder(), info.GetIsolate());
394 impl->namedPropertyEnumerator(names, exceptionState); 394 impl->namedPropertyEnumerator(names, exceptionState);
395 if (exceptionState.throwIfNeeded()) 395 if (exceptionState.throwIfNeeded())
396 return; 396 return;
397 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size( )); 397 v8::Local<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size( ));
398 for (size_t i = 0; i < names.size(); ++i) { 398 for (size_t i = 0; i < names.size(); ++i) {
399 if (!v8CallBoolean(v8names->Set(info.GetIsolate()->GetCurrentContext(), v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIsolate(), names[i])))) 399 if (!v8CallBoolean(v8names->CreateDataProperty(info.GetIsolate()->GetCur rentContext(), i, v8String(info.GetIsolate(), names[i]))))
400 return; 400 return;
401 } 401 }
402 v8SetReturnValue(info, v8names); 402 v8SetReturnValue(info, v8names);
403 } 403 }
404 404
405 {% endif %} 405 {% endif %}
406 {% endblock %} 406 {% endblock %}
407 407
408 408
409 {##############################################################################} 409 {##############################################################################}
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 927
928 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 928 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
929 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 929 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
930 { 930 {
931 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 931 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
932 } 932 }
933 933
934 {% endfor %} 934 {% endfor %}
935 {% endif %} 935 {% endif %}
936 {% endblock %} 936 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698