Bug 207936 - WebPageProxy::PolicyDecisionSender should send a struct instead of many parameters
Summary: WebPageProxy::PolicyDecisionSender should send a struct instead of many param...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-19 08:05 PST by Kate Cheney
Modified: 2020-02-19 12:22 PST (History)
4 users (show)

See Also:


Attachments
Patch (31.54 KB, patch)
2020-02-19 08:25 PST, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch for landing (31.36 KB, patch)
2020-02-19 12:02 PST, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kate Cheney 2020-02-19 08:05:55 PST
Right now, PolicyDecisionSender sends 5 parameters. This should be refactored into sending a single struct parameter which contains these values.
Comment 1 Radar WebKit Bug Importer 2020-02-19 08:06:17 PST
<rdar://problem/59590676>
Comment 2 Kate Cheney 2020-02-19 08:25:10 PST
Created attachment 391163 [details]
Patch
Comment 3 Alex Christensen 2020-02-19 11:30:04 PST
Comment on attachment 391163 [details]
Patch

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

> Source/WebKit/Shared/PolicyDecisionData.h:37
> +    uint64_t navigationID;

These should have default initializers so we don't accidentally use uninitialized memory.
uint64_t navigationID { 0 };
etc.
Comment 4 Geoffrey Garen 2020-02-19 11:35:22 PST
Comment on attachment 391163 [details]
Patch

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

> Source/WebKit/Shared/PolicyDecisionData.h:34
> +struct PolicyDecisionData {

Can we call this struct just "PolicyDecision"? All classes are data, so "Data" doesn't add meaning here. ("Info" is another words folks are often tempted to use, which I recommend against.)

I also prefer how "send(PolicyDecision {... })" reads like a complete statement: "I am sending a policy decision."
Comment 5 Kate Cheney 2020-02-19 11:41:44 PST
Yes, I'll change both of these before landing. Thanks!
Comment 6 Kate Cheney 2020-02-19 12:02:36 PST
Created attachment 391187 [details]
Patch for landing
Comment 7 WebKit Commit Bot 2020-02-19 12:22:06 PST
Comment on attachment 391187 [details]
Patch for landing

Clearing flags on attachment: 391187

Committed r256934: <https://trac.webkit.org/changeset/256934>
Comment 8 WebKit Commit Bot 2020-02-19 12:22:07 PST
All reviewed patches have been landed.  Closing bug.