| 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/dom/StaticNodeList.h" | 36 #include "core/dom/StaticNodeList.h" |
| 37 #include "wtf/HashMap.h" | 37 #include "wtf/HashMap.h" |
| 38 #include "wtf/StdLibExtras.h" | 38 #include "wtf/StdLibExtras.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 // The accumulator map is used to make sure that there is only one mutation | 42 // The accumulator map is used to make sure that there is only one mutation |
| 43 // accumulator for a given node even if there are multiple ChildListMutationScop
es | 43 // accumulator for a given node even if there are multiple ChildListMutationScop
es |
| 44 // on the stack. The map is always empty when there are no ChildListMutationScop
es | 44 // on the stack. The map is always empty when there are no ChildListMutationScop
es |
| 45 // on the stack. | 45 // on the stack. |
| 46 typedef WillBeHeapHashMap<RawPtrWillBeMember<Node>, RawPtrWillBeMember<ChildList
MutationAccumulator> > AccumulatorMap; | 46 typedef WillBeHeapHashMap<RawPtrWillBeMember<Node>, RawPtrWillBeMember<ChildList
MutationAccumulator>> AccumulatorMap; |
| 47 | 47 |
| 48 static AccumulatorMap& accumulatorMap() | 48 static AccumulatorMap& accumulatorMap() |
| 49 { | 49 { |
| 50 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<AccumulatorMap>, map, (adoptPtrWi
llBeNoop(new AccumulatorMap()))); | 50 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<AccumulatorMap>, map, (adoptPtrWi
llBeNoop(new AccumulatorMap()))); |
| 51 return *map; | 51 return *map; |
| 52 } | 52 } |
| 53 | 53 |
| 54 ChildListMutationAccumulator::ChildListMutationAccumulator(PassRefPtrWillBeRawPt
r<Node> target, PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> observers) | 54 ChildListMutationAccumulator::ChildListMutationAccumulator(PassRefPtrWillBeRawPt
r<Node> target, PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> observers) |
| 55 : m_target(target) | 55 : m_target(target) |
| 56 , m_lastAdded(nullptr) | 56 , m_lastAdded(nullptr) |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 visitor->trace(m_target); | 162 visitor->trace(m_target); |
| 163 visitor->trace(m_removedNodes); | 163 visitor->trace(m_removedNodes); |
| 164 visitor->trace(m_addedNodes); | 164 visitor->trace(m_addedNodes); |
| 165 visitor->trace(m_previousSibling); | 165 visitor->trace(m_previousSibling); |
| 166 visitor->trace(m_nextSibling); | 166 visitor->trace(m_nextSibling); |
| 167 visitor->trace(m_lastAdded); | 167 visitor->trace(m_lastAdded); |
| 168 visitor->trace(m_observers); | 168 visitor->trace(m_observers); |
| 169 } | 169 } |
| 170 | 170 |
| 171 } // namespace blink | 171 } // namespace blink |
| OLD | NEW |