[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 18:42:28 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 5415e50a24c579469b309cce158e4dd46ebd9fc3
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 16 01:33:15 2010 +0000
2010-12-15 Alex Bredariol Grilo <abgrilo at profusion.mobi>
Reviewed by Eric Seidel.
[EFL] Fix timer calling time in SharedTimerEfl
No new features, so no tests added.
The usage of ecore_timer_loop_add instead of ecore_timer_add corrects
the problem that the timer is not called at the correct time. Since this
code runs in a single thread, all multiple thread operations were
removed.
* platform/efl/SharedTimerEfl.cpp:
(WebCore::stopSharedTimer):
(WebCore::addNewTimer):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index eebf8a3..c975816 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-12-15 Alex Bredariol Grilo <abgrilo at profusion.mobi>
+
+ Reviewed by Eric Seidel.
+
+ [EFL] Fix timer calling time in SharedTimerEfl
+
+ No new features, so no tests added.
+
+ The usage of ecore_timer_loop_add instead of ecore_timer_add corrects
+ the problem that the timer is not called at the correct time. Since this
+ code runs in a single thread, all multiple thread operations were
+ removed.
+
+ * platform/efl/SharedTimerEfl.cpp:
+ (WebCore::stopSharedTimer):
+ (WebCore::addNewTimer):
+
2010-12-15 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Ariya Hidayat.
diff --git a/WebCore/platform/efl/SharedTimerEfl.cpp b/WebCore/platform/efl/SharedTimerEfl.cpp
index 990d0c8..2534c60 100644
--- a/WebCore/platform/efl/SharedTimerEfl.cpp
+++ b/WebCore/platform/efl/SharedTimerEfl.cpp
@@ -30,25 +30,16 @@
#include "SharedTimer.h"
#include <Ecore.h>
-#include <pthread.h>
-#include <stdio.h>
#include <wtf/Assertions.h>
#include <wtf/CurrentTime.h>
#include <wtf/MainThread.h>
namespace WebCore {
-static pthread_mutex_t timerMutex = PTHREAD_MUTEX_INITIALIZER;
static Ecore_Timer *_sharedTimer = 0;
-static Ecore_Pipe *_pipe = 0;
static void (*_timerFunction)();
-struct timerOp {
- double time;
- unsigned char op; // 0 - add a timer; 1 - del a timer;
-};
-
void setSharedTimerFiredFunction(void (*func)())
{
_timerFunction = func;
@@ -64,58 +55,20 @@ static Eina_Bool timerEvent(void*)
return ECORE_CALLBACK_CANCEL;
}
-void processTimers(struct timerOp *tOp)
+void stopSharedTimer()
{
if (_sharedTimer) {
ecore_timer_del(_sharedTimer);
_sharedTimer = 0;
}
-
- if (tOp->op == 1)
- return;
-
- double interval = tOp->time - currentTime();
-
- if (interval <= ecore_animator_frametime_get()) {
- if (_timerFunction)
- _timerFunction();
- return;
- }
-
- _sharedTimer = ecore_timer_add(interval, timerEvent, 0);
-}
-
-void pipeHandlerCb(void *data, void *buffer, unsigned int nbyte)
-{
- ASSERT(nbyte == sizeof(struct timerOp));
-
- struct timerOp *tOp = (struct timerOp *)buffer;
- processTimers(tOp);
-}
-
-void stopSharedTimer()
-{
- struct timerOp tOp;
- pthread_mutex_lock(&timerMutex);
- if (!_pipe)
- _pipe = ecore_pipe_add(pipeHandlerCb, 0);
- pthread_mutex_unlock(&timerMutex);
-
- tOp.op = 1;
- ecore_pipe_write(_pipe, &tOp, sizeof(tOp));
}
void addNewTimer(double fireTime)
{
- struct timerOp tOp;
- pthread_mutex_lock(&timerMutex);
- if (!_pipe)
- _pipe = ecore_pipe_add(pipeHandlerCb, 0);
- pthread_mutex_unlock(&timerMutex);
+ double interval = fireTime - currentTime();
+ stopSharedTimer();
- tOp.time = fireTime;
- tOp.op = 0;
- ecore_pipe_write(_pipe, &tOp, sizeof(tOp));
+ _sharedTimer = ecore_timer_loop_add(interval, timerEvent, 0);
}
void setSharedTimerFireTime(double fireTime)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list