[Webkit-unassigned] [Bug 137496] Add a microtask abstraction

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 8 09:10:54 PDT 2014


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





--- Comment #4 from Darin Adler <darin at apple.com>  2014-10-08 09:10:48 PST ---
(From update of attachment 239430)
View in context: https://bugs.webkit.org/attachment.cgi?id=239430&action=review

> Source/WebCore/dom/MicroTask.h:28
> +class MicroTask : public RefCounted<MicroTask> {

Why do these need to be reference counted? Can we use std::unique_ptr instead and use single ownership?

> Source/WebCore/dom/MicroTaskQueue.h:31
> +class MicroTaskQueue : public RefCounted<MicroTaskQueue> {

I don’t think we should use a reference-counted object just to hold a Vector. We should simply have the vector of tasks in Document itself. This level of indirection doesn’t help us. No need to have a class for this.

> Source/WebCore/dom/MicroTaskQueue.h:42
> +        for (auto task : m_tasks)
> +            task->run();
> +        m_tasks.clear();

What prevents this from being reentered, running the same task more than once?

-- 
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