[webkit-dev] NetworkProcess / NetworkThread in the UIProcess

Balazs Kelemen kbalazs at webkit.org
Tue Feb 12 08:01:21 PST 2013


On 02/12/2013 04:51 PM, Zeno Albisser wrote:
> Hi,
>
> I have been looking into the NetworkProcess code that has recently 
> been added to WebKit2. For Qt we are considering moving all the 
> networking into a separate thread within the UIProcess.
>
> Do you guys think that the NetworkProcess code could be designed in a 
> way to allow running in a separate thread of the UIProcess instead of 
> in a separate process?
> We are convinced that this design would be a very good fit for our 
> needs. Also in the light of the currently ongoing effort of cleaning 
> up our Qt-bits and pieces in WebKit2.
>
> After a quick look it seems to me that this could be achieved with 
> fairly minor modifications:
>
> * Instead of relying on RunLoop::main() within NetworkProcess, a 
> different function would need to be introduced to retrieve a 
> "networking RunLoop". This would allow to process networking related 
> events in the network thread. Depending on the platform, this could of 
> course return a pointer to the main-RunLoop, for the cases where 
> networking is indeed executed in a separate process.
>
> * Splitting the NetworkProcess class in two pieces. The child process 
> and IPC setup remaining in NetworkProcess, and the actual networking 
> code in a separate class (e.g. called NetworkThread).
> Provided the IPC (between threads in our case) would be setup upfront 
> this would allow running the code provided by NetworkThread in a 
> separate thread.

You also need IPC because the NetworkProcess serves the needs of the web 
process. Could you describe why a network thread in the UI process fit 
your needs bettter? Is it to support API's related to networking or does 
it have other advantages?

-kbalazs



More information about the webkit-dev mailing list