Changeset 217956 in webkit


Ignore:
Timestamp:
Jun 8, 2017, 5:46:38 PM (9 years ago)
Author:
Simon Fraser
Message:

Crash under -[WKWebView _updateVisibleContentRects]
https://bugs.webkit.org/show_bug.cgi?id=173123
rdar://problem/32650112

Reviewed by Tim Horton.

Make sure the WKWebView is valid in places where we dispatch_async or use
a pre-commit handler.

Speculative fix for a rare crasher.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _isValid]):
(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r217951 r217956  
     12017-06-08  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Crash under -[WKWebView _updateVisibleContentRects]
     4        https://bugs.webkit.org/show_bug.cgi?id=173123
     5        rdar://problem/32650112
     6
     7        Reviewed by Tim Horton.
     8
     9        Make sure the WKWebView is valid in places where we dispatch_async or use
     10        a pre-commit handler.
     11
     12        Speculative fix for a rare crasher.
     13
     14        * UIProcess/API/Cocoa/WKWebView.mm:
     15        (-[WKWebView _isValid]):
     16        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
     17        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
     18
    1192017-06-07  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r217934 r217956  
    317317}
    318318
     319- (BOOL)_isValid
     320{
     321    return _page && _page->isValid();
     322}
     323
    319324#if PLATFORM(IOS)
    320325static int32_t deviceOrientationForUIInterfaceOrientation(UIInterfaceOrientation orientation)
     
    23542359    [CATransaction addCommitHandler:[retainedSelf] {
    23552360        WKWebView *webView = retainedSelf.get();
     2361        if (![webView _isValid])
     2362            return;
    23562363        [webView _updateVisibleContentRects];
    23572364        webView->_hasScheduledVisibleRectUpdate = NO;
     
    23782385    dispatch_async(dispatch_get_main_queue(), [retainedSelf = retainPtr(self)] {
    23792386        WKWebView *webView = retainedSelf.get();
     2387        if (![webView _isValid])
     2388            return;
    23802389        [webView _addUpdateVisibleContentRectPreCommitHandler];
    23812390    });
     
    37893798- (pid_t)_webProcessIdentifier
    37903799{
    3791     return _page->isValid() ? _page->processIdentifier() : 0;
     3800    if (![self _isValid])
     3801        return 0;
     3802
     3803    return _page->processIdentifier();
    37923804}
    37933805
    37943806- (void)_killWebContentProcess
    37953807{
    3796     if (!_page->isValid())
     3808    if (![self _isValid])
    37973809        return;
    37983810
Note: See TracChangeset for help on using the changeset viewer.