| 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/PlatformEventDispatcher.h" | 5 #include "core/frame/PlatformEventDispatcher.h" |
| 6 | 6 |
| 7 #include "core/frame/PlatformEventController.h" | 7 #include "core/frame/PlatformEventController.h" |
| 8 #include "wtf/AutoReset.h" | 8 #include "wtf/AutoReset.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 if (!m_isListening) { | 25 if (!m_isListening) { |
| 26 startListening(); | 26 startListening(); |
| 27 m_isListening = true; | 27 m_isListening = true; |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 | 30 |
| 31 void PlatformEventDispatcher::removeController( | 31 void PlatformEventDispatcher::removeController( |
| 32 PlatformEventController* controller) { | 32 PlatformEventController* controller) { |
| 33 ASSERT(m_controllers.contains(controller)); | 33 ASSERT(m_controllers.contains(controller)); |
| 34 | 34 |
| 35 m_controllers.remove(controller); | 35 m_controllers.erase(controller); |
| 36 if (!m_isDispatching && m_controllers.isEmpty()) { | 36 if (!m_isDispatching && m_controllers.isEmpty()) { |
| 37 stopListening(); | 37 stopListening(); |
| 38 m_isListening = false; | 38 m_isListening = false; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 void PlatformEventDispatcher::notifyControllers() { | 42 void PlatformEventDispatcher::notifyControllers() { |
| 43 if (m_controllers.isEmpty()) | 43 if (m_controllers.isEmpty()) |
| 44 return; | 44 return; |
| 45 | 45 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 59 stopListening(); | 59 stopListening(); |
| 60 m_isListening = false; | 60 m_isListening = false; |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 | 63 |
| 64 DEFINE_TRACE(PlatformEventDispatcher) { | 64 DEFINE_TRACE(PlatformEventDispatcher) { |
| 65 visitor->trace(m_controllers); | 65 visitor->trace(m_controllers); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace blink | 68 } // namespace blink |
| OLD | NEW |