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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 typeInfo->derefObjectFunction(toNative(wrapper)); | 206 typeInfo->derefObjectFunction(toNative(wrapper)); |
207 #endif | 207 #endif |
208 } | 208 } |
209 | 209 |
210 struct WrapperConfiguration { | 210 struct WrapperConfiguration { |
211 | 211 |
212 enum Lifetime { | 212 enum Lifetime { |
213 Dependent, Independent | 213 Dependent, Independent |
214 }; | 214 }; |
215 | 215 |
216 void configureWrapper(v8::Persistent<v8::Object>* wrapper) const | 216 void configureWrapper(v8::PersistentBase<v8::Object>* wrapper) const |
217 { | 217 { |
218 wrapper->SetWrapperClassId(classId); | 218 wrapper->SetWrapperClassId(classId); |
219 if (lifetime == Independent) | 219 if (lifetime == Independent) |
220 wrapper->MarkIndependent(); | 220 wrapper->MarkIndependent(); |
221 } | 221 } |
222 | 222 |
223 const uint16_t classId; | 223 const uint16_t classId; |
224 const Lifetime lifetime; | 224 const Lifetime lifetime; |
225 }; | 225 }; |
226 | 226 |
227 inline WrapperConfiguration buildWrapperConfiguration(void*, WrapperConfigur
ation::Lifetime lifetime) | 227 inline WrapperConfiguration buildWrapperConfiguration(void*, WrapperConfigur
ation::Lifetime lifetime) |
228 { | 228 { |
229 WrapperConfiguration configuration = {v8DOMObjectClassId, lifetime}; | 229 WrapperConfiguration configuration = {v8DOMObjectClassId, lifetime}; |
230 return configuration; | 230 return configuration; |
231 } | 231 } |
232 | 232 |
233 inline WrapperConfiguration buildWrapperConfiguration(Node*, WrapperConfigur
ation::Lifetime lifetime) | 233 inline WrapperConfiguration buildWrapperConfiguration(Node*, WrapperConfigur
ation::Lifetime lifetime) |
234 { | 234 { |
235 WrapperConfiguration configuration = {v8DOMNodeClassId, lifetime}; | 235 WrapperConfiguration configuration = {v8DOMNodeClassId, lifetime}; |
236 return configuration; | 236 return configuration; |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 #endif // WrapperTypeInfo_h | 240 #endif // WrapperTypeInfo_h |
OLD | NEW |