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

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

Issue 2452073002: Freeze global prototype chain per WebIDL (Closed)
Patch Set: Also freeze named properties objects Created 4 years, 1 month 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObjec t(v8::Isolate* isolate, const DOMWrapperWorld& world) 786 v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObjec t(v8::Isolate* isolate, const DOMWrapperWorld& world)
787 { 787 {
788 v8::Local<v8::FunctionTemplate> parentTemplate = V8{{parent_interface}}::dom Template(isolate, world); 788 v8::Local<v8::FunctionTemplate> parentTemplate = V8{{parent_interface}}::dom Template(isolate, world);
789 789
790 v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8:: FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode); 790 v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8:: FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
791 namedPropertiesObjectFunctionTemplate->SetClassName(v8AtomicString(isolate, "{{interface_name}}Properties")); 791 namedPropertiesObjectFunctionTemplate->SetClassName(v8AtomicString(isolate, "{{interface_name}}Properties"));
792 namedPropertiesObjectFunctionTemplate->Inherit(parentTemplate); 792 namedPropertiesObjectFunctionTemplate->Inherit(parentTemplate);
793 793
794 v8::Local<v8::ObjectTemplate> namedPropertiesObjectTemplate = namedPropertie sObjectFunctionTemplate->PrototypeTemplate(); 794 v8::Local<v8::ObjectTemplate> namedPropertiesObjectTemplate = namedPropertie sObjectFunctionTemplate->PrototypeTemplate();
795 namedPropertiesObjectTemplate->SetInternalFieldCount({{v8_class}}::internalF ieldCount); 795 namedPropertiesObjectTemplate->SetInternalFieldCount({{v8_class}}::internalF ieldCount);
796 // Named Properties object has SetPrototype method of Immutable Prototype Ex otic Objects
797 namedPropertiesObjectTemplate->SetImmutableProto();
796 V8DOMConfiguration::setClassString(isolate, namedPropertiesObjectTemplate, " {{interface_name}}Properties"); 798 V8DOMConfiguration::setClassString(isolate, namedPropertiesObjectTemplate, " {{interface_name}}Properties");
797 {{install_named_property_handler('namedPropertiesObjectTemplate') | indent}} 799 {{install_named_property_handler('namedPropertiesObjectTemplate') | indent}}
798 800
799 return namedPropertiesObjectFunctionTemplate; 801 return namedPropertiesObjectFunctionTemplate;
800 } 802 }
801 803
802 {% endif %} 804 {% endif %}
803 {% endblock %} 805 {% endblock %}
804 806
805 807
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 994
993 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 995 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
994 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 996 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
995 { 997 {
996 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 998 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
997 } 999 }
998 1000
999 {% endfor %} 1001 {% endfor %}
1000 {% endif %} 1002 {% endif %}
1001 {% endblock %} 1003 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698