[Webkit-unassigned] [Bug 98270] [GTK][WK2] Add API to retrieve a snapshot from a webview

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 4 00:07:34 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=98270





--- Comment #5 from Carlos Garcia Campos <cgarcia at igalia.com>  2012-10-04 00:07:59 PST ---
(From update of attachment 166901)
View in context: https://bugs.webkit.org/attachment.cgi?id=166901&action=review

Looks great! good work :-)

>> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2638
>> +        data->snapshot = WKImageCreateCairoSurface(snapshot);
> 
> You probably want to use adoptRef here, since I'm assuming that WKImageCreateCairoSurface returns a new reference.

Don't use the C API, use toImpl(wkSnapshot)->bitmap()->createCairoSurface() that returns a PassRefPtr so you don't need to adopt it

>> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2673
>> + * Returns: a #cairo_surface_t with the retrieved snapshot
> 
> It makes sense to include a transfer annotation here and mention it specifically in the documentation. Right now you aren't returning a new reference, so if the user doesn't ref the result immediately it will be freed. I imagine this didn't cause a crash for you because of the leak above.

We should return a reference and use transfer full

> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:2675
> +cairo_surface_t* webkit_web_view_get_snapshot_finish(WebKitWebView* webView, GAsyncResult* result, GError **error)

GError **error -> GError** error

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list