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

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

Issue 1002163002: bindings: Use AccessorName{Getter,Setter}Callback in AttributeConfiguration (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/constants.cpp ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 455 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
456 } 456 }
457 457
458 {% endif %} 458 {% endif %}
459 {% endblock %} 459 {% endblock %}
460 460
461 461
462 {##############################################################################} 462 {##############################################################################}
463 {% block origin_safe_method_setter %} 463 {% block origin_safe_method_setter %}
464 {% if has_origin_safe_method_setter %} 464 {% if has_origin_safe_method_setter %}
465 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::String> name, v8:: Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 465 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
466 { 466 {
467 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in fo.This(), info.GetIsolate()); 467 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(in fo.This(), info.GetIsolate());
468 if (holder.IsEmpty()) 468 if (holder.IsEmpty())
469 return; 469 return;
470 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); 470 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder);
471 v8::String::Utf8Value attributeName(name); 471 v8::String::Utf8Value attributeName(name);
472 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate()); 472 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "{{interface_name}}", info.Holder(), info.GetIsolate());
473 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) { 473 if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->fram e(), exceptionState)) {
474 exceptionState.throwIfNeeded(); 474 exceptionState.throwIfNeeded();
475 return; 475 return;
476 } 476 }
477 477
478 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha ndle if info.This() is an Object. #} 478 {# The findInstanceInPrototypeChain() call above only returns a non-empty ha ndle if info.This() is an Object. #}
479 V8HiddenValue::setHiddenValue(info.GetIsolate(), v8::Local<v8::Object>::Cast (info.This()), name, v8Value); 479 V8HiddenValue::setHiddenValue(info.GetIsolate(), v8::Local<v8::Object>::Cast (info.This()), name.As<v8::String>(), v8Value);
480 } 480 }
481 481
482 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::String> na me, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) 482 static void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name , v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
483 { 483 {
484 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); 484 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
485 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, info); 485 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, info);
486 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 486 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
487 } 487 }
488 488
489 {% endif %} 489 {% endif %}
490 {% endblock %} 490 {% endblock %}
491 491
492 492
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 } 1030 }
1031 1031
1032 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 1032 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
1033 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 1033 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
1034 { 1034 {
1035 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 1035 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
1036 } 1036 }
1037 {% endfor %} 1037 {% endfor %}
1038 {% endif %} 1038 {% endif %}
1039 {% endblock %} 1039 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/constants.cpp ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698