| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 : m_target(target), | 56 : m_target(target), |
| 57 m_lastAdded(nullptr), | 57 m_lastAdded(nullptr), |
| 58 m_observers(observers), | 58 m_observers(observers), |
| 59 m_mutationScopes(0) {} | 59 m_mutationScopes(0) {} |
| 60 | 60 |
| 61 void ChildListMutationAccumulator::leaveMutationScope() { | 61 void ChildListMutationAccumulator::leaveMutationScope() { |
| 62 DCHECK_GT(m_mutationScopes, 0u); | 62 DCHECK_GT(m_mutationScopes, 0u); |
| 63 if (!--m_mutationScopes) { | 63 if (!--m_mutationScopes) { |
| 64 if (!isEmpty()) | 64 if (!isEmpty()) |
| 65 enqueueMutationRecord(); | 65 enqueueMutationRecord(); |
| 66 accumulatorMap().remove(m_target.get()); | 66 accumulatorMap().erase(m_target.get()); |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 ChildListMutationAccumulator* ChildListMutationAccumulator::getOrCreate( | 70 ChildListMutationAccumulator* ChildListMutationAccumulator::getOrCreate( |
| 71 Node& target) { | 71 Node& target) { |
| 72 AccumulatorMap::AddResult result = accumulatorMap().add(&target, nullptr); | 72 AccumulatorMap::AddResult result = accumulatorMap().add(&target, nullptr); |
| 73 ChildListMutationAccumulator* accumulator; | 73 ChildListMutationAccumulator* accumulator; |
| 74 if (!result.isNewEntry) { | 74 if (!result.isNewEntry) { |
| 75 accumulator = result.storedValue->value; | 75 accumulator = result.storedValue->value; |
| 76 } else { | 76 } else { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 visitor->trace(m_target); | 153 visitor->trace(m_target); |
| 154 visitor->trace(m_removedNodes); | 154 visitor->trace(m_removedNodes); |
| 155 visitor->trace(m_addedNodes); | 155 visitor->trace(m_addedNodes); |
| 156 visitor->trace(m_previousSibling); | 156 visitor->trace(m_previousSibling); |
| 157 visitor->trace(m_nextSibling); | 157 visitor->trace(m_nextSibling); |
| 158 visitor->trace(m_lastAdded); | 158 visitor->trace(m_lastAdded); |
| 159 visitor->trace(m_observers); | 159 visitor->trace(m_observers); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace blink | 162 } // namespace blink |
| OLD | NEW |