Bug 215880

Summary: [GTK] `webkit_web_extension_send_message_to_context` et al. abusing async semantics
Product: WebKit Reporter: Michael Gratton <mike>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, cgarcia
Priority: P3 Keywords: Gtk
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

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?