[webkit-help] webkit_web_view_load_uri from thread

Bharathwaaj S bluegenetic at gmail.com
Tue Apr 6 06:41:36 PDT 2010


Thank you for your reply.

This time I modified the code such that webkit_web_view_load_uri is not
called from the thread.

Now the thread's job is to get the uri from the message queue. Then it
modifies the uri entry box by inserting the new url and invokes a signal
manually as follows:

        g_signal_handlers_block_by_func (G_OBJECT



        gtk_editable_delete_text (GTK_EDITABLE(uri_entry), 0,

        gtk_editable_insert_text (GTK_EDITABLE(uri_entry), buf.mtext,

        g_signal_handlers_unblock_by_func (G_OBJECT


        g_signal_emit_by_name(uri_entry, "activate");

This will invoke the activate_uri_entry_cb and I could get the callback. But
still I face the same issue. The same when entered from the url bar in
toolbar doesn't crash. Is there any other solution other than android?
Currently webkit runs in a separate thread and I need to have interaction
between the main process and the webkit thread.

Kind regards,

On Mon, Apr 5, 2010 at 4:29 PM, zaheer ahmad <zaheer.mot at gmail.com> wrote:

> hi,
> webkit is not thread safe so you should not be calling apis from other
> thread.. if you really want parallelism try the way android is designed and
> adapt it to gtk.. making gtk (+ all other libs in the linux world) work in a
> threaded enviornment is a big challenge..
> regards,
> Zaheer
> On Mon, Apr 5, 2010 at 4:22 PM, Bharathwaaj S <bluegenetic at gmail.com>wrote:
>> Hi,
>> In Gtk Webkit, can we call webkit_web_view_load_uri from another thread?
>> In GtkLauncher, I created a thread before calling gtk_main. This thread
>> waits in a message queue for urls. From another terminal, I pass the urls to
>> that message queue.
>> I tried passing http://1.com, http://2.com. First time it detected that
>> it couldn't resolve host name and gave error page.
>> The second time if i pass http://1.com or http://2.com, it crashes. I
>> GDBed the same and found that it is crashing in
>> WebCore/platform/text/AtomicString.cpp in WebCore::CStringTranslator::equal
>> (r=0xb3c81f78, s=0x14c9d2e "User-Agent")
>> The pointer to m_data from the StringImpl class which is assigned to
>> UChar* d  is corrupted and hence causing crash.
>> The same when entered from the url bar in toolbar doesn't crash. Any ideas
>> on why is it so?
>> Kind regards,
>> Bharath
>> http://amusingsilhouettes.blogspot.com
>> _______________________________________________
>> webkit-help mailing list
>> webkit-help at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100406/058349c1/attachment-0001.html>

More information about the webkit-help mailing list