Changeset 89697 in webkit


Ignore:
Timestamp:
Jun 24, 2011 12:49:28 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-24 Henry Song <hsong@sisa.samsung.com>

Reviewed by Martin Robinson.

Correct _sharedTimer value in SharedTimerEfl.cpp
https://bugs.webkit.org/show_bug.cgi?id=62380

SharedTimerEfl.cpp set _sharedTimer = 0 is incorrect in
timerEvent(), we have observed addNewTimer() can be triggered
by either inside timerFunction() or others that are not within
timerFunction(). We have observed the following case:

  1. add a new Timer within timerFunction()
  2. timerFunction returns, set _sharedTimer = 0
  3. addNewTimer() is triggered again within webkit, don't know it triggers this.
  4. because at this moment, _sharedTimer == 0, the previous registered timer (in step 1) did not get removed.
  5. Now in ecore_timer, there are two timers with same callbacks
  6. From now on, timerFunction() will be called twice back-to-back in each ecore_timer loop. To correct this, we should set _sharedTimer = 0 before timerFunction() so that when addNewTimer() triggered within, we have a valid timer object.
  • platform/efl/SharedTimerEfl.cpp: (WebCore::timerEvent):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89694 r89697  
     12011-06-24  Henry Song  <hsong@sisa.samsung.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        Correct _sharedTimer value in SharedTimerEfl.cpp
     6        https://bugs.webkit.org/show_bug.cgi?id=62380
     7
     8        SharedTimerEfl.cpp set _sharedTimer = 0 is incorrect in
     9        timerEvent(), we have observed addNewTimer() can be triggered
     10        by either inside timerFunction() or others that are not within
     11        timerFunction().  We have observed the following case:
     12        1. add a new Timer within timerFunction()
     13        2. timerFunction returns, set _sharedTimer = 0
     14        3. addNewTimer() is triggered again within webkit, don't know
     15           it triggers this.
     16        4. because at this moment, _sharedTimer == 0, the previous
     17           registered timer (in step 1) did not get removed.
     18        5. Now in ecore_timer, there are two timers with same callbacks
     19        6. From now on, timerFunction() will be called twice back-to-back
     20           in each ecore_timer loop.
     21        To correct this, we should set _sharedTimer = 0 before
     22        timerFunction() so that when addNewTimer() triggered within,
     23        we have a valid timer object.
     24
     25        * platform/efl/SharedTimerEfl.cpp:
     26        (WebCore::timerEvent):
     27
    1282011-05-17  Nat Duca  <nduca@chromium.org>
    229
  • trunk/Source/WebCore/platform/efl/SharedTimerEfl.cpp

    r74167 r89697  
    4848static Eina_Bool timerEvent(void*)
    4949{
     50    _sharedTimer = 0;
    5051    if (_timerFunction)
    5152        _timerFunction();
    52 
    53     _sharedTimer = 0;
    5453
    5554    return ECORE_CALLBACK_CANCEL;
Note: See TracChangeset for help on using the changeset viewer.