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