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

Side by Side Diff: third_party/WebKit/Source/core/dom/MutationObserver.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 159 }
160 160
161 void MutationObserver::observationEnded(MutationObserverRegistration* registrati on) 161 void MutationObserver::observationEnded(MutationObserverRegistration* registrati on)
162 { 162 {
163 ASSERT(m_registrations.contains(registration)); 163 ASSERT(m_registrations.contains(registration));
164 m_registrations.remove(registration); 164 m_registrations.remove(registration);
165 } 165 }
166 166
167 static MutationObserverSet& activeMutationObservers() 167 static MutationObserverSet& activeMutationObservers()
168 { 168 {
169 DEFINE_STATIC_LOCAL(Persistent<MutationObserverSet>, activeObservers, (new M utationObserverSet())); 169 DEFINE_STATIC_LOCAL(MutationObserverSet, activeObservers, (new MutationObser verSet));
170 return *activeObservers; 170 return activeObservers;
171 } 171 }
172 172
173 static MutationObserverSet& suspendedMutationObservers() 173 static MutationObserverSet& suspendedMutationObservers()
174 { 174 {
175 DEFINE_STATIC_LOCAL(Persistent<MutationObserverSet>, suspendedObservers, (ne w MutationObserverSet())); 175 DEFINE_STATIC_LOCAL(MutationObserverSet, suspendedObservers, (new MutationOb serverSet));
176 return *suspendedObservers; 176 return suspendedObservers;
177 } 177 }
178 178
179 static void activateObserver(RawPtr<MutationObserver> observer) 179 static void activateObserver(RawPtr<MutationObserver> observer)
180 { 180 {
181 if (activeMutationObservers().isEmpty()) 181 if (activeMutationObservers().isEmpty())
182 Microtask::enqueueMicrotask(WTF::bind(&MutationObserver::deliverMutation s)); 182 Microtask::enqueueMicrotask(WTF::bind(&MutationObserver::deliverMutation s));
183 183
184 activeMutationObservers().add(observer); 184 activeMutationObservers().add(observer);
185 } 185 }
186 186
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 { 271 {
272 #if ENABLE(OILPAN) 272 #if ENABLE(OILPAN)
273 visitor->trace(m_callback); 273 visitor->trace(m_callback);
274 visitor->trace(m_records); 274 visitor->trace(m_records);
275 visitor->trace(m_registrations); 275 visitor->trace(m_registrations);
276 visitor->trace(m_callback); 276 visitor->trace(m_callback);
277 #endif 277 #endif
278 } 278 }
279 279
280 } // namespace blink 280 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698