RESOLVED FIXED 217351
Use sendWithAsyncReply to evaluate JavaScript in a WebPage
https://bugs.webkit.org/show_bug.cgi?id=217351
Summary Use sendWithAsyncReply to evaluate JavaScript in a WebPage
Alex Christensen
Reported 2020-10-05 16:18:48 PDT
Use sendWithAsyncReply to evaluate JavaScript in a WebPage
Attachments
Patch (21.35 KB, patch)
2020-10-05 16:19 PDT, Alex Christensen
ews-feeder: commit-queue-
Patch (22.63 KB, patch)
2020-10-05 16:39 PDT, Alex Christensen
ews-feeder: commit-queue-
Patch (23.93 KB, patch)
2020-10-05 16:57 PDT, Alex Christensen
no flags
Patch (24.48 KB, patch)
2020-10-05 18:41 PDT, Alex Christensen
no flags
Patch (25.72 KB, patch)
2020-10-05 21:43 PDT, Alex Christensen
no flags
Patch (26.06 KB, patch)
2020-10-06 12:47 PDT, Alex Christensen
ews-feeder: commit-queue-
Patch (27.55 KB, patch)
2020-10-06 13:02 PDT, Alex Christensen
ews-feeder: commit-queue-
Patch (27.55 KB, patch)
2020-10-06 13:07 PDT, Alex Christensen
no flags
Patch (26.54 KB, patch)
2020-10-06 13:31 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2020-10-05 16:19:32 PDT
Alex Christensen
Comment 2 2020-10-05 16:39:39 PDT
EWS Watchlist
Comment 3 2020-10-05 16:40:25 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 https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Alex Christensen
Comment 4 2020-10-05 16:57:02 PDT
Alex Christensen
Comment 5 2020-10-05 18:41:42 PDT
Alex Christensen
Comment 6 2020-10-05 21:43:54 PDT
youenn fablet
Comment 7 2020-10-06 00:32:57 PDT
Comment on attachment 410610 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410610&action=review > Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:3788 > + getPage(webView).runJavaScriptInMainFrame(WTFMove(params), [task = WTFMove(task)](API::SerializedScriptValue* serializedScriptValue, Optional<ExceptionDetails> details) { && and WTFMove. Or can we use something like Expected<RefPtr<API::SerializedScriptValue>, ExceptionDetails>? > Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:3925 > exceptionDetails = *details; Optional<>&& and WTFMove > Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp:3965 > + [task](API::SerializedScriptValue* serializedScriptValue, Optional<ExceptionDetails> details) { Optional<>&& and WTFMove > Source/WebKit/UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp:124 > + [](API::SerializedScriptValue*, Optional<WebCore::ExceptionDetails> exceptionDetails) { &&, maybe use auto&& as well. > Source/WebKit/UIProcess/WebPageProxy.cpp:4105 > + sendWithAsyncReply(Messages::WebPage::RunJavaScriptInFrameInScriptWorld(parameters, frameID, world.worldData()), [activity = WTFMove(activity), callbackFunction = WTFMove(callbackFunction)] (const IPC::DataReference& dataReference, Optional<ExceptionDetails> details) mutable { && > Source/WebKit/UIProcess/WebPageProxy.cpp:4113 > + callbackFunction(API::SerializedScriptValue::adopt(WTFMove(data)).ptr(), details); WTFMove(details)
Alex Christensen
Comment 8 2020-10-06 12:47:34 PDT
Alex Christensen
Comment 9 2020-10-06 13:02:13 PDT
Alex Christensen
Comment 10 2020-10-06 13:07:17 PDT
Alex Christensen
Comment 11 2020-10-06 13:31:58 PDT
Alex Christensen
Comment 12 2020-10-06 14:22:00 PDT
Radar WebKit Bug Importer
Comment 13 2020-10-06 14:22:16 PDT
Note You need to log in before you can comment on or make changes to this bug.