Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/DOMWrapperMap.h

Issue 1876383003: Introduce infrastructure for tracing ScriptWrappables. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix var used only in assert Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { 86 {
87 m_map.Clear(); 87 m_map.Clear();
88 } 88 }
89 89
90 void removeAndDispose(KeyType* key) 90 void removeAndDispose(KeyType* key)
91 { 91 {
92 ASSERT(containsKey(key)); 92 ASSERT(containsKey(key));
93 m_map.Remove(key); 93 m_map.Remove(key);
94 } 94 }
95 95
96 void markWrapper(KeyType* object)
97 {
98 m_map.RegisterExternallyReferencedObject(object);
99 }
100
96 private: 101 private:
97 class PersistentValueMapTraits { 102 class PersistentValueMapTraits {
98 STATIC_ONLY(PersistentValueMapTraits); 103 STATIC_ONLY(PersistentValueMapTraits);
99 public: 104 public:
100 // Map traits: 105 // Map traits:
101 typedef HashMap<KeyType*, v8::PersistentContainerValue> Impl; 106 typedef HashMap<KeyType*, v8::PersistentContainerValue> Impl;
102 typedef typename Impl::iterator Iterator; 107 typedef typename Impl::iterator Iterator;
103 static size_t Size(const Impl* impl) { return impl->size(); } 108 static size_t Size(const Impl* impl) { return impl->size(); }
104 static bool Empty(Impl* impl) { return impl->isEmpty(); } 109 static bool Empty(Impl* impl) { return impl->isEmpty(); }
105 static void Swap(Impl& impl, Impl& other) { impl.swap(other); } 110 static void Swap(Impl& impl, Impl& other) { impl.swap(other); }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType> &); 161 static void DisposeWeak(const v8::WeakCallbackInfo<WeakCallbackDataType> &);
157 }; 162 };
158 163
159 v8::Isolate* m_isolate; 164 v8::Isolate* m_isolate;
160 typename PersistentValueMapTraits::MapType m_map; 165 typename PersistentValueMapTraits::MapType m_map;
161 }; 166 };
162 167
163 } // namespace blink 168 } // namespace blink
164 169
165 #endif // DOMWrapperMap_h 170 #endif // DOMWrapperMap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698