[webkit-gtk] WebKit2 GTK+ API

Carlos Garcia Campos cgarcia at igalia.com
Thu Sep 15 12:27:59 PDT 2011


El Thu, 15 Sep 2011 12:17:09 -0700
Martin Robinson <mrobinson at webkit.org> escribió:
> On Thu, Sep 15, 2011 at 12:13 PM, Carlos Garcia Campos
> <cgarcia at igalia.com> wrote:
> 
> > load_uri_finish() returns the result of the async operation using
> > the GAsyncResult passed to the async ready callback, see:
> >
> > http://developer.gnome.org/gio/stable/GAsyncResult.html#GAsyncResult.description
> 
> I guess my thought was that if the result of the load was going to be
> exposed as properties on the WebView, maybe that duplication isn't
> necessary. Or did you mean above that progress would be a property,
> but errors would not be?

Yes, we leave progress and load-status properties, and add:

webkit_web_view_load_uri(WebKitWebView *view, 
                         const gchar *uri, 
                         GCancellable *cancellable, 
                         GAsyncReadyCallabck finished_callback, 
                         gpointer user_data);

The operation is finished when async ready callback is called no matter
whether it was successful or not, or even cancelled. In the async ready
callback you do something like:

if (!webkit_web_view_load_uri_finish(view, result, &error)) {
    g_print ("An error ocurred during loading: %s\n", error->message);
    g_error_free (error);
}


> --Martin
> 



-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20110915/d63ad8f7/attachment.bin>


More information about the webkit-gtk mailing list