Title: [236209] trunk/Source/WebCore
Revision
236209
Author
[email protected]
Date
2018-09-19 09:22:49 -0700 (Wed, 19 Sep 2018)

Log Message

WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
<https://webkit.org/b/189742>
<rdar://problem/44589774>

Reviewed by Joseph Pecoraro.

* platform/network/cocoa/WebCoreNSURLSession.h:
(WebCoreNSURLSession._sessionDescription): Change type from
NSString * to RetainPtr<NSString>.
* platform/network/cocoa/WebCoreNSURLSession.mm: Remove
@synthesized statement for sessionDescription so that custom
methods can be implemented to handle RetainPtr<NSString>.
(-[WebCoreNSURLSession sessionDescription]): Add.
(-[WebCoreNSURLSession setSessionDescription:]): Add.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (236208 => 236209)


--- trunk/Source/WebCore/ChangeLog	2018-09-19 16:19:03 UTC (rev 236208)
+++ trunk/Source/WebCore/ChangeLog	2018-09-19 16:22:49 UTC (rev 236209)
@@ -1,3 +1,20 @@
+2018-09-19  David Kilzer  <[email protected]>
+
+        WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
+        <https://webkit.org/b/189742>
+        <rdar://problem/44589774>
+
+        Reviewed by Joseph Pecoraro.
+
+        * platform/network/cocoa/WebCoreNSURLSession.h:
+        (WebCoreNSURLSession._sessionDescription): Change type from
+        NSString * to RetainPtr<NSString>.
+        * platform/network/cocoa/WebCoreNSURLSession.mm: Remove
+        @synthesized statement for sessionDescription so that custom
+        methods can be implemented to handle RetainPtr<NSString>.
+        (-[WebCoreNSURLSession sessionDescription]): Add.
+        (-[WebCoreNSURLSession setSessionDescription:]): Add.
+
 2018-09-19  Youenn Fablet  <[email protected]>
 
         Implement sender/receiver getStats

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h (236208 => 236209)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h	2018-09-19 16:19:03 UTC (rev 236208)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.h	2018-09-19 16:22:49 UTC (rev 236209)
@@ -60,7 +60,7 @@
     RefPtr<WebCore::PlatformMediaResourceLoader> _loader;
     RetainPtr<id<NSURLSessionDelegate>> _delegate;
     RetainPtr<NSOperationQueue> _queue;
-    NSString *_sessionDescription;
+    RetainPtr<NSString> _sessionDescription;
     HashSet<RetainPtr<CFTypeRef>> _dataTasks;
     HashSet<RefPtr<WebCore::SecurityOrigin>> _origins;
     Lock _dataTasksLock;

Modified: trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm (236208 => 236209)


--- trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2018-09-19 16:19:03 UTC (rev 236208)
+++ trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm	2018-09-19 16:22:49 UTC (rev 236209)
@@ -155,7 +155,6 @@
 }
 
 #pragma mark - NSURLSession API
-@synthesize sessionDescription=_sessionDescription;
 @dynamic delegate;
 - (__nullable id<NSURLSessionDelegate>)delegate
 {
@@ -179,6 +178,16 @@
     return nil;
 }
 
+- (NSString *)sessionDescription
+{
+    return _sessionDescription.get();
+}
+
+- (void)setSessionDescription:(NSString *)sessionDescription
+{
+    _sessionDescription = adoptNS([sessionDescription copy]);
+}
+
 @dynamic loader;
 - (PlatformMediaResourceLoader&)loader
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to