Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / events / EventSender.h
index f07678f..5d06fdd 100644 (file)
@@ -30,7 +30,7 @@
 #include "wtf/Vector.h"
 #include "wtf/text/AtomicString.h"
 
-namespace WebCore {
+namespace blink {
 
 template<typename T> class EventSender {
     WTF_MAKE_NONCOPYABLE(EventSender); WTF_MAKE_FAST_ALLOCATED;
@@ -42,7 +42,7 @@ public:
     void cancelEvent(T*);
     void dispatchPendingEvents();
 
-#ifndef NDEBUG
+#if ENABLE(ASSERT)
     bool hasPendingEvents(T* sender) const
     {
         return m_dispatchSoonList.find(sender) != kNotFound || m_dispatchingList.find(sender) != kNotFound;
@@ -50,12 +50,12 @@ public:
 #endif
 
 private:
-    void timerFired(Timer<EventSender<T> >*) { dispatchPendingEvents(); }
+    void timerFired(Timer<EventSender<T>>*) { dispatchPendingEvents(); }
 
     AtomicString m_eventType;
-    Timer<EventSender<T> > m_timer;
-    Vector<T*> m_dispatchSoonList;
-    Vector<T*> m_dispatchingList;
+    Timer<EventSender<T>> m_timer;
+    WillBePersistentHeapVector<RawPtrWillBeMember<T>> m_dispatchSoonList;
+    WillBePersistentHeapVector<RawPtrWillBeMember<T>> m_dispatchingList;
 };
 
 template<typename T> EventSender<T>::EventSender(const AtomicString& eventType)
@@ -68,7 +68,7 @@ template<typename T> void EventSender<T>::dispatchEventSoon(T* sender)
 {
     m_dispatchSoonList.append(sender);
     if (!m_timer.isActive())
-        m_timer.startOneShot(0);
+        m_timer.startOneShot(0, FROM_HERE);
 }
 
 template<typename T> void EventSender<T>::cancelEvent(T* sender)
@@ -78,12 +78,12 @@ template<typename T> void EventSender<T>::cancelEvent(T* sender)
     size_t size = m_dispatchSoonList.size();
     for (size_t i = 0; i < size; ++i) {
         if (m_dispatchSoonList[i] == sender)
-            m_dispatchSoonList[i] = 0;
+            m_dispatchSoonList[i] = nullptr;
     }
     size = m_dispatchingList.size();
     for (size_t i = 0; i < size; ++i) {
         if (m_dispatchingList[i] == sender)
-            m_dispatchingList[i] = 0;
+            m_dispatchingList[i] = nullptr;
     }
 }
 
@@ -101,13 +101,13 @@ template<typename T> void EventSender<T>::dispatchPendingEvents()
     size_t size = m_dispatchingList.size();
     for (size_t i = 0; i < size; ++i) {
         if (T* sender = m_dispatchingList[i]) {
-            m_dispatchingList[i] = 0;
+            m_dispatchingList[i] = nullptr;
             sender->dispatchPendingEvent(this);
         }
     }
     m_dispatchingList.clear();
 }
 
-} // namespace WebCore
+} // namespace blink
 
 #endif // EventSender_h