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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 197 |
198 static bool holderContainsWrapper(v8::Local<v8::Object> holder, ScriptWrappa
ble* wrappable) | 198 static bool holderContainsWrapper(v8::Local<v8::Object> holder, ScriptWrappa
ble* wrappable) |
199 { | 199 { |
200 // Verify our assumptions about the main world. | 200 // Verify our assumptions about the main world. |
201 ASSERT(wrappable); | 201 ASSERT(wrappable); |
202 ASSERT(!wrappable->containsWrapper() || !wrappable->isEqualTo(holder) ||
current(v8::Isolate::GetCurrent()).m_isMainWorld); | 202 ASSERT(!wrappable->containsWrapper() || !wrappable->isEqualTo(holder) ||
current(v8::Isolate::GetCurrent()).m_isMainWorld); |
203 return wrappable->isEqualTo(holder); | 203 return wrappable->isEqualTo(holder); |
204 } | 204 } |
205 | 205 |
206 bool m_isMainWorld; | 206 bool m_isMainWorld; |
207 DOMWrapperMap<void> m_wrapperMap; | 207 DOMWrapperMap<ScriptWrappableBase> m_wrapperMap; |
208 }; | 208 }; |
209 | 209 |
| 210 template <> |
| 211 inline void DOMWrapperMap<ScriptWrappableBase>::PersistentValueMapTraits::Dispos
e( |
| 212 v8::Isolate* isolate, |
| 213 v8::UniquePersistent<v8::Object> value, |
| 214 ScriptWrappableBase* key) |
| 215 { |
| 216 RELEASE_ASSERT(!value.IsEmpty()); // See crbug.com/368095. |
| 217 releaseObject(v8::Local<v8::Object>::New(isolate, value)); |
| 218 } |
| 219 |
210 } // namespace blink | 220 } // namespace blink |
211 | 221 |
212 #endif // DOMDataStore_h | 222 #endif // DOMDataStore_h |
OLD | NEW |