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