Changeset 142454 in webkit
- Timestamp:
- Feb 11, 2013 4:44:34 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r142434 r142454 1 2013-02-11 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 [EFL] Stop using smart pointers for Ecore_Timer 4 https://bugs.webkit.org/show_bug.cgi?id=109409 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Remove support in OwnPtr for EFL's Ecore_Timer. It is a bad idea to use 9 OwnPtr for Ecore_Timer because the timer handle may become invalid. 10 11 * wtf/OwnPtrCommon.h: 12 (WTF): 13 * wtf/efl/OwnPtrEfl.cpp: 14 1 15 2013-02-11 Abhishek Arya <inferno@chromium.org> 2 16 -
trunk/Source/WTF/wtf/OwnPtrCommon.h
r138326 r142454 46 46 typedef struct _Eina_Module Eina_Module; 47 47 #if USE(EO) 48 typedef struct _Eo Ecore_Timer;49 48 typedef struct _Eo Evas_Object; 50 49 #else 51 typedef struct _Ecore_Timer Ecore_Timer;52 50 typedef struct _Evas_Object Evas_Object; 53 51 #endif … … 80 78 WTF_EXPORT_PRIVATE void deleteOwnedPtr(Ecore_IMF_Context*); 81 79 WTF_EXPORT_PRIVATE void deleteOwnedPtr(Ecore_Pipe*); 82 WTF_EXPORT_PRIVATE void deleteOwnedPtr(Ecore_Timer*);83 80 WTF_EXPORT_PRIVATE void deleteOwnedPtr(Eina_Hash*); 84 81 WTF_EXPORT_PRIVATE void deleteOwnedPtr(Eina_Module*); -
trunk/Source/WTF/wtf/efl/OwnPtrEfl.cpp
r133041 r142454 64 64 } 65 65 66 void deleteOwnedPtr(Ecore_Timer* ptr)67 {68 if (ptr)69 ecore_timer_del(ptr);70 }71 72 66 void deleteOwnedPtr(Ecore_IMF_Context* ptr) 73 67 { -
trunk/Source/WebCore/ChangeLog
r142452 r142454 1 2013-02-11 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 [EFL] Stop using smart pointers for Ecore_Timer 4 https://bugs.webkit.org/show_bug.cgi?id=109409 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Stop using a smart pointer for Ecore_Timer in RunLoop::TimerBase. This 9 is a bad idea because the timer handle becomes invalid as soon as the 10 timer callback returns ECORE_CALLBACK_CANCEL. This may lead to crashes 11 on destruction because OwnPtr calls ecore_timer_del() on an invalid 12 handle. 13 14 No new tests, already covered by exiting tests. 15 16 * platform/RunLoop.h: 17 (TimerBase): 18 * platform/efl/RunLoopEfl.cpp: 19 (WebCore::RunLoop::TimerBase::timerFired): 20 (WebCore::RunLoop::TimerBase::start): 21 (WebCore::RunLoop::TimerBase::stop): 22 1 23 2013-02-11 Vladislav Kaznacheev <kaznacheev@chromium.org> 2 24 -
trunk/Source/WebCore/platform/RunLoop.h
r139985 r142454 106 106 #elif PLATFORM(EFL) 107 107 static bool timerFired(void* data); 108 OwnPtr<Ecore_Timer>m_timer;108 Ecore_Timer* m_timer; 109 109 bool m_isRepeating; 110 110 #endif -
trunk/Source/WebCore/platform/efl/RunLoopEfl.cpp
r142087 r142454 87 87 88 88 RunLoop::TimerBase::TimerBase(RunLoop*) 89 : m_isRepeating(false) 89 : m_timer(0) 90 , m_isRepeating(false) 90 91 { 91 92 } … … 103 104 104 105 if (!timer->m_isRepeating) { 105 timer->m_timer = nullptr;106 timer->m_timer = 0; 106 107 return ECORE_CALLBACK_CANCEL; 107 108 } … … 112 113 void RunLoop::TimerBase::start(double nextFireInterval, bool repeat) 113 114 { 115 if (isActive()) 116 stop(); 117 114 118 m_isRepeating = repeat; 115 m_timer = adoptPtr(ecore_timer_add(nextFireInterval, reinterpret_cast<Ecore_Task_Cb>(timerFired), this)); 119 ASSERT(!m_timer); 120 m_timer = ecore_timer_add(nextFireInterval, reinterpret_cast<Ecore_Task_Cb>(timerFired), this); 116 121 } 117 122 118 123 void RunLoop::TimerBase::stop() 119 124 { 120 m_timer = nullptr; 125 if (m_timer) { 126 ecore_timer_del(m_timer); 127 m_timer = 0; 128 } 121 129 } 122 130
Note: See TracChangeset
for help on using the changeset viewer.