Bug 66962 - WebCore or WTF RunLoop abstraction
Summary: WebCore or WTF RunLoop abstraction
Status: ASSIGNED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-25 11:19 PDT by Nat Duca
Modified: 2012-07-11 16:51 PDT (History)
10 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nat Duca 2011-08-25 11:19:03 PDT
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?
Comment 1 Anders Carlsson 2011-08-26 10:45:35 PDT
(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.
Comment 2 Sam Weinig 2011-08-26 10:51:16 PDT
> It would definitely be worth moving them down to either WebCore or even WTF.

The tentative plan is to move them to WTF.
Comment 3 Nat Duca 2011-08-26 10:52:33 PDT
(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?
Comment 4 Anders Carlsson 2011-08-26 10:53:35 PDT
(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.
Comment 5 Nat Duca 2011-08-26 10:55:34 PDT
Awesome. That sounds like a great building block... is there a bug for that that I should merge this into?