RESOLVED FIXED Bug 23976
MessageQueue needs a way to wait for a message that satisfies an arbitrary criteria.
https://bugs.webkit.org/show_bug.cgi?id=23976
Summary MessageQueue needs a way to wait for a message that satisfies an arbitrary cr...
David Levin
Reported 2009-02-16 11:34:08 PST
Needs patch.
Attachments
Patch for bug. (2.84 KB, patch)
2009-02-16 11:39 PST, David Levin
no flags
Part 1: Change MessageQueue to be linked list based. (6.76 KB, patch)
2009-02-18 10:18 PST, David Levin
no flags
Proposed fix. (3.79 KB, patch)
2009-02-18 18:46 PST, David Levin
ap: review+
David Levin
Comment 1 2009-02-16 11:39:52 PST
Created attachment 27703 [details] Patch for bug.
David Levin
Comment 2 2009-02-17 01:38:24 PST
Comment on attachment 27703 [details] Patch for bug. As ap suggested, I should change MessageQueue to be linked list based.
David Levin
Comment 3 2009-02-18 10:18:55 PST
Created attachment 27754 [details] Part 1: Change MessageQueue to be linked list based.
David Levin
Comment 4 2009-02-18 10:41:29 PST
Comment on attachment 27754 [details] Part 1: Change MessageQueue to be linked list based. ok, maybe not a linked list for now.
David Levin
Comment 5 2009-02-18 10:42:13 PST
Comment on attachment 27703 [details] Patch for bug. We'll try this one to start with.
David Levin
Comment 6 2009-02-18 11:39:17 PST
Comment on attachment 27703 [details] Patch for bug. I'll consider a functor approach instead of a virtual method callback.
David Levin
Comment 7 2009-02-18 18:46:40 PST
Created attachment 27773 [details] Proposed fix.
Alexey Proskuryakov
Comment 8 2009-02-19 02:45:34 PST
Comment on attachment 27773 [details] Proposed fix. r=me > + inline DequeIterator<T> Deque<T>::findIf(Predicate predicate) > + { > + for (iterator it = begin(); it != end(); ++it) { If may be better to make compiler's life easier, and precompute end(). > + if ((*predicate)(*it)) Shouldn't this be "predicate(*it)"? > + return it; > + } > + return end(); > + } + MessageQueueWaitResult waitForMessageFiltered(DataType&, Predicate); MessageQueueWaitResult waitForMessageTimed(DataType&, double absoluteTime); Have you verified that timers do not fire in Firefox when waiting for a sync XHR in a worker?
David Levin
Comment 9 2009-02-19 11:47:11 PST
> Have you verified that timers do not fire in Firefox when waiting for a sync XHR in a worker? Not yet. But I'll look into adding a method to do that to reduce duplicate code in this class. Commited as r41081.
Note You need to log in before you can comment on or make changes to this bug.