| Summary: | Use smart pointers for WebCoreNSURLSessionDataTask ObjC members | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||
| Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | beidson, darin, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Alex Christensen
2021-12-18 09:23:45 PST
Created attachment 447521 [details]
Patch
These properties are marked as (copy). Will do copying and autoreleasing. Created attachment 447528 [details]
Patch
Committed r287230 (245391@main): <https://commits.webkit.org/245391@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447528 [details]. Comment on attachment 447528 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447528&action=review > Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm:803 > +- (NSURLRequest *)originalRequest > +{ > + return adoptNS([_originalRequest copy]).autorelease(); > +} > + > +- (NSURLRequest *)currentRequest > +{ > + return adoptNS([_currentRequest copy]).autorelease(); > +} > + > +- (NSError *)error > +{ > + return adoptNS([_error copy]).autorelease(); > +} > + > +- (NSString *)taskDescription > +{ > + return adoptNS([_taskDescription copy]).autorelease(); > +} > + > +- (void)setTaskDescription:(NSString *)description > +{ > + _taskDescription = adoptNS([description copy]); > +} Was the old code doing these copies and autoreleases? It’s not a given that they must be done just because a smart pointer is involved. They might be good changes in their own right, but need to explain why typically. |