Bug 66962
Summary: | WebCore or WTF RunLoop abstraction | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nat Duca <nduca> |
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
Status: | ASSIGNED | ||
Severity: | Normal | CC: | andersca, ap, dimich, enne, jamesr, jbates, levin, nduca, sam, skyul |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Nat Duca
WK2 and Chromium both have embedder-specific abstractions for a thread that runs tasks, e.g.
- WebKit2/platform/RunLoop.h
- WebKit/chromium/public/WebThread.h
I'm wondering if we should have a generalized version of these abstractions available in WebCore.
Two systems that could be refactored to use this:
- WebCore/fileapi/FileThread
- WebCore/platform/chromium/CCThread
Are there other use cases? Should we actually do this?
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Anders Carlsson
(In reply to comment #0)
> WK2 and Chromium both have embedder-specific abstractions for a thread that runs tasks, e.g.
> - WebKit2/platform/RunLoop.h
> - WebKit/chromium/public/WebThread.h
>
> I'm wondering if we should have a generalized version of these abstractions available in WebCore.
>
> Two systems that could be refactored to use this:
> - WebCore/fileapi/FileThread
> - WebCore/platform/chromium/CCThread
>
> Are there other use cases? Should we actually do this?
FWIW, the WebKit2 RunLoop class is just a platform abstraction for a system run loop. We also have a WorkQueue class which is a light-weight thread (on OS X it's actually a libdispatch queue) that can run tasks.
It would definitely be worth moving them down to either WebCore or even WTF.
Sam Weinig
> It would definitely be worth moving them down to either WebCore or even WTF.
The tentative plan is to move them to WTF.
Nat Duca
(In reply to comment #2)
> > It would definitely be worth moving them down to either WebCore or even WTF.
>
> The tentative plan is to move them to WTF.
Cool. To ask a dumb question, can you have run loops for things != the main thread in the Wk2 abstraction?
Anders Carlsson
(In reply to comment #3)
> (In reply to comment #2)
> > > It would definitely be worth moving them down to either WebCore or even WTF.
> >
> > The tentative plan is to move them to WTF.
>
>
> Cool. To ask a dumb question, can you have run loops for things != the main thread in the Wk2 abstraction?
Yes, the run loop objects are allocated in thread-specific storage.
Nat Duca
Awesome. That sounds like a great building block... is there a bug for that that I should merge this into?