OLD | NEW |
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 Loading... |
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(MutationObserverSet, activeObservers, (new MutationObser
verSet)); | 169 DEFINE_STATIC_LOCAL(Persistent<MutationObserverSet>, activeObservers, (new M
utationObserverSet())); |
170 return activeObservers; | 170 return *activeObservers; |
171 } | 171 } |
172 | 172 |
173 static MutationObserverSet& suspendedMutationObservers() | 173 static MutationObserverSet& suspendedMutationObservers() |
174 { | 174 { |
175 DEFINE_STATIC_LOCAL(MutationObserverSet, suspendedObservers, (new MutationOb
serverSet)); | 175 DEFINE_STATIC_LOCAL(Persistent<MutationObserverSet>, suspendedObservers, (ne
w MutationObserverSet())); |
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 Loading... |
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 |
OLD | NEW |