Bug 238748 - [GLib] Need API for asynchronously handling WebKitDownload::decide-destination
Summary: [GLib] Need API for asynchronously handling WebKitDownload::decide-destination
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on: 253146
Blocks: GTK4
  Show dependency treegraph
 
Reported: 2022-04-04 11:14 PDT by Michael Catanzaro
Modified: 2023-03-02 22:44 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2022-04-04 11:14:41 PDT
Currently WebKitDownload::suggest-filename is emitted when WebKit wants to know the location at which to download a file. The application is expected to display a file chooser using gtk_dialog_run(), then return the result to WebKit using webkit_download_set_destination().

In GTK 4, gtk_dialog_run() no longer exists. The only way to accomplish this is to handle it manually, e.g. using your own GMainLoop to iterate the default main context.

Either way, it's not very safe. We should find a way to improve this for the GTK 4 API. One possibility would be to add a webkit_download_start_download() function to allow the application to asynchronously handle things and then indicate to WebKit that it is ready. That might not be needed, though: alternatively, we could make it mandatory to call webkit_download_set_destination(), and just not start downloading until that has been called.
Comment 1 Michael Catanzaro 2022-10-05 13:21:17 PDT
> Either way, it's not very safe.

Well apparently this is not just a theoretical concern. I noticed today when investigating bug #245625 that Ephy is seeing new downloads start when running its nested main loop to handle the current download. For example, there are actually four main loops in this backtrace, three nested ones plus the toplevel. This is why gtk_dialog_run() is so scary and no longer exits:

Thread 1 "epiphany" hit Breakpoint 1, webkitWebViewDecidePolicy (decision=0x5555573e0f90, decisionType=WEBKIT_POLICY_DECISION_TYPE_RESPONSE) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:527
527	    if (decisionType != WEBKIT_POLICY_DECISION_TYPE_RESPONSE) {
(gdb) bt
#0  webkitWebViewDecidePolicy(WebKitWebView*, WebKitPolicyDecision*, WebKitPolicyDecisionType)
    (decision=0x5555573e0f90, decisionType=WEBKIT_POLICY_DECISION_TYPE_RESPONSE)
    at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:527
#1  0x00007ffff05ad6d6 in ffi_call_unix64 () at ../src/x86/unix64.S:105
#2  0x00007ffff05aa492 in ffi_call_int
    (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#3  0x00007ffff73ed1d3 in g_cclosure_marshal_generic
    (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at ../gobject/gclosure.c:1536
#4  0x00007ffff73e6fe0 in g_closure_invoke
    (closure=0x555556172190, return_value=0x7fffffff9020, n_param_values=3, param_values=0x7fffffff9080, invocation_hint=0x7fffffff9000) at ../gobject/gclosure.c:832
#5  0x00007ffff7414ea5 in signal_emit_unlocked_R.isra.0
    (node=<optimized out>, detail=detail@entry=0, instance=instance@entry=0x555556176cd0, emission_return=emission_return@entry=0x7fffffff91a0, instance_and_params=instance_and_params@entry=0x7fffffff9080) at ../gobject/gsignal.c:3835
#6  0x00007ffff7403dd6 in g_signal_emit_valist
    (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffff9250) at ../gobject/gsignal.c:3559
#7  0x00007ffff74045f3 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>)
    at ../gobject/gsignal.c:3606
#8  0x00007ffff345e39e in webkitWebViewMakePolicyDecision(_WebKitWebView*, WebKitPolicyDecisionType, _WebKitPolicyDecision*)
    (webView=<optimized out>, type=type@entry=WEBKIT_POLICY_DECISION_TYPE_RESPONSE, decision=decision@entry=0x5555573e0f90) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:2704
#9  0x00007ffff343cb38 in NavigationClient::decidePolicyForNavigationResponse(WebKit::WebPageProxy&, WTF::Ref<API::NavigationResponse, WTF::RawPtrTraits<API::NavigationResponse> >&&, WTF::Ref<WebKit::WebFramePolicyListenerProxy, WTF::RawPtrTraits<WebKit::WebFramePolicyListenerProxy> >&&, API::Object*)
    (this=0x7fffe9000360, navigationResponse=<optimized out>, listener=<optimized out>)
    at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitNavigationClient.cpp:153
#10 0x00007ffff339767c in WebKit::WebPageProxy::decidePolicyForResponseShared(WTF::Ref<WebKit::WebProcessProxy, WTF::RawPtrTraits<WebKit::WebProcessProxy> >&&, WTF::ObjectIdentifier<WebCore::PageIdentifierType>, WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&)
     (this=0x7fff91040000, process=..., webPageID=..., frameID=..., frameInfo=<optimized out>, identifier=..., navigationID=<optimized out>, response=..., request=..., canShowMIMEType=true, downloadAttribute=..., wasAllowedByInjectedBundle=false, listenerID=63, userData=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/WebPageProxy.cpp:5972
#11 0x00007ffff3397792 in WebKit::WebPageProxy::decidePolicyForResponse(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&)
    (this=<optimized out>, frameID=..., frameInfo=<optimized out>, identifier=..., navigationID=<optimized out>, response=..., request=..., canShowMIMEType=true, downloadAttribute=..., wasAllowedByInjectedBundle=false, listenerID=63, userData=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/WebPageProxy.cpp:5928
#12 0x00007ffff30a269a in IPC::callMemberFunctionImpl<WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&), std::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse, WebCore::ResourceRequest, bool, WTF::String, bool, unsigned long, WebKit::UserData>, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul>(WebKit::WebPageProxy*, void (Web--Type <RET> for more, q to quit, c to continue without paging--c
Kit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&), std::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse, WebCore::ResourceRequest, bool, WTF::String, bool, unsigned long, WebKit::UserData>&&, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul>) (args=..., function=<optimized out>, object=0x7fff91040000) at /usr/include/c++/12/tuple:233
#13 IPC::callMemberFunction<WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&), std::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse, WebCore::ResourceRequest, bool, WTF::String, bool, unsigned long, WebKit::UserData>, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul, 6ul, 7ul, 8ul, 9ul, 10ul> >(std::tuple<WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse, WebCore::ResourceRequest, bool, WTF::String, bool, unsigned long, WebKit::UserData>&&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&)) (function=<optimized out>, object=0x7fff91040000, args=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:137
#14 IPC::handleMessage<Messages::WebPageProxy::DecidePolicyForResponse, WebKit::WebPageProxy, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&)>(IPC::Connection&, IPC::Decoder&, WebKit::WebPageProxy*, void (WebKit::WebPageProxy::*)(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&)) (decoder=..., object=object@entry=0x7fff91040000, function=(void (WebKit::WebPageProxy::*)(WebKit::WebPageProxy * const, WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData &&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, const WebCore::ResourceResponse &, const WebCore::ResourceRequest &, bool, const WTF::String &, bool, unsigned long, const WebKit::UserData &)) 0x7ffff3397710 <WebKit::WebPageProxy::decidePolicyForResponse(WTF::ObjectIdentifier<WebCore::FrameIdentifierType>, WebKit::FrameInfoData&&, WebCore::ProcessQualified<WTF::ObjectIdentifier<WebCore::LocalPolicyCheckIdentifierType> >, unsigned long, WebCore::ResourceResponse const&, WebCore::ResourceRequest const&, bool, WTF::String const&, bool, unsigned long, WebKit::UserData const&)>, connection=<optimized out>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:259
#15 0x00007ffff30a5865 in WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fff91040000, connection=<optimized out>, decoder=...) at /home/mcatanzaro/Projects/WebKit/WebKitBuild/gtk3/DerivedSources/WebKit/WebPageProxyMessageReceiver.cpp:1137
#16 0x00007ffff32cfca8 in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) (this=this@entry=0x7fffe90d41e8, connection=..., decoder=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:129
#17 0x00007ffff334115c in WebKit::AuxiliaryProcessProxy::dispatchMessage(IPC::Connection&, IPC::Decoder&) (this=this@entry=0x7fffe90d4150, connection=..., decoder=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp:271
#18 0x00007ffff3372dd2 in WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe90d4150, connection=..., decoder=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/WebProcessProxy.cpp:846
#19 0x00007ffff32c9595 in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) (this=0x7fffe9028ea0, message=std::unique_ptr<IPC::Decoder> = {...}) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/Connection.cpp:1148
#20 0x00007ffff32cb4ae in IPC::Connection::dispatchIncomingMessages() (this=0x7fffe9028ea0) at /usr/include/c++/12/bits/unique_ptr.h:189
#21 0x00007ffff22c432e in WTF::Function<void ()>::operator()() const (this=<synthetic pointer>) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/Function.h:79
#22 WTF::RunLoop::performWork() (this=0x7fffe90100e0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/RunLoop.cpp:146
#23 0x00007ffff231e789 in operator() (userData=<optimized out>, userData@entry=0x7fffe90100e0, __closure=0x0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#24 _FUN(gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:82
#25 0x00007ffff231f03f in operator() (__closure=0x0, userData=0x7fffe90100e0, callback=0x7ffff231e780 <_FUN(gpointer)>, source=0x5555555cefa0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:53
#26 _FUN(GSource*, GSourceFunc, gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:56
#27 0x00007ffff72e8c3f in g_main_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:3444
#28 g_main_context_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:4162
#29 0x00007ffff733e3c8 in g_main_context_iterate.constprop.0 (context=0x5555555b5af0, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4238
#30 0x00007ffff72e820f in g_main_loop_run (loop=0x55555736ee50) at ../glib/gmain.c:4438
#31 0x00007ffff7f4f93d in run_download_confirmation_dialog (suggested_filename=0x5555561bacd0 "sync", download=<optimized out>) at ../embed/ephy-download.c:822
#32 download_decide_destination_cb (wk_download=<optimized out>, wk_suggestion=<optimized out>, download=<optimized out>) at ../embed/ephy-download.c:873
#33 0x00007ffff05ad6d6 in ffi_call_unix64 () at ../src/x86/unix64.S:105
#34 0x00007ffff05aa492 in ffi_call_int (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#35 0x00007ffff73ed1d3 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at ../gobject/gclosure.c:1536
#36 0x00007ffff73e6fe0 in g_closure_invoke (closure=0x55555733af70, return_value=0x7fffffffa8a0, n_param_values=2, param_values=0x7fffffffa900, invocation_hint=0x7fffffffa880) at ../gobject/gclosure.c:832
#37 0x00007ffff7414d76 in signal_emit_unlocked_R.isra.0 (node=<optimized out>, detail=detail@entry=0, instance=instance@entry=0x555557356f90, emission_return=emission_return@entry=0x7fffffffaa10, instance_and_params=instance_and_params@entry=0x7fffffffa900) at ../gobject/gsignal.c:3796
#38 0x00007ffff7403dd6 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffaac0) at ../gobject/gsignal.c:3559
#39 0x00007ffff74045f3 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../gobject/gsignal.c:3606
#40 0x00007ffff3432180 in webkitDownloadDecideDestinationWithSuggestedFilename(_WebKitDownload*, WTF::CString const&, bool&) (download=download@entry=0x555557356f90, suggestedFilename=..., allowOverwrite=@0x7fffffffabdf: false) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitDownload.cpp:425
#41 0x00007ffff34334de in LegacyDownloadClient::decideDestinationWithSuggestedFilename(WebKit::DownloadProxy&, WebCore::ResourceResponse const&, WTF::String const&, WTF::CompletionHandler<void (WebKit::AllowOverwrite, WTF::String)>&&) (this=<optimized out>, downloadProxy=<optimized out>, resourceResponse=<optimized out>, filename=..., completionHandler=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp:94
#42 0x00007ffff34a81ec in WebKit::DownloadProxy::decideDestinationWithSuggestedFilename(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&) (this=0x7fffe9134640, response=..., suggestedFilename=..., completionHandler=<optimized out>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp:170
#43 0x00007ffff30d26da in IPC::callMemberFunctionImpl<WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite), std::tuple<WebCore::ResourceResponse, WTF::String>, 0ul, 1ul>(WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&, std::tuple<WebCore::ResourceResponse, WTF::String>&&, std::integer_sequence<unsigned long, 0ul, 1ul>) (args=..., completionHandler=..., function=<optimized out>, object=0x7fffe9134640) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:145
#44 IPC::callMemberFunction<WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite), std::tuple<WebCore::ResourceResponse, WTF::String>, std::integer_sequence<unsigned long, 0ul, 1ul> >(std::tuple<WebCore::ResourceResponse, WTF::String>&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)) (function=<optimized out>, object=0x7fffe9134640, completionHandler=..., args=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:151
#45 IPC::handleMessageAsync<Messages::DownloadProxy::DecideDestinationWithSuggestedFilename, WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)>(IPC::Connection&, IPC::Decoder&, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)) (connection=..., decoder=..., object=object@entry=0x7fffe9134640, function=(void (WebKit::DownloadProxy::*)(WebKit::DownloadProxy * const, const WebCore::ResourceResponse &, WTF::String &&, WTF::CompletionHandler<void(WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)> &&)) 0x7ffff34a7f20 <WebKit::DownloadProxy::decideDestinationWithSuggestedFilename(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:353
#46 0x00007ffff30d2088 in WebKit::DownloadProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe9134640, connection=<optimized out>, decoder=...) at /home/mcatanzaro/Projects/WebKit/WebKitBuild/gtk3/DerivedSources/WebKit/DownloadProxyMessageReceiver.cpp:98
#47 0x00007ffff32cfca8 in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe9054238, connection=..., decoder=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:129
#48 0x00007ffff34c1ff6 in non-virtual thunk to WebKit::NetworkProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) () at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:329
#49 0x00007ffff32c9595 in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) (this=0x7fffe90289c0, message=std::unique_ptr<IPC::Decoder> = {...}) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/Connection.cpp:1148
#50 0x00007ffff32cac26 in IPC::Connection::dispatchOneIncomingMessage() (this=0x7fffe90289c0) at /usr/include/c++/12/bits/unique_ptr.h:189
#51 0x00007ffff22c432e in WTF::Function<void ()>::operator()() const (this=<synthetic pointer>) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/Function.h:79
#52 WTF::RunLoop::performWork() (this=0x7fffe90100e0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/RunLoop.cpp:146
#53 0x00007ffff231e789 in operator() (userData=<optimized out>, userData@entry=0x7fffe90100e0, __closure=0x0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#54 _FUN(gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:82
#55 0x00007ffff231f03f in operator() (__closure=0x0, userData=0x7fffe90100e0, callback=0x7ffff231e780 <_FUN(gpointer)>, source=0x5555555cefa0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:53
#56 _FUN(GSource*, GSourceFunc, gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:56
#57 0x00007ffff72e8c3f in g_main_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:3444
#58 g_main_context_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:4162
#59 0x00007ffff733e3c8 in g_main_context_iterate.constprop.0 (context=0x5555555b5af0, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4238
#60 0x00007ffff72e820f in g_main_loop_run (loop=0x555557357370) at ../glib/gmain.c:4438
#61 0x00007ffff7f4f93d in run_download_confirmation_dialog (suggested_filename=0x555556a13d10 "ingest", download=<optimized out>) at ../embed/ephy-download.c:822
#62 download_decide_destination_cb (wk_download=<optimized out>, wk_suggestion=<optimized out>, download=<optimized out>) at ../embed/ephy-download.c:873
#63 0x00007ffff05ad6d6 in ffi_call_unix64 () at ../src/x86/unix64.S:105
#64 0x00007ffff05aa492 in ffi_call_int (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#65 0x00007ffff73ed1d3 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at ../gobject/gclosure.c:1536
#66 0x00007ffff73e6fe0 in g_closure_invoke (closure=0x55555631fa50, return_value=0x7fffffffb8d0, n_param_values=2, param_values=0x7fffffffb930, invocation_hint=0x7fffffffb8b0) at ../gobject/gclosure.c:832
#67 0x00007ffff7414d76 in signal_emit_unlocked_R.isra.0 (node=<optimized out>, detail=detail@entry=0, instance=instance@entry=0x7fff88006280, emission_return=emission_return@entry=0x7fffffffba40, instance_and_params=instance_and_params@entry=0x7fffffffb930) at ../gobject/gsignal.c:3796
#68 0x00007ffff7403dd6 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffbaf0) at ../gobject/gsignal.c:3559
#69 0x00007ffff74045f3 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../gobject/gsignal.c:3606
#70 0x00007ffff3432180 in webkitDownloadDecideDestinationWithSuggestedFilename(_WebKitDownload*, WTF::CString const&, bool&) (download=download@entry=0x7fff88006280, suggestedFilename=..., allowOverwrite=@0x7fffffffbc0f: false) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitDownload.cpp:425
#71 0x00007ffff34334de in LegacyDownloadClient::decideDestinationWithSuggestedFilename(WebKit::DownloadProxy&, WebCore::ResourceResponse const&, WTF::String const&, WTF::CompletionHandler<void (WebKit::AllowOverwrite, WTF::String)>&&) (this=<optimized out>, downloadProxy=<optimized out>, resourceResponse=<optimized out>, filename=..., completionHandler=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp:94
#72 0x00007ffff34a81ec in WebKit::DownloadProxy::decideDestinationWithSuggestedFilename(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&) (this=0x7fffe915ba80, response=..., suggestedFilename=..., completionHandler=<optimized out>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp:170
#73 0x00007ffff30d26da in IPC::callMemberFunctionImpl<WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite), std::tuple<WebCore::ResourceResponse, WTF::String>, 0ul, 1ul>(WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&, std::tuple<WebCore::ResourceResponse, WTF::String>&&, std::integer_sequence<unsigned long, 0ul, 1ul>) (args=..., completionHandler=..., function=<optimized out>, object=0x7fffe915ba80) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:145
#74 IPC::callMemberFunction<WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite), std::tuple<WebCore::ResourceResponse, WTF::String>, std::integer_sequence<unsigned long, 0ul, 1ul> >(std::tuple<WebCore::ResourceResponse, WTF::String>&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)) (function=<optimized out>, object=0x7fffe915ba80, completionHandler=..., args=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:151
#75 IPC::handleMessageAsync<Messages::DownloadProxy::DecideDestinationWithSuggestedFilename, WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)>(IPC::Connection&, IPC::Decoder&, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)) (connection=..., decoder=..., object=object@entry=0x7fffe915ba80, function=(void (WebKit::DownloadProxy::*)(WebKit::DownloadProxy * const, const WebCore::ResourceResponse &, WTF::String &&, WTF::CompletionHandler<void(WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)> &&)) 0x7ffff34a7f20 <WebKit::DownloadProxy::decideDestinationWithSuggestedFilename(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:353
#76 0x00007ffff30d2088 in WebKit::DownloadProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe915ba80, connection=<optimized out>, decoder=...) at /home/mcatanzaro/Projects/WebKit/WebKitBuild/gtk3/DerivedSources/WebKit/DownloadProxyMessageReceiver.cpp:98
#77 0x00007ffff32cfca8 in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe9054238, connection=..., decoder=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:129
#78 0x00007ffff34c1ff6 in non-virtual thunk to WebKit::NetworkProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) () at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:329
#79 0x00007ffff32c9595 in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) (this=0x7fffe90289c0, message=std::unique_ptr<IPC::Decoder> = {...}) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/Connection.cpp:1148
#80 0x00007ffff32cac26 in IPC::Connection::dispatchOneIncomingMessage() (this=0x7fffe90289c0) at /usr/include/c++/12/bits/unique_ptr.h:189
#81 0x00007ffff22c432e in WTF::Function<void ()>::operator()() const (this=<synthetic pointer>) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/Function.h:79
#82 WTF::RunLoop::performWork() (this=0x7fffe90100e0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/RunLoop.cpp:146
#83 0x00007ffff231e789 in operator() (userData=<optimized out>, userData@entry=0x7fffe90100e0, __closure=0x0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#84 _FUN(gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:82
#85 0x00007ffff231f03f in operator() (__closure=0x0, userData=0x7fffe90100e0, callback=0x7ffff231e780 <_FUN(gpointer)>, source=0x5555555cefa0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:53
#86 _FUN(GSource*, GSourceFunc, gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:56
#87 0x00007ffff72e8c3f in g_main_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:3444
#88 g_main_context_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:4162
#89 0x00007ffff733e3c8 in g_main_context_iterate.constprop.0 (context=0x5555555b5af0, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4238
#90 0x00007ffff72e820f in g_main_loop_run (loop=0x5555573364f0) at ../glib/gmain.c:4438
#91 0x00007ffff7f4f93d in run_download_confirmation_dialog (suggested_filename=0x555556a1e770 "pixelSync", download=<optimized out>) at ../embed/ephy-download.c:822
#92 download_decide_destination_cb (wk_download=<optimized out>, wk_suggestion=<optimized out>, download=<optimized out>) at ../embed/ephy-download.c:873
#93 0x00007ffff05ad6d6 in ffi_call_unix64 () at ../src/x86/unix64.S:105
#94 0x00007ffff05aa492 in ffi_call_int (cif=<optimized out>, fn=<optimized out>, rvalue=<optimized out>, avalue=<optimized out>, closure=<optimized out>) at ../src/x86/ffi64.c:672
#95 0x00007ffff73ed1d3 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at ../gobject/gclosure.c:1536
#96 0x00007ffff73e6fe0 in g_closure_invoke (closure=0x555556e9de20, return_value=0x7fffffffc900, n_param_values=2, param_values=0x7fffffffc960, invocation_hint=0x7fffffffc8e0) at ../gobject/gclosure.c:832
#97 0x00007ffff7414d76 in signal_emit_unlocked_R.isra.0 (node=<optimized out>, detail=detail@entry=0, instance=instance@entry=0x5555572a4e10, emission_return=emission_return@entry=0x7fffffffca70, instance_and_params=instance_and_params@entry=0x7fffffffc960) at ../gobject/gsignal.c:3796
#98 0x00007ffff7403dd6 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffcb20) at ../gobject/gsignal.c:3559
#99 0x00007ffff74045f3 in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at ../gobject/gsignal.c:3606
#100 0x00007ffff3432180 in webkitDownloadDecideDestinationWithSuggestedFilename(_WebKitDownload*, WTF::CString const&, bool&) (download=download@entry=0x5555572a4e10, suggestedFilename=..., allowOverwrite=@0x7fffffffcc3f: false) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitDownload.cpp:425
#101 0x00007ffff34334de in LegacyDownloadClient::decideDestinationWithSuggestedFilename(WebKit::DownloadProxy&, WebCore::ResourceResponse const&, WTF::String const&, WTF::CompletionHandler<void (WebKit::AllowOverwrite, WTF::String)>&&) (this=<optimized out>, downloadProxy=<optimized out>, resourceResponse=<optimized out>, filename=..., completionHandler=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/API/glib/WebKitDownloadClient.cpp:94
#102 0x00007ffff34a81ec in WebKit::DownloadProxy::decideDestinationWithSuggestedFilename(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&) (this=0x7fffe91584e0, response=..., suggestedFilename=..., completionHandler=<optimized out>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp:170
#103 0x00007ffff30d26da in IPC::callMemberFunctionImpl<WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite), std::tuple<WebCore::ResourceResponse, WTF::String>, 0ul, 1ul>(WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&, std::tuple<WebCore::ResourceResponse, WTF::String>&&, std::integer_sequence<unsigned long, 0ul, 1ul>) (args=..., completionHandler=..., function=<optimized out>, object=0x7fffe91584e0) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:145
#104 IPC::callMemberFunction<WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&), void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite), std::tuple<WebCore::ResourceResponse, WTF::String>, std::integer_sequence<unsigned long, 0ul, 1ul> >(std::tuple<WebCore::ResourceResponse, WTF::String>&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)) (function=<optimized out>, object=0x7fffe91584e0, completionHandler=..., args=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:151
#105 IPC::handleMessageAsync<Messages::DownloadProxy::DecideDestinationWithSuggestedFilename, WebKit::DownloadProxy, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)>(IPC::Connection&, IPC::Decoder&, WebKit::DownloadProxy*, void (WebKit::DownloadProxy::*)(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)) (connection=..., decoder=..., object=object@entry=0x7fffe91584e0, function=(void (WebKit::DownloadProxy::*)(WebKit::DownloadProxy * const, const WebCore::ResourceResponse &, WTF::String &&, WTF::CompletionHandler<void(WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)> &&)) 0x7ffff34a7f20 <WebKit::DownloadProxy::decideDestinationWithSuggestedFilename(WebCore::ResourceResponse const&, WTF::String&&, WTF::CompletionHandler<void (WTF::String, WebKit::SandboxExtension::Handle, WebKit::AllowOverwrite)>&&)>) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/HandleMessage.h:353
#106 0x00007ffff30d2088 in WebKit::DownloadProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe91584e0, connection=<optimized out>, decoder=...) at /home/mcatanzaro/Projects/WebKit/WebKitBuild/gtk3/DerivedSources/WebKit/DownloadProxyMessageReceiver.cpp:98
#107 0x00007ffff32cfca8 in IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) (this=0x7fffe9054238, connection=..., decoder=...) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp:129
#108 0x00007ffff34c1ff6 in non-virtual thunk to WebKit::NetworkProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) () at /home/mcatanzaro/Projects/WebKit/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h:329
#109 0x00007ffff32c9595 in IPC::Connection::dispatchMessage(std::unique_ptr<IPC::Decoder, std::default_delete<IPC::Decoder> >) (this=0x7fffe90289c0, message=std::unique_ptr<IPC::Decoder> = {...}) at /home/mcatanzaro/Projects/WebKit/Source/WebKit/Platform/IPC/Connection.cpp:1148
#110 0x00007ffff32cac26 in IPC::Connection::dispatchOneIncomingMessage() (this=0x7fffe90289c0) at /usr/include/c++/12/bits/unique_ptr.h:189
#111 0x00007ffff22c432e in WTF::Function<void ()>::operator()() const (this=<synthetic pointer>) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/Function.h:79
#112 WTF::RunLoop::performWork() (this=0x7fffe90100e0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/RunLoop.cpp:146
#113 0x00007ffff231e789 in operator() (userData=<optimized out>, userData@entry=0x7fffe90100e0, __closure=0x0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:80
#114 _FUN(gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:82
#115 0x00007ffff231f03f in operator() (__closure=0x0, userData=0x7fffe90100e0, callback=0x7ffff231e780 <_FUN(gpointer)>, source=0x5555555cefa0) at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:53
#116 _FUN(GSource*, GSourceFunc, gpointer) () at /home/mcatanzaro/Projects/WebKit/Source/WTF/wtf/glib/RunLoopGLib.cpp:56
#117 0x00007ffff72e8c3f in g_main_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:3444
#118 g_main_context_dispatch (context=0x5555555b5af0) at ../glib/gmain.c:4162
#119 0x00007ffff733e3c8 in g_main_context_iterate.constprop.0 (context=0x5555555b5af0, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4238
#120 0x00007ffff72e5ec0 in g_main_context_iteration (context=context@entry=0x5555555b5af0, may_block=may_block@entry=1) at ../glib/gmain.c:4303
#121 0x00007ffff7514afd in g_application_run (application=0x5555555dc240, argc=argc@entry=1, argv=argv@entry=0x7fffffffd6a8) at ../gio/gapplication.c:2571
#122 0x0000555555559062 in main (argc=<optimized out>, argv=<optimized out>) at ../src/ephy-main.c:434
Comment 2 Michael Catanzaro 2023-02-23 13:37:29 PST
So I've been thinking about this. The most elegant way to handle this is to say that if you return TRUE for WebKitDownload::decide-destination but without calling webkit_download_set_destination(), then this indicates that you will eventually call webkit_download_set_destination() later on, and the download should not start until having done so. This is also pretty easy to implement because internally everything is already designed to be asynchronous.

I think we could even get away with changing this in the original API version, because well-behaved applications should surely return FALSE if they're not going to set a destination. It would be pretty weird to return TRUE and block other handlers yet not set a destination. I also did a Debian codesearch and verified that there are very few applications using this API at all. But we could alternatively limit this behavior to new API version only.

Opinions?
Comment 3 Carlos Garcia Campos 2023-02-24 00:50:36 PST
(In reply to Michael Catanzaro from comment #2)
> So I've been thinking about this. The most elegant way to handle this is to
> say that if you return TRUE for WebKitDownload::decide-destination but
> without calling webkit_download_set_destination(), then this indicates that
> you will eventually call webkit_download_set_destination() later on, and the
> download should not start until having done so. This is also pretty easy to
> implement because internally everything is already designed to be
> asynchronous.
> 
> I think we could even get away with changing this in the original API
> version, because well-behaved applications should surely return FALSE if
> they're not going to set a destination. It would be pretty weird to return
> TRUE and block other handlers yet not set a destination. I also did a Debian
> codesearch and verified that there are very few applications using this API
> at all. But we could alternatively limit this behavior to new API version
> only.
> 
> Opinions?

Sounds good to me, and I think it's safe to do it in current api too.
Comment 4 Michael Catanzaro 2023-02-27 12:56:31 PST
(In reply to Carlos Garcia Campos from comment #3)
> Sounds good to me, and I think it's safe to do it in current api too.

I also noticed that the current API takes a URI that it converts to a filesystem path. But GtkFileDialog returns a path, so the application has to convert to a URI for no reason and then WebKit converts back to a path. So we should just take a path instead. And that change certainly cannot be backwards-compatible, so needs to be limited to new API version only.

We could still make the async behavior change available to the old API version if desired, but since there is some small compatibility risk and it's no longer possible for me to avoid version-specific differences, I'll arbitrarily choose not to.
Comment 5 Michael Catanzaro 2023-02-27 13:06:08 PST
(In reply to Michael Catanzaro from comment #4)
> We could still make the async behavior change available to the old API
> version if desired, but since there is some small compatibility risk and
> it's no longer possible for me to avoid version-specific differences, I'll
> arbitrarily choose not to.

Eh, actually it's two separate changes really... easier to make the async change everywhere, and the URI -> path change only for new API.
Comment 6 Michael Catanzaro 2023-02-28 14:22:55 PST
Pull request: https://github.com/WebKit/WebKit/pull/10823
Comment 7 Michael Catanzaro 2023-03-01 09:10:00 PST
Path changes landed separately in bug #253146.
Comment 8 EWS 2023-03-02 22:44:40 PST
Committed 261118@main (878af52cf358): <https://commits.webkit.org/261118@main>

Reviewed commits have been landed. Closing PR #10823 and removing active labels.