Bug 204199 - Reduce structure copies when creating an API::FrameInfo
Summary: Reduce structure copies when creating an API::FrameInfo
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: 2019-11-14 12:20 PST by Alex Christensen
Modified: 2019-11-18 15:31 PST (History)
10 users (show)

See Also:


Attachments
Patch (88.26 KB, patch)
2019-11-14 12:21 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (97.31 KB, patch)
2019-11-14 12:37 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (100.53 KB, patch)
2019-11-14 15:17 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (101.34 KB, patch)
2019-11-14 15:26 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (97.72 KB, patch)
2019-11-14 17:09 PST, 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 2019-11-14 12:20:24 PST
WKFrameInfo.webView should not return nil
Comment 1 Alex Christensen 2019-11-14 12:21:26 PST
Created attachment 383568 [details]
Patch
Comment 2 Alex Christensen 2019-11-14 12:37:24 PST
Created attachment 383569 [details]
Patch
Comment 3 EWS Watchlist 2019-11-14 12:38:31 PST
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 2019-11-14 15:17:34 PST
Created attachment 383577 [details]
Patch
Comment 5 Alex Christensen 2019-11-14 15:26:06 PST
Created attachment 383579 [details]
Patch
Comment 6 Brady Eidson 2019-11-14 15:36:54 PST
Comment on attachment 383579 [details]
Patch

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

Could I please convince you to split the intended behavior change from all of the argument passing cleanup?

Seems quite unrelated

> Source/WebKit/UIProcess/API/C/WKFrame.cpp:141
>  WKFrameInfoRef WKFrameCreateFrameInfo(WKFrameRef frameRef)
>  {
> -    return toAPI(&API::FrameInfo::create(*toImpl(frameRef), WebCore::SecurityOrigin::createFromString(toImpl(frameRef)->url())).leakRef());
> +    auto* page = toImpl(frameRef)->page();
> +    if (!page)
> +        return nullptr;
> +    return toAPI(&API::FrameInfo::create(*toImpl(frameRef), WebCore::SecurityOriginData { WebCore::SecurityOrigin::createFromString(toImpl(frameRef)->url())->data() }, *page).leakRef());
>  }

This creator being changed to return null is alarming. Does Safari still use this SPI? If so, they almost certainly don't null check the result?
Comment 7 Alex Christensen 2019-11-14 17:09:28 PST
Created attachment 383588 [details]
Patch
Comment 8 Brady Eidson 2019-11-15 10:29:23 PST
Comment on attachment 383588 [details]
Patch

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

> Source/WebKit/UIProcess/API/APIFrameInfo.cpp:61
> +FrameInfo::~FrameInfo() = default;

We have to say this because of the virtual ness, but can't it be in the header?
Comment 9 WebKit Commit Bot 2019-11-15 11:36:08 PST
The commit-queue encountered the following flaky tests while processing attachment 383588 [details]:

imported/w3c/web-platform-tests/websockets/bufferedAmount-unchanged-by-sync-xhr.any.worker.html bug 202003 (author: youennf@gmail.com)
The commit-queue is continuing to process your patch.
Comment 10 WebKit Commit Bot 2019-11-15 11:37:03 PST
Comment on attachment 383588 [details]
Patch

Clearing flags on attachment: 383588

Committed r252492: <https://trac.webkit.org/changeset/252492>
Comment 11 WebKit Commit Bot 2019-11-15 11:37:05 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2019-11-15 11:38:21 PST
<rdar://problem/57234919>
Comment 14 Truitt Savell 2019-11-18 14:17:40 PST
I was able to reproduce the failure by running the test on r252492 but not r252491. 

reproduced with command:
run-webkit-tests http/tests/navigation/window-open-redirect-and-remove-opener.html --iterations 500 -f --debug --exit-after-n-crashes-or-timeouts 1
Comment 15 Alex Christensen 2019-11-18 14:38:31 PST
I'm looking into it.
Comment 16 Alex Christensen 2019-11-18 15:31:47 PST
https://trac.webkit.org/changeset/252601/webkit fixes the test.