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

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

Issue 2207423002: Implement '[SecureContext]' IDL attribute for interfaces, methods and attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback. Created 4 years, 4 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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 {% endfor %} 904 {% endfor %}
905 prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopeables).Fr omJust(); 905 prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopeables).Fr omJust();
906 {% endmacro %} 906 {% endmacro %}
907 907
908 908
909 {##############################################################################} 909 {##############################################################################}
910 {% macro install_conditionally_enabled_attributes_on_prototype() %} 910 {% macro install_conditionally_enabled_attributes_on_prototype() %}
911 {% from 'attributes.cpp' import attribute_configuration with context %} 911 {% from 'attributes.cpp' import attribute_configuration with context %}
912 ExecutionContext* executionContext = toExecutionContext(context); 912 ExecutionContext* executionContext = toExecutionContext(context);
913 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTempla te); 913 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTempla te);
914 {% for attribute in attributes if attribute.exposed_test and attribute.on_protot ype %} 914 {% for attribute in attributes if (attribute.exposed_test or attribute.secure_co ntext_test) and attribute.on_prototype %}
915 {% filter exposed(attribute.exposed_test) %} 915 {% filter exposed(attribute.exposed_test) %}
916 {% filter secure_context(attribute.secure_context_test) %}
917 {% filter runtime_enabled(attribute.runtime_enabled_function) %}
916 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}}; 918 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attrib ute_configuration(attribute)}};
917 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration); 919 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), pro totypeObject, interfaceObject, signature, accessorConfiguration);
918 {% endfilter %} 920 {% endfilter %}{# runtime_enabled #}
921 {% endfilter %}{# secure_context #}
922 {% endfilter %}{# exposed #}
919 {% endfor %} 923 {% endfor %}
920 {% endmacro %} 924 {% endmacro %}
921 925
922 926
923 {##############################################################################} 927 {##############################################################################}
924 {% block to_active_scriptwrappable %} 928 {% block to_active_scriptwrappable %}
925 {% if active_scriptwrappable %} 929 {% if active_scriptwrappable %}
926 ActiveScriptWrappable* {{v8_class}}::toActiveScriptWrappable(v8::Local<v8::Objec t> wrapper) 930 ActiveScriptWrappable* {{v8_class}}::toActiveScriptWrappable(v8::Local<v8::Objec t> wrapper)
927 { 931 {
928 return toImpl(wrapper); 932 return toImpl(wrapper);
(...skipping 17 matching lines...) Expand all
946 950
947 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %} 951 {% for method in methods if method.overloads and method.overloads.has_partial_ov erloads %}
948 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 952 void {{v8_class}}::register{{method.name | blink_capitalize}}MethodForPartialInt erface(void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
949 { 953 {
950 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method; 954 {{cpp_class}}V8Internal::{{method.name}}MethodForPartialInterface = method;
951 } 955 }
952 956
953 {% endfor %} 957 {% endfor %}
954 {% endif %} 958 {% endif %}
955 {% endblock %} 959 {% endblock %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698