Bug 111938

Summary: [GTK] Add webkit_web_page_get_id() to WebKit2 GTK+ API
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, benjamin, gns, gyuyoung.kim, mrobinson, rakuco, webkit.review.bot, xan.lopez
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch andersca: review+

Description Carlos Garcia Campos 2013-03-10 08:34:22 PDT
Add API to the web extensions API to get the identifier of a web page.
Comment 1 Carlos Garcia Campos 2013-03-10 08:36:38 PDT
Created attachment 192375 [details]
Patch
Comment 2 Carlos Garcia Campos 2013-03-10 08:37:18 PDT
Adding webkit2 owners to CC
Comment 3 WebKit Review Bot 2013-03-10 08:41:00 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 4 Benjamin Poulain 2013-03-10 14:08:20 PDT
Comment on attachment 192375 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=192375&action=review

> Source/WebKit2/ChangeLog:9
> +        Add API to the web extensions API to get the identifier of a web
> +        page.

What for?
Comment 5 Carlos Garcia Campos 2013-03-11 00:59:05 PDT
(In reply to comment #4)
> (From update of attachment 192375 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=192375&action=review
> 
> > Source/WebKit2/ChangeLog:9
> > +        Add API to the web extensions API to get the identifier of a web
> > +        page.
> 
> What for?

To be able to match the page id of a WebKitWebView (UI process), we have webkit_web_view_get_page_id(), but it's not possible to know the id of a given WebKitWebPage (Web process)
Comment 6 Carlos Garcia Campos 2013-04-15 00:46:34 PDT
Ping owners, this is trivial patch.
Comment 7 Anders Carlsson 2013-04-15 10:49:03 PDT
Comment on attachment 192375 [details]
Patch

I don’t think it’s a good idea to expose identifiers in the API like this, and I think the webkit_web_view_get_page_id() function should be removed. Why is it needed at all?
Comment 8 Carlos Garcia Campos 2013-04-15 10:55:03 PDT
(In reply to comment #7)
> (From update of attachment 192375 [details])
> I don’t think it’s a good idea to expose identifiers in the API like this, and I think the webkit_web_view_get_page_id() function should be removed. Why is it needed at all?

Because in our web process extension system we haven't exposed any communication API, we use the injected bundle custom messages for internal communication, but we leave the apps to use whatever they want to communicate their web process extensions with their UI process. So, we need a way to match a page from UI and Web processes.
Comment 9 Carlos Garcia Campos 2013-04-16 10:24:56 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > (From update of attachment 192375 [details] [details])
> > I don’t think it’s a good idea to expose identifiers in the API like this, and I think the webkit_web_view_get_page_id() function should be removed. Why is it needed at all?
> 
> Because in our web process extension system we haven't exposed any communication API, we use the injected bundle custom messages for internal communication, but we leave the apps to use whatever they want to communicate their web process extensions with their UI process. So, we need a way to match a page from UI and Web processes.

This is only available in the web extensions API for GTK+. In Epiphany we use D-Bus to communicate the web extension with the app, so that we can expose GObjects and use signals, properties, etc. We need a way to match between WebKitWebView (UI) and WebKitWebPage (Web) and we used the page id just for convenience.
Comment 10 Anders Carlsson 2013-04-16 11:12:42 PDT
Comment on attachment 192375 [details]
Patch

Fair enough, r=me.
Comment 11 Carlos Garcia Campos 2013-04-16 11:20:56 PDT
(In reply to comment #10)
> (From update of attachment 192375 [details])
> Fair enough, r=me.

Thank you very much :-)
Comment 12 Carlos Garcia Campos 2013-04-17 00:37:32 PDT
Committed r148592: <http://trac.webkit.org/changeset/148592>