Summary: | [Cocoa] Always sync ResourceRequest isAppInitiated request with NSURLRequest attribution value | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||
Component: | WebCore Misc. | Assignee: | Brent Fulgham <bfulgham> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bfulgham, darin, ggaren, katherine_cheney, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 238159 | ||||||||
Attachments: |
|
Description
Brent Fulgham
2022-02-04 16:39:11 PST
Created attachment 450962 [details]
Patch
Comment on attachment 450962 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450962&action=review Can we make a regression test to show what this fixes? > Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm:45 > + : ResourceRequestBase() Is this explicit initialization of the base class required? I suggest we try removing this; I believe it will still compile and generate the same code without it. > Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm:301 > + nsRequest.get().attribution = request.attribution; Why use the setAttribution: syntax above, but the assignment syntax here? I would like ie better if it was consistent. I suggest we use the assignment syntax in all three places. Comment on attachment 450962 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=450962&action=review >> Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm:301 >> + nsRequest.get().attribution = request.attribution; > > Why use the setAttribution: syntax above, but the assignment syntax here? I would like ie better if it was consistent. I suggest we use the assignment syntax in all three places. For some reason, the above initializations of nsRequest from 'adoptNS([m_nsRequest mutableCopy])' were computed as 'RetainPtr<id>'. The method call syntax compiled without errors, so I just used that. If I specify that the adoptNS is assigned to a RetainPtr<NSMutableURLRequest> the assignment syntax works. I could also just cast the result of 'nsRequest.get()', but that seems a little gross. I prefer the "RetainPtr<NSMutableRequest> nsRequest = adoptNS(...)". Do you have a preference? Created attachment 451179 [details]
Patch for landing
Comment on attachment 451179 [details]
Patch for landing
I think it’s good the way you wrote it. I am not so surprised that the compiler doesn't know the type of the result of mutableCopy. It doesn’t use (instancetype) or any trick like that, so it’s just a method that returns an id.
Committed r289255 (246939@main): <https://commits.webkit.org/246939@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 451179 [details]. |