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

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

Issue 2042943002: Replace info.This() with info.Holder() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 {% endblock %} 431 {% endblock %}
432 432
433 433
434 {##############################################################################} 434 {##############################################################################}
435 {% block origin_safe_method_setter %} 435 {% block origin_safe_method_setter %}
436 {% if has_origin_safe_method_setter %} 436 {% if has_origin_safe_method_setter %}
437 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 437 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
438 { 438 {
439 if (!name->IsString()) 439 if (!name->IsString())
440 return; 440 return;
441 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in fo.This(), info.GetIsolate()); 441 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in fo.Holder(), info.GetIsolate());
442 if (holder.IsEmpty()) 442 if (holder.IsEmpty())
443 return; 443 return;
444 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); 444 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder);
445 v8::String::Utf8Value attributeName(name); 445 v8::String::Utf8Value attributeName(name);
446 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate()); 446 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate());
447 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), currentDOMWindo w(info.GetIsolate()), impl, exceptionState)) { 447 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), currentDOMWindo w(info.GetIsolate()), impl, exceptionState)) {
448 exceptionState.throwIfNeeded(); 448 exceptionState.throwIfNeeded();
449 return; 449 return;
450 } 450 }
451 451
452 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha ndle if info.This() is an Object. #} 452 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha ndle if info.Holder() is an Object. #}
453 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L ocal<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value); 453 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::L ocal<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value);
454 } 454 }
455 455
456 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 456 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
457 { 457 {
458 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, info); 458 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, info);
459 } 459 }
460 460
461 {% endif %} 461 {% endif %}
462 {% endblock %} 462 {% endblock %}
463 463
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 934
935 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 935 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
936 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 936 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
937 { 937 {
938 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 938 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
939 } 939 }
940 940
941 {% endfor %} 941 {% endfor %}
942 {% endif %} 942 {% endif %}
943 {% endblock %} 943 {% endblock %}
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/scripts/v8_utilities.py ('k') | third_party/WebKit/Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698