Changeset 231900 in webkit
- Timestamp:
- May 17, 2018 8:52:49 AM (6 years ago)
- Location:
- branches/safari-606.1.17-branch/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-606.1.17-branch/Source/WebKit/ChangeLog
r231884 r231900 1 2018-05-17 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r231893. rdar://problem/40247351 4 5 Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes 6 https://bugs.webkit.org/show_bug.cgi?id=185722 7 <rdar://problem/40247351> 8 9 Reviewed by Antoine Quint. 10 11 I made a rookie mistake in the original patch: I was holding a strong 12 reference to "self" in a block, which was causing a retain cycle. 13 Replace that with a WeakObjCPtr. 14 15 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: 16 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): 17 18 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231893 268f45cc-cd09-0410-ab3c-d52691b4dbfc 19 20 2018-05-17 Dean Jackson <dino@apple.com> 21 22 Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes 23 https://bugs.webkit.org/show_bug.cgi?id=185722 24 <rdar://problem/40247351> 25 26 Reviewed by Antoine Quint. 27 28 I made a rookie mistake in the original patch: I was holding a strong 29 reference to "self" in a block, which was causing a retain cycle. 30 Replace that with a WeakObjCPtr. 31 32 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: 33 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): 34 1 35 2018-05-16 Babak Shafiei <bshafiei@apple.com> 2 36 -
branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm
r231858 r231900 30 30 31 31 #import "APIUIClient.h" 32 #import "WeakObjCPtr.h" 32 33 #import "WebPageProxy.h" 33 34 34 #import <MobileCoreServices/MobileCoreServices.h> 35 35 #import <QuickLook/QuickLook.h> … … 88 88 [_item setUseLoadingTimeout:NO]; 89 89 90 [_itemProvider registerItemForTypeIdentifier:contentType loadHandler:^(NSItemProviderCompletionHandler completionHandler, Class expectedValueClass, NSDictionary * options) { 91 // This will get called once the download completes. 92 self.completionHandler = completionHandler; 90 WebKit::WeakObjCPtr<_WKPreviewControllerDataSource> weakSelf { self }; 91 [_itemProvider registerItemForTypeIdentifier:contentType loadHandler:[weakSelf = WTFMove(weakSelf)] (NSItemProviderCompletionHandler completionHandler, Class expectedValueClass, NSDictionary * options) { 92 if (auto strongSelf = weakSelf.get()) 93 [strongSelf setCompletionHandler:completionHandler]; 93 94 }]; 94 95 return _item.get();
Note: See TracChangeset
for help on using the changeset viewer.