| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 m_transientRegistrationNodes.clear(); | 102 m_transientRegistrationNodes.clear(); |
| 103 | 103 |
| 104 DCHECK(m_registrationNodeKeepAlive); | 104 DCHECK(m_registrationNodeKeepAlive); |
| 105 m_registrationNodeKeepAlive = | 105 m_registrationNodeKeepAlive = |
| 106 nullptr; // Balanced in observeSubtreeNodeWillDetach. | 106 nullptr; // Balanced in observeSubtreeNodeWillDetach. |
| 107 } | 107 } |
| 108 | 108 |
| 109 void MutationObserverRegistration::unregister() { | 109 void MutationObserverRegistration::unregister() { |
| 110 DCHECK(m_registrationNode); | 110 DCHECK(m_registrationNode); |
| 111 m_registrationNode->unregisterMutationObserver(this); | 111 m_registrationNode->unregisterMutationObserver(this); |
| 112 // The above line will cause this object to be deleted, so don't do any more i
n this function. | 112 // The above line will cause this object to be deleted, so don't do any more |
| 113 // in this function. |
| 113 } | 114 } |
| 114 | 115 |
| 115 bool MutationObserverRegistration::shouldReceiveMutationFrom( | 116 bool MutationObserverRegistration::shouldReceiveMutationFrom( |
| 116 Node& node, | 117 Node& node, |
| 117 MutationObserver::MutationType type, | 118 MutationObserver::MutationType type, |
| 118 const QualifiedName* attributeName) const { | 119 const QualifiedName* attributeName) const { |
| 119 DCHECK((type == MutationObserver::Attributes && attributeName) || | 120 DCHECK((type == MutationObserver::Attributes && attributeName) || |
| 120 !attributeName); | 121 !attributeName); |
| 121 if (!(m_options & type)) | 122 if (!(m_options & type)) |
| 122 return false; | 123 return false; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 150 visitor->trace(m_registrationNode); | 151 visitor->trace(m_registrationNode); |
| 151 visitor->trace(m_registrationNodeKeepAlive); | 152 visitor->trace(m_registrationNodeKeepAlive); |
| 152 visitor->trace(m_transientRegistrationNodes); | 153 visitor->trace(m_transientRegistrationNodes); |
| 153 } | 154 } |
| 154 | 155 |
| 155 DEFINE_TRACE_WRAPPERS(MutationObserverRegistration) { | 156 DEFINE_TRACE_WRAPPERS(MutationObserverRegistration) { |
| 156 visitor->traceWrappers(m_observer); | 157 visitor->traceWrappers(m_observer); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } // namespace blink | 160 } // namespace blink |
| OLD | NEW |