| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return true; | 78 return true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 void clear() { m_map.Clear(); } | 81 void clear() { m_map.Clear(); } |
| 82 | 82 |
| 83 void removeAndDispose(KeyType* key) { | 83 void removeAndDispose(KeyType* key) { |
| 84 ASSERT(containsKey(key)); | 84 ASSERT(containsKey(key)); |
| 85 m_map.Remove(key); | 85 m_map.Remove(key); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void markWrapper(v8::EmbedderReachableReferenceReporter* reporter, | 88 void markWrapper(KeyType* object) { |
| 89 KeyType* object) { | 89 m_map.RegisterExternallyReferencedObject(object); |
| 90 m_map.RegisterExternallyReferencedObject(reporter, object); | |
| 91 } | 90 } |
| 92 | 91 |
| 93 private: | 92 private: |
| 94 class PersistentValueMapTraits { | 93 class PersistentValueMapTraits { |
| 95 STATIC_ONLY(PersistentValueMapTraits); | 94 STATIC_ONLY(PersistentValueMapTraits); |
| 96 | 95 |
| 97 public: | 96 public: |
| 98 // Map traits: | 97 // Map traits: |
| 99 typedef HashMap<KeyType*, v8::PersistentContainerValue> Impl; | 98 typedef HashMap<KeyType*, v8::PersistentContainerValue> Impl; |
| 100 typedef typename Impl::iterator Iterator; | 99 typedef typename Impl::iterator Iterator; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); | 155 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 v8::Isolate* m_isolate; | 158 v8::Isolate* m_isolate; |
| 160 typename PersistentValueMapTraits::MapType m_map; | 159 typename PersistentValueMapTraits::MapType m_map; |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 } // namespace blink | 162 } // namespace blink |
| 164 | 163 |
| 165 #endif // DOMWrapperMap_h | 164 #endif // DOMWrapperMap_h |
| OLD | NEW |