Chromium Code Reviews| Index: Source/core/frame/PlatformEventDispatcher.cpp |
| diff --git a/Source/core/frame/PlatformEventDispatcher.cpp b/Source/core/frame/PlatformEventDispatcher.cpp |
| index 397d7881752d3dd435ddd6410d8a191368f72f71..5ed4d87af28dcbcb787c21c39ce6249fe219e0f9 100644 |
| --- a/Source/core/frame/PlatformEventDispatcher.cpp |
| +++ b/Source/core/frame/PlatformEventDispatcher.cpp |
| @@ -16,10 +16,6 @@ PlatformEventDispatcher::PlatformEventDispatcher() |
| { |
| } |
| -PlatformEventDispatcher::~PlatformEventDispatcher() |
| -{ |
| -} |
| - |
| void PlatformEventDispatcher::addController(PlatformEventController* controller) |
| { |
| bool wasEmpty = m_controllers.isEmpty(); |
| @@ -84,4 +80,21 @@ void PlatformEventDispatcher::notifyControllers() |
| purgeControllers(); |
| } |
| +void PlatformEventDispatcher::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_controllers); |
|
haraken
2014/10/03 01:55:33
Why do you trace m_controllers? If we trace m_cont
sof
2014/10/03 05:05:29
It's a HeapVector<> of PlatformEventController* -
haraken
2014/10/03 05:36:01
Makes sense. Shall we add a comment?
sof
2014/10/03 06:34:04
Done.
I incorrectly assumed that PlatformEventCo
haraken
2014/10/03 10:10:56
Can we move DeviceSingleWindowEventController, Nav
sof
2014/10/03 10:27:11
NavigatorGamepad is a navigator supplement, so we
|
| + visitor->registerWeakMembers<PlatformEventDispatcher, &PlatformEventDispatcher::clearWeakMembers>(this); |
| +} |
| + |
| +void PlatformEventDispatcher::clearWeakMembers(Visitor* visitor) |
| +{ |
| + for (size_t i = 0; i < m_controllers.size(); ++i) { |
| + if (!visitor->isAlive(m_controllers[i])) { |
| + m_controllers[i] = nullptr; |
| + m_needsPurge = true; |
| + } |
| + } |
| + // Next notification will purge the empty slots. |
| +} |
| + |
| } // namespace blink |