<rdar://problem/13886443> Assertion failures in NetworkProcess in SandboxExte...
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jul 2013 20:38:41 +0000 (20:38 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jul 2013 20:38:41 +0000 (20:38 +0000)
commit6ab963458e4e7f3c796caff32101831aacd8a9bb
tree4a3c40f67736077dfebdf40a5ce76e2a4143b37f
parent162a66c18fa3cdd01d6749eebc429026b6ac8cdc
    <rdar://problem/13886443> Assertion failures in NetworkProcess in SandboxExtension::revoke when aborting SyncNetworkResourceLoader
        <rdar://problem/13826348> ASSERT(!m_useCount) fails in NetworkProcess at SandboxExtension::~SandboxExtension
        https://bugs.webkit.org/show_bug.cgi?id=118855

        Reviewed by Brady Eidson.

        * NetworkProcess/NetworkResourceLoader.cpp:
        (WebKit::NetworkResourceLoader::cleanup):
        (WebKit::NetworkResourceLoader::didFinishLoading):
        (WebKit::NetworkResourceLoader::didFail):
        Moved sandbox extension invalidation to cleanup() meaning that we won't fail to
        do this when aborting a loader that currently loading from network.

        * NetworkProcess/SchedulableLoader.cpp:
        (WebKit::SchedulableLoader::SchedulableLoader):
        (WebKit::SchedulableLoader::consumeSandboxExtensions):
        (WebKit::SchedulableLoader::invalidateSandboxExtensions):
        * NetworkProcess/SchedulableLoader.h:
        Keep track of whether sandbox extensions are consumed, we don't want to revoke
        extensions that were never consumed (as used to be the case with sync loaders,
        and would be with async ones after the above fix). Also, get rid of extensions
        immediately when invalidating, we won't need them again.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/SchedulableLoader.cpp
Source/WebKit2/NetworkProcess/SchedulableLoader.h