OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 private: | 114 private: |
115 static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Object>* wrapp
er, DOMWrapperMap<KeyType>*); | 115 static void makeWeakCallback(v8::Isolate*, v8::Persistent<v8::Object>* wrapp
er, DOMWrapperMap<KeyType>*); |
116 | 116 |
117 v8::Isolate* m_isolate; | 117 v8::Isolate* m_isolate; |
118 MapType m_map; | 118 MapType m_map; |
119 }; | 119 }; |
120 | 120 |
121 template<> | 121 template<> |
122 inline void DOMWrapperMap<void>::makeWeakCallback(v8::Isolate* isolate, v8::Pers
istent<v8::Object>* wrapper, DOMWrapperMap<void>* map) | 122 inline void DOMWrapperMap<void>::makeWeakCallback(v8::Isolate* isolate, v8::Pers
istent<v8::Object>* wrapper, DOMWrapperMap<void>* map) |
123 { | 123 { |
124 WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); | 124 const WrapperTypeInfo* type = toWrapperTypeInfo(*wrapper); |
125 ASSERT(type->derefObjectFunction); | 125 ASSERT(type->derefObjectFunction); |
126 void* key = static_cast<void*>(toNative(*wrapper)); | 126 void* key = static_cast<void*>(toNative(*wrapper)); |
127 ASSERT(*(map->m_map.get(key).persistent()) == *wrapper); | 127 ASSERT(*(map->m_map.get(key).persistent()) == *wrapper); |
128 map->removeAndDispose(key); | 128 map->removeAndDispose(key); |
129 type->derefObject(key); | 129 type->derefObject(key); |
130 } | 130 } |
131 | 131 |
132 } // namespace WebCore | 132 } // namespace WebCore |
133 | 133 |
134 #endif // DOMWrapperMap_h | 134 #endif // DOMWrapperMap_h |
OLD | NEW |