87 static bool wrapperCanBeStoredInObject(const void*) { return false; }
88 static bool wrapperCanBeStoredInObject(const ScriptWrappable*) { return true; }
89
90 static v8::Handle<v8::Object> getWrapperFromObject(void*)
91 {
92 ASSERT_NOT_REACHED();
93 return v8::Handle<v8::Object>();
94 }
95
96 static v8::Handle<v8::Object> getWrapperFromObject(ScriptWrappable* object)
97 {
98 return object->wrapper();
99 }
100
101 static void setWrapperInObject(void*, v8::Handle<v8::Object>, v8::Isolate*, const WrapperConfiguration&)
102 {
103 ASSERT_NOT_REACHED();
104 }
105
106 static void setWrapperInObject(ScriptWrappable* object, v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperConfiguration& configuration)
107 {
108 object->setWrapper(wrapper, isolate, configuration);
109 }
110
111 static const WrapperTypeInfo* getTypeInfoFromObject(void* object)
112 {
113 ASSERT_NOT_REACHED();
114 return 0;
115 }
116
117 static const WrapperTypeInfo* getTypeInfoFromObject(ScriptWrappable* object)
118 {
119 return object->typeInfo();
120 }
121
122 static void setTypeInfoInObject(void* object, const WrapperTypeInfo* info)
123 {
124 ASSERT_NOT_REACHED();
125 }
126
127 static void setTypeInfoInObject(ScriptWrappable* object, const WrapperTypeInfo* info)
128 {
129 object->setTypeInfo(info);
130 }
131
132 // Wrappables need to be initialized with their most derrived wrapped type
133 // in much the same way that certain other types need to be adopted and
134 // so forth. The templated Init() methods are instantiated in the generated
135 // V8 bindings code. The custom init method is provided by the custom element
136 // constructor's custom code. The JSC code will maintain compatibility via
137 // no-op (void*) methods here.
138 template <typename T>static void init(T* object)
139 {
140 extern void scriptwrappable_init(T*); // Workaround for lack of extern template prior to C++11.
141 scriptwrappable_init(object);
142 }
143
144 static void initAsCustomElementConstructorCaller(ScriptWrappable* object)
145 {
146 extern void scriptwrappable_initCustom(ScriptWrappable*); // Avoid cirular inclusion.
147 scriptwrappable_initCustom(object);
148 }
149