Title: [231900] branches/safari-606.1.17-branch/Source/WebKit
- Revision
- 231900
- Author
- [email protected]
- Date
- 2018-05-17 08:52:49 -0700 (Thu, 17 May 2018)
Log Message
Cherry-pick r231893. rdar://problem/40247351
Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
https://bugs.webkit.org/show_bug.cgi?id=185722
<rdar://problem/40247351>
Reviewed by Antoine Quint.
I made a rookie mistake in the original patch: I was holding a strong
reference to "self" in a block, which was causing a retain cycle.
Replace that with a WeakObjCPtr.
* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-606.1.17-branch/Source/WebKit/ChangeLog (231899 => 231900)
--- branches/safari-606.1.17-branch/Source/WebKit/ChangeLog 2018-05-17 15:34:38 UTC (rev 231899)
+++ branches/safari-606.1.17-branch/Source/WebKit/ChangeLog 2018-05-17 15:52:49 UTC (rev 231900)
@@ -1,3 +1,37 @@
+2018-05-17 Kocsen Chung <[email protected]>
+
+ Cherry-pick r231893. rdar://problem/40247351
+
+ Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
+ https://bugs.webkit.org/show_bug.cgi?id=185722
+ <rdar://problem/40247351>
+
+ Reviewed by Antoine Quint.
+
+ I made a rookie mistake in the original patch: I was holding a strong
+ reference to "self" in a block, which was causing a retain cycle.
+ Replace that with a WeakObjCPtr.
+
+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
+ (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-05-17 Dean Jackson <[email protected]>
+
+ Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
+ https://bugs.webkit.org/show_bug.cgi?id=185722
+ <rdar://problem/40247351>
+
+ Reviewed by Antoine Quint.
+
+ I made a rookie mistake in the original patch: I was holding a strong
+ reference to "self" in a block, which was causing a retain cycle.
+ Replace that with a WeakObjCPtr.
+
+ * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
+ (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
+
2018-05-16 Babak Shafiei <[email protected]>
Cherry-pick r231779. rdar://problem/39999778
Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm (231899 => 231900)
--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm 2018-05-17 15:34:38 UTC (rev 231899)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm 2018-05-17 15:52:49 UTC (rev 231900)
@@ -29,8 +29,8 @@
#if USE(SYSTEM_PREVIEW)
#import "APIUIClient.h"
+#import "WeakObjCPtr.h"
#import "WebPageProxy.h"
-
#import <MobileCoreServices/MobileCoreServices.h>
#import <QuickLook/QuickLook.h>
#import <UIKit/UIViewController.h>
@@ -87,9 +87,10 @@
_item = adoptNS([allocQLItemInstance() initWithPreviewItemProvider:_itemProvider.get() contentType:contentType previewTitle:@"Preview" fileSize:@(0)]);
[_item setUseLoadingTimeout:NO];
- [_itemProvider registerItemForTypeIdentifier:contentType loadHandler:^(NSItemProviderCompletionHandler completionHandler, Class expectedValueClass, NSDictionary * options) {
- // This will get called once the download completes.
- self.completionHandler = completionHandler;
+ WebKit::WeakObjCPtr<_WKPreviewControllerDataSource> weakSelf { self };
+ [_itemProvider registerItemForTypeIdentifier:contentType loadHandler:[weakSelf = WTFMove(weakSelf)] (NSItemProviderCompletionHandler completionHandler, Class expectedValueClass, NSDictionary * options) {
+ if (auto strongSelf = weakSelf.get())
+ [strongSelf setCompletionHandler:completionHandler];
}];
return _item.get();
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes