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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 74783008: IDL compiler: [ActiveDOMObject] interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/templates/interface.h ('k') | Source/bindings/templates/interface_base.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 112b268d29f81b53e01bcb8240a6c36b2340eda9..fb4ac2b50a6888caa821791479fb8ccc13c105cc 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -337,6 +337,18 @@ void {{v8_class_name}}::installPerContextEnabledMethods(v8::Handle<v8::Object> p
{##############################################################################}
+{% block to_active_dom_object %}
+{% if is_active_dom_object %}
+ActiveDOMObject* {{v8_class_name}}::toActiveDOMObject(v8::Handle<v8::Object> object)
+{
+ return toNative(object);
+}
+
+{% endif %}
+{% endblock %}
+
+
+{##############################################################################}
{% block create_wrapper_and_deref_object %}
v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_name}}> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
@@ -354,7 +366,10 @@ v8::Handle<v8::Object> {{v8_class_name}}::createWrapper(PassRefPtr<{{cpp_class_n
return wrapper;
installPerContextEnabledProperties(wrapper, impl.get(), isolate);
- V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+ {% set wrapper_configuration = 'WrapperConfiguration::Dependent'
+ if is_active_dom_object else
+ 'WrapperConfiguration::Independent' %}
+ V8DOMWrapper::associateObjectWithWrapper<{{v8_class_name}}>(impl, &wrapperTypeInfo, wrapper, isolate, {{wrapper_configuration}});
return wrapper;
}
« 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