Changeset 231893 in webkit
- Timestamp:
- May 17, 2018 4:30:04 AM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r231879 r231893 1 2018-05-17 Dean Jackson <dino@apple.com> 2 3 Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes 4 https://bugs.webkit.org/show_bug.cgi?id=185722 5 <rdar://problem/40247351> 6 7 Reviewed by Antoine Quint. 8 9 I made a rookie mistake in the original patch: I was holding a strong 10 reference to "self" in a block, which was causing a retain cycle. 11 Replace that with a WeakObjCPtr. 12 13 * UIProcess/Cocoa/SystemPreviewControllerCocoa.mm: 14 (-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]): 15 1 16 2018-05-16 Brent Fulgham <bfulgham@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm
r231825 r231893 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.