Changeset 187944 in webkit


Ignore:
Timestamp:
Aug 5, 2015 12:28:24 AM (9 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r187466 - Crash in WebCore::DocumentLoader::willSendRequest() with ContentFilter and AppCache.
<rdar://problem/21960398> and https://bugs.webkit.org/show_bug.cgi?id=147339

Reviewed by Alexey Proskuryakov.

No new tests (Not yet proven to be possible to test this).

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::willSendRequest): Grab the identifier from the CachedResource directly, not from the null ResourceLoader.
(WebCore::DocumentLoader::continueAfterNavigationPolicy): Null check the ResourceLoader, as it can definitely be gone by this point.

  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::clearLoader): Save off the identifier for later use.

  • loader/cache/CachedResource.h:

(WebCore::CachedResource::identifierForLoadWithoutResourceLoader): Expose the identifier that the ResourceLoader had when it went away.

Location:
releases/WebKitGTK/webkit-2.8/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog

    r187941 r187944  
     12015-07-27  Brady Eidson  <beidson@apple.com>
     2
     3        Crash in WebCore::DocumentLoader::willSendRequest() with ContentFilter and AppCache.
     4        <rdar://problem/21960398> and https://bugs.webkit.org/show_bug.cgi?id=147339
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        No new tests (Not yet proven to be possible to test this).
     9
     10        * loader/DocumentLoader.cpp:
     11        (WebCore::DocumentLoader::willSendRequest): Grab the identifier from the CachedResource directly, not from the null ResourceLoader.
     12        (WebCore::DocumentLoader::continueAfterNavigationPolicy): Null check the ResourceLoader, as it can definitely be gone by this point.
     13
     14        * loader/cache/CachedResource.cpp:
     15        (WebCore::CachedResource::clearLoader): Save off the identifier for later use.
     16        * loader/cache/CachedResource.h:
     17        (WebCore::CachedResource::identifierForLoadWithoutResourceLoader): Expose the identifier that the ResourceLoader had when it went away.
     18
    1192015-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/DocumentLoader.cpp

    r187832 r187944  
    554554        ASSERT(!m_substituteData.isValid());
    555555        m_applicationCacheHost->maybeLoadMainResourceForRedirect(newRequest, m_substituteData);
    556         if (m_substituteData.isValid())
    557             m_identifierForLoadWithoutResourceLoader = mainResourceLoader()->identifier();
     556        if (m_substituteData.isValid()) {
     557            RELEASE_ASSERT(m_mainResource);
     558            m_identifierForLoadWithoutResourceLoader = m_mainResource->identifierForLoadWithoutResourceLoader();
     559        }
    558560    }
    559561
     
    585587        // but prevent the ResourceLoader from sending ResourceLoadNotifier callbacks.
    586588        RefPtr<ResourceLoader> resourceLoader = mainResourceLoader();
    587         ASSERT(resourceLoader->shouldSendResourceLoadCallbacks());
    588         resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
     589        if (resourceLoader) {
     590            ASSERT(resourceLoader->shouldSendResourceLoadCallbacks());
     591            resourceLoader->setSendCallbackPolicy(DoNotSendCallbacks);
     592        }
     593
    589594        clearMainResource();
    590         resourceLoader->setSendCallbackPolicy(SendCallbacks);
     595
     596        if (resourceLoader)
     597            resourceLoader->setSendCallbackPolicy(SendCallbacks);
    591598        handleSubstituteDataLoadSoon();
    592599    }
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/cache/CachedResource.cpp

    r186342 r187944  
    406406{
    407407    ASSERT(m_loader);
     408    m_identifierForLoadWithoutResourceLoader = m_loader->identifier();
    408409    m_loader = nullptr;
    409410    deleteIfPossible();
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/loader/cache/CachedResource.h

    r186308 r187944  
    258258#endif
    259259
     260    unsigned long identifierForLoadWithoutResourceLoader() const { return m_identifierForLoadWithoutResourceLoader; }
     261
    260262protected:
    261263    void setEncodedSize(unsigned);
     
    339341
    340342    RedirectChainCacheStatus m_redirectChainCacheStatus;
     343
     344    unsigned long m_identifierForLoadWithoutResourceLoader { 0 };
    341345};
    342346
Note: See TracChangeset for help on using the changeset viewer.