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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/methods.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 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value %} 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc al_cpp_value %}
2 2
3 {##############################################################################} 3 {##############################################################################}
4 {% macro generate_method(method, world_suffix) %} 4 {% macro generate_method(method, world_suffix) %}
5 {% if method.returns_promise and method.has_exception_state %} 5 {% if method.returns_promise and method.has_exception_state %}
6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e) 6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat e)
7 {% else %} 7 {% else %}
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
9 {% endif %} 9 {% endif %}
10 { 10 {
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 535
536 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation Template(world, &domTemplateKey, {{cpp_class}}V8Internal::{{method.name}}MethodC allback{{world_suffix}}, v8Undefined(), signature, {{method.length}}); 536 v8::Local<v8::FunctionTemplate> methodTemplate = data->findOrCreateOperation Template(world, &domTemplateKey, {{cpp_class}}V8Internal::{{method.name}}MethodC allback{{world_suffix}}, v8Undefined(), signature, {{method.length}});
537 // Return the function by default, unless the user script has overwritten it . 537 // Return the function by default, unless the user script has overwritten it .
538 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur rentContext()).ToLocalChecked()); 538 v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCur rentContext()).ToLocalChecked());
539 539
540 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder()); 540 {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
541 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), currentDOMWindo w(info.GetIsolate()), impl, DoNotReportSecurityError)) { 541 if (!BindingSecurity::shouldAllowAccessTo(info.GetIsolate(), currentDOMWindo w(info.GetIsolate()), impl, DoNotReportSecurityError)) {
542 return; 542 return;
543 } 543 }
544 544
545 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState ::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.This()), v8Atomic String(info.GetIsolate(), "{{method.name}}")); 545 v8::Local<v8::Value> hiddenValue = V8HiddenValue::getHiddenValue(ScriptState ::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), v8Atom icString(info.GetIsolate(), "{{method.name}}"));
546 if (!hiddenValue.IsEmpty()) { 546 if (!hiddenValue.IsEmpty()) {
547 v8SetReturnValue(info, hiddenValue); 547 v8SetReturnValue(info, hiddenValue);
548 } 548 }
549 } 549 }
550 550
551 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo cal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info) 551 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo cal<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
552 { 552 {
553 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix }}(info); 553 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix }}(info);
554 } 554 }
555 {% endmacro %} 555 {% endmacro %}
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all 680 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all
681 if method.overloads else 681 if method.overloads else
682 method.runtime_enabled_function) %} 682 method.runtime_enabled_function) %}
683 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}}; 683 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration = {{method_configuration(method)}};
684 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); 684 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration);
685 {% endfilter %}{# runtime_enabled() #} 685 {% endfilter %}{# runtime_enabled() #}
686 {% endfilter %}{# exposed() #} 686 {% endfilter %}{# exposed() #}
687 {% endfor %} 687 {% endfor %}
688 {% endif %} 688 {% endif %}
689 {%- endmacro %} 689 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698