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

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

Issue 74783008: IDL compiler: [ActiveDOMObject] interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/templates/interface.h ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% extends 'interface_base.cpp' %} 1 {% extends 'interface_base.cpp' %}
2 2
3 3
4 {##############################################################################} 4 {##############################################################################}
5 {% macro attribute_configuration(attribute) %} 5 {% macro attribute_configuration(attribute) %}
6 {% set getter_callback_name = 6 {% set getter_callback_name =
7 '%sV8Internal::%sAttributeGetterCallback' % 7 '%sV8Internal::%sAttributeGetterCallback' %
8 (interface_name, attribute.name) 8 (interface_name, attribute.name)
9 if not attribute.constructor_type else 9 if not attribute.constructor_type else
10 '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %} 10 '{0}V8Internal::{0}ConstructorGetter'.format(interface_name) %}
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (context && context->isDocument() && {{method.per_context_enabled_functio n_name}}(toDocument(context))) 330 if (context && context->isDocument() && {{method.per_context_enabled_functio n_name}}(toDocument(context)))
331 prototypeTemplate->Set(v8::String::NewSymbol("{{method.name}}"), v8::Fun ctionTemplate::New({{cpp_class_name}}V8Internal::{{method.name}}MethodCallback, v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFu nction()); 331 prototypeTemplate->Set(v8::String::NewSymbol("{{method.name}}"), v8::Fun ctionTemplate::New({{cpp_class_name}}V8Internal::{{method.name}}MethodCallback, v8Undefined(), defaultSignature, {{method.number_of_required_arguments}})->GetFu nction());
332 {% endfor %} 332 {% endfor %}
333 } 333 }
334 334
335 {% endif %} 335 {% endif %}
336 {% endblock %} 336 {% endblock %}
337 337
338 338
339 {##############################################################################} 339 {##############################################################################}
340 {% block to_active_dom_object %}
341 {% if is_active_dom_object %}
342 ActiveDOMObject* {{v8_class_name}}::toActiveDOMObject(v8::Handle<v8::Object> obj ect)
haraken 2013/11/18 11:36:50 object => wrapper
Nils Barth (inactive) 2013/11/19 01:06:51 Changes Perl (so needs testing), will do in quick
Nils Barth (inactive) 2013/11/19 02:16:33 Posted in: IDL compiler: rename object => wrapper
343 {
344 return toNative(object);
345 }
346
347 {% endif %}
348 {% endblock %}
349
350
351 {##############################################################################}
340 {% block create_wrapper_and_deref_object %} 352 {% block create_wrapper_and_deref_object %}
341 v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_n ame}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 353 v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_n ame}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
342 { 354 {
343 ASSERT(impl); 355 ASSERT(impl);
344 ASSERT(!DOMDataStore::containsWrapper<{{v8_class_name}}>(impl.get(), isolate )); 356 ASSERT(!DOMDataStore::containsWrapper<{{v8_class_name}}>(impl.get(), isolate ));
345 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { 357 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
346 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get()); 358 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje ct(impl.get());
347 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have 359 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper TypeInfo. These will both have
348 // the same object de-ref functions, though, so use that as the basis of the check. 360 // the same object de-ref functions, though, so use that as the basis of the check.
349 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction); 361 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
350 } 362 }
351 363
352 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); 364 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
353 if (UNLIKELY(wrapper.IsEmpty())) 365 if (UNLIKELY(wrapper.IsEmpty()))
354 return wrapper; 366 return wrapper;
355 367
356 installPerContextEnabledProperties(wrapper, impl.get(), isolate); 368 installPerContextEnabledProperties(wrapper, impl.get(), isolate);
357 V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTy peInfo, wrapper, isolate, WrapperConfiguration::Independent); 369 {% set wrapper_configuration = 'WrapperConfiguration::Dependent'
370 if is_active_dom_object else
371 'WrapperConfiguration::Independent' %}
372 V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTy peInfo, wrapper, isolate, {{wrapper_configuration}});
358 return wrapper; 373 return wrapper;
359 } 374 }
360 375
361 void {{v8_class_name}}::derefObject(void* object) 376 void {{v8_class_name}}::derefObject(void* object)
362 { 377 {
363 fromInternalPointer(object)->deref(); 378 fromInternalPointer(object)->deref();
364 } 379 }
365 380
366 {% endblock %} 381 {% endblock %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.h ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698