Bug 202924 - [GTK][WPE] WebKitWebContext should identify web views by their WebPageProxy identifier
Summary: [GTK][WPE] WebKitWebContext should identify web views by their WebPageProxy i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2019-10-14 05:15 PDT by Carlos Garcia Campos
Modified: 2019-10-15 02:11 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.94 KB, patch)
2019-10-14 05:17 PDT, Carlos Garcia Campos
aperez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2019-10-14 05:15:57 PDT
Instead of the WebPage identifier.
Comment 1 Carlos Garcia Campos 2019-10-14 05:17:28 PDT
Created attachment 380877 [details]
Patch
Comment 2 EWS Watchlist 2019-10-14 05:18:23 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 3 Adrian Perez 2019-10-15 00:38:47 PDT
Comment on attachment 380877 [details]
Patch

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

I just have a comment suggesting a small improvement to the code that
touches the “webViews” map, which could as well be a follow-up.

Otherwise r=me :)

> Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp:1807
> +    context->priv->webViews.set(page.identifier().toUInt64(), webView);

Instead of having the explicit .toUInt64() conversions where the “webViews”
is used, the map could be declared as:

  HashMap<WebPageProxyIdentifier, WebKitWebView*> webViews;

This would make explicit in the data type that the mapping is from page
proxy identifiers to web views, and the compiler would help a little bit
doing type checks. There will be still a couple of (unavoidable) casts
when crossing the public API boundaries, but I think it would make the
code a bit more robust. Could be a follow-up patch :)
Comment 4 Carlos Garcia Campos 2019-10-15 02:11:45 PDT
Committed r251127: <https://trac.webkit.org/changeset/251127>