| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // Persistent handle is stored in the last internal field. | 185 // Persistent handle is stored in the last internal field. |
| 186 return static_cast<PersistentNode*>(wrapper->GetAlignedPointerFromIntern
alField(wrapper->InternalFieldCount() - 1)); | 186 return static_cast<PersistentNode*>(wrapper->GetAlignedPointerFromIntern
alField(wrapper->InternalFieldCount() - 1)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 inline void releaseObject(v8::Handle<v8::Object> wrapper) | 189 inline void releaseObject(v8::Handle<v8::Object> wrapper) |
| 190 { | 190 { |
| 191 const WrapperTypeInfo* typeInfo = toWrapperTypeInfo(wrapper); | 191 const WrapperTypeInfo* typeInfo = toWrapperTypeInfo(wrapper); |
| 192 #if ENABLE(OILPAN) | 192 #if ENABLE(OILPAN) |
| 193 if (typeInfo->isGarbageCollected) { | 193 if (typeInfo->isGarbageCollected) { |
| 194 const PersistentNode* handle = toPersistentHandle(wrapper); | 194 const PersistentNode* handle = toPersistentHandle(wrapper); |
| 195 ASSERT(handle); | 195 // This will be null iff a wrapper for a hidden wrapper object, |
| 196 // see V8DOMWrapper::setNativeInfoForHiddenWrapper(). |
| 196 delete handle; | 197 delete handle; |
| 197 } else { | 198 } else { |
| 198 ASSERT(typeInfo->derefObjectFunction); | 199 ASSERT(typeInfo->derefObjectFunction); |
| 199 typeInfo->derefObjectFunction(toNative(wrapper)); | 200 typeInfo->derefObjectFunction(toNative(wrapper)); |
| 200 } | 201 } |
| 201 #else | 202 #else |
| 202 ASSERT(typeInfo->derefObjectFunction); | 203 ASSERT(typeInfo->derefObjectFunction); |
| 203 typeInfo->derefObjectFunction(toNative(wrapper)); | 204 typeInfo->derefObjectFunction(toNative(wrapper)); |
| 204 #endif | 205 #endif |
| 205 } | 206 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 228 } | 229 } |
| 229 | 230 |
| 230 inline WrapperConfiguration buildWrapperConfiguration(Node*, WrapperConfigur
ation::Lifetime lifetime) | 231 inline WrapperConfiguration buildWrapperConfiguration(Node*, WrapperConfigur
ation::Lifetime lifetime) |
| 231 { | 232 { |
| 232 WrapperConfiguration configuration = {v8DOMNodeClassId, lifetime}; | 233 WrapperConfiguration configuration = {v8DOMNodeClassId, lifetime}; |
| 233 return configuration; | 234 return configuration; |
| 234 } | 235 } |
| 235 } | 236 } |
| 236 | 237 |
| 237 #endif // WrapperTypeInfo_h | 238 #endif // WrapperTypeInfo_h |
| OLD | NEW |