Changeset 224960 in webkit


Ignore:
Timestamp:
Nov 16, 2017 9:49:55 PM (6 years ago)
Author:
achristensen@apple.com
Message:

Fix occasional crash when adding and removing videos
https://bugs.webkit.org/show_bug.cgi?id=179792

Reviewed by Geoffrey Garen.

In taskCompleted we null out session, and in resume we call _restart on the main thread.
If _restart is called after taskCompleted, we want to do nothing.
Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader&
but in ObjC if session is null it will call PlatformMediaResourceLoader::requestResource with a
null this pointer, which crashes. Let's not crash.

  • platform/network/cocoa/WebCoreNSURLSession.mm:

(-[WebCoreNSURLSessionDataTask _restart]):
Early return if we don't have a session.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224959 r224960  
     12017-11-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fix occasional crash when adding and removing videos
     4        https://bugs.webkit.org/show_bug.cgi?id=179792
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        In taskCompleted we null out session, and in resume we call _restart on the main thread.
     9        If _restart is called after taskCompleted, we want to do nothing.
     10        Right now we are calling a method on self.session.loader which is a PlatformMediaResourceLoader&
     11        but in ObjC if session is null it will call PlatformMediaResourceLoader::requestResource with a
     12        null this pointer, which crashes.  Let's not crash.
     13
     14        * platform/network/cocoa/WebCoreNSURLSession.mm:
     15        (-[WebCoreNSURLSessionDataTask _restart]):
     16        Early return if we don't have a session.
     17
    1182017-11-16  Don Olmstead  <don.olmstead@sony.com>
    219
  • trunk/Source/WebCore/platform/network/cocoa/WebCoreNSURLSession.mm

    r224852 r224960  
    446446{
    447447    ASSERT(isMainThread());
     448
     449    if (!self.session)
     450        return;
     451
    448452    [self _cancel];
    449453
Note: See TracChangeset for help on using the changeset viewer.