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 28 matching lines...) Expand all Loading... |
39 namespace blink { | 39 namespace blink { |
40 | 40 |
41 // The accumulator map is used to make sure that there is only one mutation | 41 // The accumulator map is used to make sure that there is only one mutation |
42 // accumulator for a given node even if there are multiple | 42 // accumulator for a given node even if there are multiple |
43 // ChildListMutationScopes on the stack. The map is always empty when there are | 43 // ChildListMutationScopes on the stack. The map is always empty when there are |
44 // no ChildListMutationScopes on the stack. | 44 // no ChildListMutationScopes on the stack. |
45 typedef HeapHashMap<Member<Node>, Member<ChildListMutationAccumulator>> | 45 typedef HeapHashMap<Member<Node>, Member<ChildListMutationAccumulator>> |
46 AccumulatorMap; | 46 AccumulatorMap; |
47 | 47 |
48 static AccumulatorMap& accumulatorMap() { | 48 static AccumulatorMap& accumulatorMap() { |
| 49 ALLOW_UNSAFE_SINGLETON() |
49 DEFINE_STATIC_LOCAL(AccumulatorMap, map, (new AccumulatorMap)); | 50 DEFINE_STATIC_LOCAL(AccumulatorMap, map, (new AccumulatorMap)); |
50 return map; | 51 return map; |
51 } | 52 } |
52 | 53 |
53 ChildListMutationAccumulator::ChildListMutationAccumulator( | 54 ChildListMutationAccumulator::ChildListMutationAccumulator( |
54 Node* target, | 55 Node* target, |
55 MutationObserverInterestGroup* observers) | 56 MutationObserverInterestGroup* observers) |
56 : m_target(target), | 57 : m_target(target), |
57 m_lastAdded(nullptr), | 58 m_lastAdded(nullptr), |
58 m_observers(observers), | 59 m_observers(observers), |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 visitor->trace(m_target); | 154 visitor->trace(m_target); |
154 visitor->trace(m_removedNodes); | 155 visitor->trace(m_removedNodes); |
155 visitor->trace(m_addedNodes); | 156 visitor->trace(m_addedNodes); |
156 visitor->trace(m_previousSibling); | 157 visitor->trace(m_previousSibling); |
157 visitor->trace(m_nextSibling); | 158 visitor->trace(m_nextSibling); |
158 visitor->trace(m_lastAdded); | 159 visitor->trace(m_lastAdded); |
159 visitor->trace(m_observers); | 160 visitor->trace(m_observers); |
160 } | 161 } |
161 | 162 |
162 } // namespace blink | 163 } // namespace blink |
OLD | NEW |