[Webkit-unassigned] [Bug 74535] [chromium] Add postCancellable[Delayed]Task to CCThread

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 14 17:26:33 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=74535





--- Comment #12 from Nat Duca <nduca at chromium.org>  2011-12-14 17:26:33 PST ---
Yes, and this timer implementation looks almost exactly like a cancellable task. Without having to implement the timer callback interface, rather instead piggybacking on our method binding system.

(In reply to comment #11)
> We don't want to use WebCore::Timer directly in our code - it's a dependency we don't want and the scheduling it uses is not good for our use. My suggestion was that you look at the API it uses and see if there are any interesting lessons.  The way it works is something like this:
> 
> class A {
>   void scheduleSomethingForLater()
>   void timerFired(Timer<A>*);
>   Timer<A> m_timer;
> };
> 
> A::A()
>   : m_timer(this, &A::timerFired) { }
> 
> A::scheduleSomethingForLater()
> {
>   m_timer.startOneShot(delay); // or startRepeating(), etc
> }
> 
> ~Timer cancels the task.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list