Bug 176583 - Modernize and make API::UIClient more asynchronous
Summary: Modernize and make API::UIClient more asynchronous
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-09-07 21:32 PDT by Alex Christensen
Modified: 2017-09-27 13:02 PDT (History)
7 users (show)

See Also:


Attachments
Patch (56.97 KB, patch)
2017-09-07 21:38 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (60.36 KB, patch)
2017-09-07 21:51 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (66.74 KB, patch)
2017-09-07 21:58 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (66.58 KB, patch)
2017-09-07 22:45 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (66.18 KB, patch)
2017-09-08 10:06 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (64.70 KB, patch)
2017-09-11 15:24 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2017-09-07 21:32:21 PDT
Modernize and make API::UIClient more asynchronous
Comment 1 Alex Christensen 2017-09-07 21:38:09 PDT
Created attachment 320235 [details]
Patch
Comment 2 Alex Christensen 2017-09-07 21:51:57 PDT
Created attachment 320236 [details]
Patch
Comment 3 Build Bot 2017-09-07 21:54:42 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 4 Alex Christensen 2017-09-07 21:58:12 PDT
Created attachment 320237 [details]
Patch
Comment 5 Alex Christensen 2017-09-07 22:45:22 PDT
Created attachment 320242 [details]
Patch
Comment 6 Alex Christensen 2017-09-08 10:06:28 PDT
Created attachment 320271 [details]
Patch
Comment 7 BJ Burg 2017-09-08 11:03:38 PDT
Comment on attachment 320271 [details]
Patch

Automation changes look OK in principle, but I would like to read this more deeply and run test suite.
Comment 8 BJ Burg 2017-09-08 11:04:10 PDT
(In reply to Brian Burg from comment #7)
> Comment on attachment 320271 [details]
> Patch
> 
> Automation changes look OK in principle, but I would like to read this more
> deeply and run test suite.

Or Carlos could do the same. I don't have time to review until Monday.
Comment 9 BJ Burg 2017-09-11 14:09:41 PDT
Comment on attachment 320271 [details]
Patch

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

r=me with small request

> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:212
> +    page.getWindowFrameWithCompletionHandler([this, protectedThis = WTFMove(protectedThis), activeURL = page.pageLoadState().activeURL(), handle = handleForWebPageProxy(page), completionHandler = WTFMove(completionHandler)](WebCore::FloatRect windowFrame) mutable {

Err, this is weird. The async part should not be in the factory method, which just translates WK types to JSON payloads. So the new signature for this builder should be adjusted to take the page and its windowFrame, and stay synchronous.

> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:235
> +void WebAutomationSession::getNextContext(Ref<WebAutomationSession>&& protectedThis, Vector<Ref<WebPageProxy>>&& pages, Ref<Inspector::Protocol::Array<Inspector::Protocol::Automation::BrowsingContext>> contexts, Ref<WebAutomationSession::GetBrowsingContextsCallback>&& callback)

This diff is hard to read.

> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:242
> +    buildBrowsingContextForPage(WTFMove(protectedThis), page.get(), [this, pages = WTFMove(pages), contexts = WTFMove(contexts), callback = WTFMove(callback)](Ref<WebAutomationSession>&& protectedThis, Ref<Inspector::Protocol::Automation::BrowsingContext>&& context) mutable {

... so the windowFrame async call would be here, and call the builder inside the completion handler.

> Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:1288
> +

parsedButton and parsedInteraction don't need to be in the completion handler.
Comment 10 Alex Christensen 2017-09-11 15:24:04 PDT
Created attachment 320486 [details]
Patch
Comment 11 Alex Christensen 2017-09-11 15:51:30 PDT
http://trac.webkit.org/r221887
Comment 12 Radar WebKit Bug Importer 2017-09-27 13:02:19 PDT
<rdar://problem/34694523>