| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 m_nextSibling = child->nextSibling(); | 119 m_nextSibling = child->nextSibling(); |
| 120 | 120 |
| 121 m_removedNodes.append(child.release()); | 121 m_removedNodes.append(child.release()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ChildListMutationAccumulator::enqueueMutationRecord() | 124 void ChildListMutationAccumulator::enqueueMutationRecord() |
| 125 { | 125 { |
| 126 ASSERT(hasObservers()); | 126 ASSERT(hasObservers()); |
| 127 ASSERT(!isEmpty()); | 127 ASSERT(!isEmpty()); |
| 128 | 128 |
| 129 RefPtr<NodeList> addedNodes = StaticNodeList::adopt(m_addedNodes); | 129 RefPtrWillBeRawPtr<NodeList> addedNodes = StaticNodeList::adopt(m_addedNodes
); |
| 130 RefPtr<NodeList> removedNodes = StaticNodeList::adopt(m_removedNodes); | 130 RefPtrWillBeRawPtr<NodeList> removedNodes = StaticNodeList::adopt(m_removedN
odes); |
| 131 RefPtrWillBeRawPtr<MutationRecord> record = MutationRecord::createChildList(
m_target, addedNodes.release(), removedNodes.release(), m_previousSibling.releas
e(), m_nextSibling.release()); | 131 RefPtrWillBeRawPtr<MutationRecord> record = MutationRecord::createChildList(
m_target, addedNodes.release(), removedNodes.release(), m_previousSibling.releas
e(), m_nextSibling.release()); |
| 132 m_observers->enqueueMutationRecord(record.release()); | 132 m_observers->enqueueMutationRecord(record.release()); |
| 133 m_lastAdded = 0; | 133 m_lastAdded = 0; |
| 134 ASSERT(isEmpty()); | 134 ASSERT(isEmpty()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool ChildListMutationAccumulator::isEmpty() | 137 bool ChildListMutationAccumulator::isEmpty() |
| 138 { | 138 { |
| 139 bool result = m_removedNodes.isEmpty() && m_addedNodes.isEmpty(); | 139 bool result = m_removedNodes.isEmpty() && m_addedNodes.isEmpty(); |
| 140 #ifndef NDEBUG | 140 #ifndef NDEBUG |
| 141 if (result) { | 141 if (result) { |
| 142 ASSERT(!m_previousSibling); | 142 ASSERT(!m_previousSibling); |
| 143 ASSERT(!m_nextSibling); | 143 ASSERT(!m_nextSibling); |
| 144 ASSERT(!m_lastAdded); | 144 ASSERT(!m_lastAdded); |
| 145 } | 145 } |
| 146 #endif | 146 #endif |
| 147 return result; | 147 return result; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace WebCore | 150 } // namespace WebCore |
| OLD | NEW |