Changeset 231900 in webkit


Ignore:
Timestamp:
May 17, 2018 8:52:49 AM (6 years ago)
Author:
Kocsen Chung
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

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  
     12018-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
    1352018-05-16  Babak Shafiei  <bshafiei@apple.com>
    236
  • branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm

    r231858 r231900  
    3030
    3131#import "APIUIClient.h"
     32#import "WeakObjCPtr.h"
    3233#import "WebPageProxy.h"
    33 
    3434#import <MobileCoreServices/MobileCoreServices.h>
    3535#import <QuickLook/QuickLook.h>
     
    8888    [_item setUseLoadingTimeout:NO];
    8989
    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];
    9394    }];
    9495    return _item.get();
Note: See TracChangeset for help on using the changeset viewer.