WebKit Bugzilla
Attachment 340570 Details for
Bug 185722
: Safari optimized flow should be releasing viewer to prevent memory growth with subsequent launches/closes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185722-20180517210411.patch (text/plain), 2.56 KB, created by
Dean Jackson
on 2018-05-17 04:04:13 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Dean Jackson
Created:
2018-05-17 04:04:13 PDT
Size:
2.56 KB
patch
obsolete
>Subversion Revision: 231578 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index fbb4d7bbbf774db3552288815d68ecc2e608fdee..31c0cd39f065397d49f8218dc610a4d0c9d6d159 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,18 @@ >+2018-05-17 Dean Jackson <dino@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ 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 <bshafiei@apple.com> > > Cherry-pick r231825. rdar://problem/40278181 >diff --git a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >index cc014d4dd314998c8064887819c336d76260754a..8873c302e5163adc44fa6be30076d16a4e5f68e7 100644 >--- a/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >+++ b/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm >@@ -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,11 @@ SOFT_LINK_CLASS(QuickLook, QLItem); > _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) { >+ auto strongSelf = weakSelf.get(); >+ if (strongSelf) >+ [strongSelf setCompletionHandler:completionHandler]; > }]; > return _item.get(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ddkilzer
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185722
: 340570