| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 inline void V8DOMWrapper::setNativeInfoWithPersistentHandle(v8::Handle<v8::O
bject> wrapper, const WrapperTypeInfo* type, void* object, PersistentNode* handl
e) | 73 inline void V8DOMWrapper::setNativeInfoWithPersistentHandle(v8::Handle<v8::O
bject> wrapper, const WrapperTypeInfo* type, void* object, PersistentNode* handl
e) |
| 74 { | 74 { |
| 75 ASSERT(wrapper->InternalFieldCount() >= 3); | 75 ASSERT(wrapper->InternalFieldCount() >= 3); |
| 76 ASSERT(object); | 76 ASSERT(object); |
| 77 ASSERT(type); | 77 ASSERT(type); |
| 78 ASSERT(type->isGarbageCollected); | 78 ASSERT(type->isGarbageCollected); |
| 79 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, objec
t); | 79 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, objec
t); |
| 80 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_c
ast<WrapperTypeInfo*>(type)); | 80 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_c
ast<WrapperTypeInfo*>(type)); |
| 81 wrapper->SetAlignedPointerInInternalField(v8PersistentHandleIndex, handl
e); | 81 // Persistent handle is stored in the last internal field. |
| 82 wrapper->SetAlignedPointerInInternalField(wrapper->InternalFieldCount()
- 1, handle); |
| 82 } | 83 } |
| 83 | 84 |
| 84 inline void V8DOMWrapper::clearNativeInfo(v8::Handle<v8::Object> wrapper, co
nst WrapperTypeInfo* type) | 85 inline void V8DOMWrapper::clearNativeInfo(v8::Handle<v8::Object> wrapper, co
nst WrapperTypeInfo* type) |
| 85 { | 86 { |
| 86 ASSERT(wrapper->InternalFieldCount() >= 2); | 87 ASSERT(wrapper->InternalFieldCount() >= 2); |
| 87 ASSERT(type); | 88 ASSERT(type); |
| 88 // clearNativeInfo() is used only by NP objects, which are not garbage c
ollected. | 89 // clearNativeInfo() is used only by NP objects, which are not garbage c
ollected. |
| 89 ASSERT(!type->isGarbageCollected); | 90 ASSERT(!type->isGarbageCollected); |
| 90 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_c
ast<WrapperTypeInfo*>(type)); | 91 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperTypeIndex, const_c
ast<WrapperTypeInfo*>(type)); |
| 91 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, 0); | 92 wrapper->SetAlignedPointerInInternalField(v8DOMWrapperObjectIndex, 0); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 v8::Handle<v8::Context> context() const { return m_context; } | 143 v8::Handle<v8::Context> context() const { return m_context; } |
| 143 | 144 |
| 144 private: | 145 private: |
| 145 bool m_didEnterContext; | 146 bool m_didEnterContext; |
| 146 v8::Handle<v8::Context> m_context; | 147 v8::Handle<v8::Context> m_context; |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 } | 150 } |
| 150 | 151 |
| 151 #endif // V8DOMWrapper_h | 152 #endif // V8DOMWrapper_h |
| OLD | NEW |