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

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

Issue 2566823002: Remove deprecated ExceptionState constructors. (Closed)
Patch Set: Created 4 years 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.tmpl' %} 1 {% extends 'interface_base.cpp.tmpl' %}
2 2
3 {% set has_prepare_prototype_and_interface_object = 3 {% set has_prepare_prototype_and_interface_object =
4 unscopables or has_conditional_attributes_on_prototype or 4 unscopables or has_conditional_attributes_on_prototype or
5 methods | conditionally_exposed(is_partial) %} 5 methods | conditionally_exposed(is_partial) %}
6 {% set prepare_prototype_and_interface_object_func = 6 {% set prepare_prototype_and_interface_object_func =
7 '%s::preparePrototypeAndInterfaceObject' % v8_class 7 '%s::preparePrototypeAndInterfaceObject' % v8_class
8 if has_prepare_prototype_and_interface_object 8 if has_prepare_prototype_and_interface_object
9 else 'nullptr' %} 9 else 'nullptr' %}
10 10
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 {% block origin_safe_method_setter %} 494 {% block origin_safe_method_setter %}
495 {% if has_origin_safe_method_setter %} 495 {% if has_origin_safe_method_setter %}
496 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { 496 static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) {
497 if (!name->IsString()) 497 if (!name->IsString())
498 return; 498 return;
499 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(info .Holder(), info.GetIsolate()); 499 v8::Local<v8::Object> holder = {{v8_class}}::findInstanceInPrototypeChain(info .Holder(), info.GetIsolate());
500 if (holder.IsEmpty()) 500 if (holder.IsEmpty())
501 return; 501 return;
502 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder); 502 {{cpp_class}}* impl = {{v8_class}}::toImpl(holder);
503 v8::String::Utf8Value attributeName(name); 503 v8::String::Utf8Value attributeName(name);
504 ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, " {{interface_name}}", info.Holder(), info.GetIsolate()); 504 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "{{interface_name}}", *attributeName);
dcheng 2016/12/10 07:42:13 I thought about adding a TODO: with the ExceptionS
505 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) { 505 if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
506 return; 506 return;
507 } 507 }
508 508
509 {# The findInstanceInPrototypeChain() call above only returns a non-empty hand le if info.Holder() is an Object. #} 509 {# The findInstanceInPrototypeChain() call above only returns a non-empty hand le if info.Holder() is an Object. #}
510 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::Loc al<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value); 510 V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::Loc al<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value);
511 } 511 }
512 512
513 void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name, v8::L ocal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) { 513 void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name, v8::L ocal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) {
514 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, in fo); 514 {{cpp_class}}V8Internal::{{cpp_class}}OriginSafeMethodSetter(name, v8Value, in fo);
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 } 957 }
958 958
959 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 959 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
960 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) { 960 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) {
961 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 961 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
962 } 962 }
963 963
964 {% endfor %} 964 {% endfor %}
965 {% endif %} 965 {% endif %}
966 {% endblock %} 966 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698