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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Clear() { map_.Clear(); } | 83 void Clear() { map_.Clear(); } |
84 | 84 |
85 void RemoveAndDispose(KeyType* key) { | 85 void RemoveAndDispose(KeyType* key) { |
86 ASSERT(ContainsKey(key)); | 86 DCHECK(ContainsKey(key)); |
87 map_.Remove(key); | 87 map_.Remove(key); |
88 } | 88 } |
89 | 89 |
90 void MarkWrapper(KeyType* object) { | 90 void MarkWrapper(KeyType* object) { |
91 map_.RegisterExternallyReferencedObject(object); | 91 map_.RegisterExternallyReferencedObject(object); |
92 } | 92 } |
93 | 93 |
94 private: | 94 private: |
95 class PersistentValueMapTraits { | 95 class PersistentValueMapTraits { |
96 STATIC_ONLY(PersistentValueMapTraits); | 96 STATIC_ONLY(PersistentValueMapTraits); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); | 157 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType>&); |
158 }; | 158 }; |
159 | 159 |
160 v8::Isolate* isolate_; | 160 v8::Isolate* isolate_; |
161 typename PersistentValueMapTraits::MapType map_; | 161 typename PersistentValueMapTraits::MapType map_; |
162 }; | 162 }; |
163 | 163 |
164 } // namespace blink | 164 } // namespace blink |
165 | 165 |
166 #endif // DOMWrapperMap_h | 166 #endif // DOMWrapperMap_h |
OLD | NEW |