OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 { | 174 { |
175 return getInternalField<WrapperTypeInfo, v8DOMWrapperTypeIndex>(object); | 175 return getInternalField<WrapperTypeInfo, v8DOMWrapperTypeIndex>(object); |
176 } | 176 } |
177 | 177 |
178 struct WrapperConfiguration { | 178 struct WrapperConfiguration { |
179 | 179 |
180 enum Lifetime { | 180 enum Lifetime { |
181 Dependent, Independent | 181 Dependent, Independent |
182 }; | 182 }; |
183 | 183 |
184 void configureWrapper(v8::Persistent<v8::Object>* wrapper, v8::Isolate*
isolate) const | 184 void configureWrapper(v8::Persistent<v8::Object>* wrapper) const |
185 { | 185 { |
186 wrapper->SetWrapperClassId(isolate, classId); | 186 wrapper->SetWrapperClassId(classId); |
187 if (lifetime == Independent) | 187 if (lifetime == Independent) |
188 wrapper->MarkIndependent(isolate); | 188 wrapper->MarkIndependent(); |
189 } | 189 } |
190 | 190 |
191 const uint16_t classId; | 191 const uint16_t classId; |
192 const Lifetime lifetime; | 192 const Lifetime lifetime; |
193 }; | 193 }; |
194 | 194 |
195 inline WrapperConfiguration buildWrapperConfiguration(void*, WrapperConfigur
ation::Lifetime lifetime) | 195 inline WrapperConfiguration buildWrapperConfiguration(void*, WrapperConfigur
ation::Lifetime lifetime) |
196 { | 196 { |
197 WrapperConfiguration configuration = {v8DOMObjectClassId, lifetime}; | 197 WrapperConfiguration configuration = {v8DOMObjectClassId, lifetime}; |
198 return configuration; | 198 return configuration; |
199 } | 199 } |
200 | 200 |
201 inline WrapperConfiguration buildWrapperConfiguration(Node*, WrapperConfigur
ation::Lifetime lifetime) | 201 inline WrapperConfiguration buildWrapperConfiguration(Node*, WrapperConfigur
ation::Lifetime lifetime) |
202 { | 202 { |
203 WrapperConfiguration configuration = {v8DOMNodeClassId, lifetime}; | 203 WrapperConfiguration configuration = {v8DOMNodeClassId, lifetime}; |
204 return configuration; | 204 return configuration; |
205 } | 205 } |
206 | 206 |
207 template<class ElementType> | 207 template<class ElementType> |
208 class WrapperTypeTraits { | 208 class WrapperTypeTraits { |
209 // specialized classes have thier own functions, which are generated by
binding generator. | 209 // specialized classes have thier own functions, which are generated by
binding generator. |
210 }; | 210 }; |
211 } | 211 } |
212 | 212 |
213 #endif // WrapperTypeInfo_h | 213 #endif // WrapperTypeInfo_h |
OLD | NEW |