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

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

Issue 651713002: Oilpan: DOM wrappers don't need to keep persistent handles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | 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 {% 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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 428
429 {##############################################################################} 429 {##############################################################################}
430 {% from 'methods.cpp' import generate_constructor with context %} 430 {% from 'methods.cpp' import generate_constructor with context %}
431 {% block named_constructor %} 431 {% block named_constructor %}
432 {% if named_constructor %} 432 {% if named_constructor %}
433 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class 433 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class
434 if is_active_dom_object else '0' %} 434 if is_active_dom_object else '0' %}
435 {% set to_event_target = '%s::toEventTarget' % v8_class 435 {% set to_event_target = '%s::toEventTarget' % v8_class
436 if is_event_target else '0' %} 436 if is_event_target else '0' %}
437 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_clas s}}::derefObject, {{v8_class}}::createPersistentHandle, {{to_active_dom_object}} , {{to_event_target}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8 _class}}::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperType ObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifet ime}}, WrapperTypeInfo::{{gc_type}} }; 437 const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde rBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::refObject, {{v8_clas s}}::derefObject, {{v8_class}}::trace, {{to_active_dom_object}}, {{to_event_targ et}}, 0, {{v8_class}}::installConditionallyEnabledMethods, {{v8_class}}::install ConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{lifetime}}, WrapperTyp eInfo::{{gc_type}} };
438 438
439 {{generate_constructor(named_constructor)}} 439 {{generate_constructor(named_constructor)}}
440 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat e* isolate) 440 v8::Handle<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolat e* isolate)
441 { 441 {
442 static int domTemplateKey; // This address is used for a key to look up the dom template. 442 static int domTemplateKey; // This address is used for a key to look up the dom template.
443 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 443 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
444 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey); 444 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(&domTempl ateKey);
445 if (!result.IsEmpty()) 445 if (!result.IsEmpty())
446 return result; 446 return result;
447 447
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 { 871 {
872 {% if gc_type == 'WillBeGarbageCollectedObject' %} 872 {% if gc_type == 'WillBeGarbageCollectedObject' %}
873 #if !ENABLE(OILPAN) 873 #if !ENABLE(OILPAN)
874 internalPointer->toImpl<{{cpp_class}}>()->deref(); 874 internalPointer->toImpl<{{cpp_class}}>()->deref();
875 #endif 875 #endif
876 {% elif gc_type == 'RefCountedObject' %} 876 {% elif gc_type == 'RefCountedObject' %}
877 internalPointer->toImpl<{{cpp_class}}>()->deref(); 877 internalPointer->toImpl<{{cpp_class}}>()->deref();
878 {% endif %} 878 {% endif %}
879 } 879 }
880 880
881 WrapperPersistentNode* {{v8_class}}::createPersistentHandle(ScriptWrappableBase* internalPointer)
882 {
883 {% if gc_type == 'GarbageCollectedObject' %}
884 return WrapperPersistent<{{cpp_class}}>::create(internalPointer->toImpl<{{cp p_class}}>());
885 {% elif gc_type == 'WillBeGarbageCollectedObject' %}
886 #if ENABLE(OILPAN)
887 return WrapperPersistent<{{cpp_class}}>::create(internalPointer->toImpl<{{cp p_class}}>());
888 #else
889 ASSERT_NOT_REACHED();
890 return 0;
891 #endif
892 {% elif gc_type == 'RefCountedObject' %}
893 ASSERT_NOT_REACHED();
894 return 0;
895 {% endif %}
896 }
897
898 template<> 881 template<>
899 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate) 882 v8::Handle<v8::Value> toV8NoInline({{cpp_class}}* impl, v8::Handle<v8::Object> c reationContext, v8::Isolate* isolate)
900 { 883 {
901 return toV8(impl, creationContext, isolate); 884 return toV8(impl, creationContext, isolate);
902 } 885 }
903 886
904 {% endblock %} 887 {% 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