[webkit-help] WebKit2 Thread Safety

Sami Wagiaalla swagiaal at redhat.com
Wed Apr 2 08:12:37 PDT 2014


Hello all,

I have written a WebKitExtension to handle custom JavaScript injection 
for the Eclipse SWT Browser, but I have run into the following deadlock 
scenario while running the test suite:

A new WebView is created in the UI process this requires some handling 
in the Web process which eventually sends a synchronous message to the 
UI process and blocks to wait for the reply. The message results in a 
"create" signal in the WebView which in Eclipse code is forwarded to 
observers. Now if an observer tries to do anything which results in an 
attempt to inject custom JS this is forwarded to the WebExtension which 
is blocked because the Web Process is blocked since the signal handler 
has not yet returned.

My questions are has anyone else run into this problem ? And if I were 
to create a thread in the extension to handle messages from the UI 
process would it be safe to call core API from a second thread. 
Specifically JS* functions.

Thanks a lot,
   Sami


More information about the webkit-help mailing list