RESOLVED FIXED 23560
Implement SharedTimer on WorkerRunLoop
https://bugs.webkit.org/show_bug.cgi?id=23560
Summary Implement SharedTimer on WorkerRunLoop
Dmitry Titov
Reported 2009-01-26 17:09:50 PST
This patch depends on 23488 which is not yet landed. It implements SharedTimer interface on WorkerRunLoop and initializes thread-specific copy of ThreadTimers for worker thread. Patch is coming.
Attachments
Proposed patch (5.06 KB, patch)
2009-01-26 17:48 PST, Dmitry Titov
no flags
Updated patch (5.62 KB, patch)
2009-01-27 13:44 PST, Dmitry Titov
no flags
Updated patch (5.69 KB, patch)
2009-01-28 17:58 PST, Dmitry Titov
ap: review+
Dmitry Titov
Comment 1 2009-01-26 17:48:37 PST
Created attachment 27060 [details] Proposed patch
Alexey Proskuryakov
Comment 2 2009-01-27 12:04:32 PST
+ class WorkerRunLoop : public SharedTimer { Is it really right to say that a run loop is an instance of SharedTimer? This results in awkward calls like runLoop.stop() that are difficult to interpret as being timer-related.
Darin Adler
Comment 3 2009-01-27 12:19:49 PST
(In reply to comment #2) > + class WorkerRunLoop : public SharedTimer { > > Is it really right to say that a run loop is an instance of SharedTimer? This > results in awkward calls like runLoop.stop() that are difficult to interpret as > being timer-related. In case it's not obvious, other options are to use private inheritance, or to have a shared timer as a data member.
Dmitry Titov
Comment 4 2009-01-27 12:25:55 PST
Thanks guys. I think having something like a ThreadSharedTimer as a member of WorkerRunLoop will remove those methods from the run loop itself. Updated patch is coming...
Dmitry Titov
Comment 5 2009-01-27 13:44:50 PST
Created attachment 27085 [details] Updated patch Removed SharedTimer implementation into a private class. WorkerRunLoop has an instance of it.
Mark Rowe (bdash)
Comment 6 2009-01-27 23:31:49 PST
Comment on attachment 27085 [details] Updated patch > - task->performTask(context); > + if (result == MessageQueueTerminated) > + break; > + else if (result == MessageQueueMessageReceived) > + task->performTask(context); > + else > + m_sharedTimer->fire(); You don't need an "else" after the "break".
Dmitry Titov
Comment 7 2009-01-28 17:58:30 PST
Created attachment 27135 [details] Updated patch Thanks Mark! Updated the patch.
Dmitry Titov
Comment 8 2009-02-02 08:21:51 PST
bug 23488 was resolved, this bug is not blocked anymore. Same patch.
Alexey Proskuryakov
Comment 9 2009-02-03 00:57:16 PST
Comment on attachment 27135 [details] Updated patch > + {} We usually put braces on separate lines in this context. > + bool isActive() { return m_sharedTimerFunction && m_nextFireTime != 0; } No need for "!= 0" here. r=me
Alexey Proskuryakov
Comment 10 2009-02-03 01:14:19 PST
Committed revision 40532. + * dom/WorkerRunLoop.h: + Add member of type OwnPtr<WorkerSharedTimer> A great comment says why a change was made, not what the change was. But I know that it's difficult to find something to say about trivial changes.
Alexey Proskuryakov
Comment 11 2009-02-03 01:19:08 PST
And committed JavaScriptCore parts in revision 40533.
Note You need to log in before you can comment on or make changes to this bug.