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

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

Issue 2640123006: Use the current context as the creation context for cross-origin objects. (Closed)
Patch Set: Created 3 years, 11 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 {% filter format_blink_cpp_source_code %} 1 {% filter format_blink_cpp_source_code %}
2 2
3 {% include 'copyright_block.txt' %} 3 {% include 'copyright_block.txt' %}
4 #include "{{v8_class_or_partial}}.h" 4 #include "{{v8_class_or_partial}}.h"
5 5
6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %} 6 {% for filename in cpp_includes if filename != '%s.h' % cpp_class_or_partial %}
7 #include "{{filename}}" 7 #include "{{filename}}"
8 {% endfor %} 8 {% endfor %}
9 9
10 namespace blink { 10 namespace blink {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 using SetterCallback = void(*)(v8::Local<v8::Value>, const V8CrossOriginSetter Info&); 211 using SetterCallback = void(*)(v8::Local<v8::Value>, const V8CrossOriginSetter Info&);
212 212
213 const char* const name; 213 const char* const name;
214 const GetterCallback getter; 214 const GetterCallback getter;
215 const SetterCallback setter; 215 const SetterCallback setter;
216 } kCrossOriginAttributeTable[] = { 216 } kCrossOriginAttributeTable[] = {
217 {##### Cross-origin attributes #####} 217 {##### Cross-origin attributes #####}
218 {% for attribute in attributes if attribute.has_cross_origin_getter or attribu te.has_cross_origin_setter %} 218 {% for attribute in attributes if attribute.has_cross_origin_getter or attribu te.has_cross_origin_setter %}
219 { 219 {
220 "{{attribute.name}}", 220 "{{attribute.name}}",
221 {%+ if attribute.has_cross_origin_getter %}&{{cpp_class}}V8Internal::{{attri bute.name}}AttributeGetter{% else %}nullptr{% endif %}, 221 {%+ if attribute.has_cross_origin_getter %}&{{cpp_class}}V8Internal::{{attri bute.name}}CrossOriginAttributeGetter{% else %}nullptr{% endif %},
222 {%+ if attribute.has_cross_origin_setter %}&{{cpp_class}}V8Internal::{{attri bute.name}}AttributeSetter{% else %}nullptr{% endif %}, 222 {%+ if attribute.has_cross_origin_setter %}&{{cpp_class}}V8Internal::{{attri bute.name}}AttributeSetter{% else %}nullptr{% endif %},
223 }, 223 },
224 {% endfor %} 224 {% endfor %}
225 {##### Cross-origin methods #####} 225 {##### Cross-origin methods #####}
226 {% for method in methods if method.is_cross_origin %} 226 {% for method in methods if method.is_cross_origin %}
227 {"{{method.name}}", &{{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodG etter, nullptr}, 227 {"{{method.name}}", &{{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodG etter, nullptr},
228 {% endfor %} 228 {% endfor %}
229 }; 229 };
230 {% endif %} 230 {% endif %}
231 231
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 {% endif %} 280 {% endif %}
281 281
282 {% if has_cross_origin_named_enumerator %} 282 {% if has_cross_origin_named_enumerator %}
283 {{exported}}void crossOriginNamedEnumerator(const v8::PropertyCallbackInfo<v8::A rray>& info) { 283 {{exported}}void crossOriginNamedEnumerator(const v8::PropertyCallbackInfo<v8::A rray>& info) {
284 Vector<String> names; 284 Vector<String> names;
285 for (const auto& attribute : kCrossOriginAttributeTable) 285 for (const auto& attribute : kCrossOriginAttributeTable)
286 names.push_back(attribute.name); 286 names.push_back(attribute.name);
287 287
288 v8SetReturnValue( 288 v8SetReturnValue(
289 info, 289 info,
290 ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>()); 290 ToV8(names, info.GetIsolate()->GetCurrentContext()->Global(),
291 info.GetIsolate()).As<v8::Array>());
291 } 292 }
292 {% endif %} 293 {% endif %}
293 294
294 {% if has_cross_origin_indexed_getter %} 295 {% if has_cross_origin_indexed_getter %}
295 {{exported}}void crossOriginIndexedGetter(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) { 296 {{exported}}void crossOriginIndexedGetter(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) {
296 {% if indexed_property_getter.is_custom %} 297 {% if indexed_property_getter.is_custom %}
297 {{v8_class}}::indexedPropertyGetterCustom(index, info); 298 {{v8_class}}::indexedPropertyGetterCustom(index, info);
298 {% else %} 299 {% else %}
299 {{cpp_class}}V8Internal::indexedPropertyGetter(index, info); 300 {{cpp_class}}V8Internal::indexedPropertyGetter(index, info);
300 {% endif %} 301 {% endif %}
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 {% block has_instance %}{% endblock %} 655 {% block has_instance %}{% endblock %}
655 {% block to_impl %}{% endblock %} 656 {% block to_impl %}{% endblock %}
656 {% block to_impl_with_type_check %}{% endblock %} 657 {% block to_impl_with_type_check %}{% endblock %}
657 {##############################################################################} 658 {##############################################################################}
658 {% block prepare_prototype_and_interface_object %}{% endblock %} 659 {% block prepare_prototype_and_interface_object %}{% endblock %}
659 {##############################################################################} 660 {##############################################################################}
660 {% block partial_interface %}{% endblock %} 661 {% block partial_interface %}{% endblock %}
661 } // namespace blink 662 } // namespace blink
662 663
663 {% endfilter %}{# format_blink_cpp_source_code #} 664 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698