| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 ASSERT(!m_registrationNodeKeepAlive); | 87 ASSERT(!m_registrationNodeKeepAlive); |
| 88 return; | 88 return; |
| 89 } | 89 } |
| 90 | 90 |
| 91 for (NodeHashSet::iterator iter = m_transientRegistrationNodes->begin(); ite
r != m_transientRegistrationNodes->end(); ++iter) | 91 for (NodeHashSet::iterator iter = m_transientRegistrationNodes->begin(); ite
r != m_transientRegistrationNodes->end(); ++iter) |
| 92 (*iter)->unregisterTransientMutationObserver(this); | 92 (*iter)->unregisterTransientMutationObserver(this); |
| 93 | 93 |
| 94 m_transientRegistrationNodes.clear(); | 94 m_transientRegistrationNodes.clear(); |
| 95 | 95 |
| 96 ASSERT(m_registrationNodeKeepAlive); | 96 ASSERT(m_registrationNodeKeepAlive); |
| 97 m_registrationNodeKeepAlive = 0; // Balanced in observeSubtreeNodeWillDetach
. | 97 m_registrationNodeKeepAlive = nullptr; // Balanced in observeSubtreeNodeWill
Detach. |
| 98 } | 98 } |
| 99 | 99 |
| 100 void MutationObserverRegistration::unregister() | 100 void MutationObserverRegistration::unregister() |
| 101 { | 101 { |
| 102 m_registrationNode->unregisterMutationObserver(this); | 102 m_registrationNode->unregisterMutationObserver(this); |
| 103 // The above line will cause this object to be deleted, so don't do any more
in this function. | 103 // The above line will cause this object to be deleted, so don't do any more
in this function. |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool MutationObserverRegistration::shouldReceiveMutationFrom(Node* node, Mutatio
nObserver::MutationType type, const QualifiedName* attributeName) const | 106 bool MutationObserverRegistration::shouldReceiveMutationFrom(Node* node, Mutatio
nObserver::MutationType type, const QualifiedName* attributeName) const |
| 107 { | 107 { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 124 void MutationObserverRegistration::addRegistrationNodesToSet(HashSet<Node*>& nod
es) const | 124 void MutationObserverRegistration::addRegistrationNodesToSet(HashSet<Node*>& nod
es) const |
| 125 { | 125 { |
| 126 nodes.add(m_registrationNode); | 126 nodes.add(m_registrationNode); |
| 127 if (!m_transientRegistrationNodes) | 127 if (!m_transientRegistrationNodes) |
| 128 return; | 128 return; |
| 129 for (NodeHashSet::const_iterator iter = m_transientRegistrationNodes->begin(
); iter != m_transientRegistrationNodes->end(); ++iter) | 129 for (NodeHashSet::const_iterator iter = m_transientRegistrationNodes->begin(
); iter != m_transientRegistrationNodes->end(); ++iter) |
| 130 nodes.add(iter->get()); | 130 nodes.add(iter->get()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace WebCore | 133 } // namespace WebCore |
| OLD | NEW |