Bug 215880 - [GTK] `webkit_web_extension_send_message_to_context` et al. abusing async semantics
Summary: [GTK] `webkit_web_extension_send_message_to_context` et al. abusing async sem...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P3 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2020-08-26 23:11 PDT by Michael Gratton
Modified: 2020-08-27 05:12 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gratton 2020-08-26 23:11:15 PDT
The docs for the calls `webkit_web_extension_send_message_to_context` and `webkit_web_view_send_message_to_page` state:

> If you don't expect any reply, or you simply want to ignore it, you can pass NULL as callback.

This is probably convenient for people programming in C, but for people programming using vala or language bindings that provide high-level constructs to handle async calls, this is impossible to do. In these cases WebKitGTK will either always emit a "Message foo was not handled" warning, or to silence the warning must always send a response back, even when not required, increasing latency.

Can the warning be removed, or a proper flag introduced, or something?
Comment 1 Michael Gratton 2020-08-26 23:54:18 PDT
Also `webkit_web_page_send_message_to_view`.
Comment 2 Carlos Garcia Campos 2020-08-27 04:05:57 PDT
hmm, I think we need to add send_with_no_reply for bindings then.
Comment 3 Michael Gratton 2020-08-27 05:12:27 PDT
That would work, but it would also be convenient to be able to specify either/or with a bool or a flag or something.

`send_full` maybe?