| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 if (UNLIKELY(ContainsKey(key))) { | 73 if (UNLIKELY(ContainsKey(key))) { |
| 74 wrapper = NewLocal(isolate_, key); | 74 wrapper = NewLocal(isolate_, key); |
| 75 return false; | 75 return false; |
| 76 } | 76 } |
| 77 v8::Global<v8::Object> global(isolate_, wrapper); | 77 v8::Global<v8::Object> global(isolate_, wrapper); |
| 78 wrapper_type_info->ConfigureWrapper(&global); | 78 wrapper_type_info->ConfigureWrapper(&global); |
| 79 map_.Set(key, std::move(global)); | 79 map_.Set(key, std::move(global)); |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void RemoveIfAny(KeyType* key) { |
| 84 if (ContainsKey(key)) |
| 85 map_.Remove(key); |
| 86 } |
| 87 |
| 83 void Clear() { map_.Clear(); } | 88 void Clear() { map_.Clear(); } |
| 84 | 89 |
| 85 void RemoveAndDispose(KeyType* key) { | 90 void RemoveAndDispose(KeyType* key) { |
| 86 DCHECK(ContainsKey(key)); | 91 DCHECK(ContainsKey(key)); |
| 87 map_.Remove(key); | 92 map_.Remove(key); |
| 88 } | 93 } |
| 89 | 94 |
| 90 void MarkWrapper(KeyType* object) { | 95 void MarkWrapper(KeyType* object) { |
| 91 map_.RegisterExternallyReferencedObject(object); | 96 map_.RegisterExternallyReferencedObject(object); |
| 92 } | 97 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); | 162 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); |
| 158 }; | 163 }; |
| 159 | 164 |
| 160 v8::Isolate* isolate_; | 165 v8::Isolate* isolate_; |
| 161 typename PersistentValueMapTraits::MapType map_; | 166 typename PersistentValueMapTraits::MapType map_; |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 } // namespace blink | 169 } // namespace blink |
| 165 | 170 |
| 166 #endif // DOMWrapperMap_h | 171 #endif // DOMWrapperMap_h |
| OLD | NEW |