| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/EventHandlerRegistry.h" | 5 #include "core/frame/EventHandlerRegistry.h" |
| 6 | 6 |
| 7 #include "core/events/EventListenerOptions.h" | 7 #include "core/events/EventListenerOptions.h" |
| 8 #include "core/events/EventUtil.h" | 8 #include "core/events/EventUtil.h" |
| 9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 } else { | 97 } else { |
| 98 ASSERT(op == Remove || op == RemoveAll); | 98 ASSERT(op == Remove || op == RemoveAll); |
| 99 ASSERT(op == RemoveAll || targets->contains(target)); | 99 ASSERT(op == RemoveAll || targets->contains(target)); |
| 100 | 100 |
| 101 if (op == RemoveAll) { | 101 if (op == RemoveAll) { |
| 102 if (!targets->contains(target)) | 102 if (!targets->contains(target)) |
| 103 return false; | 103 return false; |
| 104 targets->removeAll(target); | 104 targets->removeAll(target); |
| 105 } else { | 105 } else { |
| 106 if (!targets->remove(target)) { | 106 if (!targets->erase(target)) { |
| 107 // Just decremented refcount, no real update. | 107 // Just decremented refcount, no real update. |
| 108 return false; | 108 return false; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 } | 111 } |
| 112 return true; | 112 return true; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void EventHandlerRegistry::updateEventHandlerInternal( | 115 void EventHandlerRegistry::updateEventHandlerInternal( |
| 116 ChangeOperation op, | 116 ChangeOperation op, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // its handlers properly. | 323 // its handlers properly. |
| 324 DCHECK(window->frame()); | 324 DCHECK(window->frame()); |
| 325 DCHECK(window->frame()->page()); | 325 DCHECK(window->frame()->page()); |
| 326 DCHECK(window->frame()->page() == m_page); | 326 DCHECK(window->frame()->page() == m_page); |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 #endif // DCHECK_IS_ON() | 329 #endif // DCHECK_IS_ON() |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace blink | 332 } // namespace blink |
| OLD | NEW |