Changeset 213206 in webkit


Ignore:
Timestamp:
Feb 28, 2017 11:34:15 PM (7 years ago)
Author:
Carlos Garcia Campos
Message:

NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
https://bugs.webkit.org/show_bug.cgi?id=168963

Reviewed by Antti Koivisto.

This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
by didComplete(), and the willSendRequest completion handler does nothing when the request is null.

  • NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:

(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r213198 r213206  
     12017-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        NetworkProcess aborts in WebKit::NetworkLoad::didCompleteWithError at Source/WebKit2/NetworkProcess/NetworkLoad.cpp:423
     4        https://bugs.webkit.org/show_bug.cgi?id=168963
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This is trying to call SpeculativeLoad::didFailLoading() after SpeculativeLoad has already been
     9        completed. SpeculativeLoad::didComplete() call its completion handler that removes the load from
     10        m_pendingPreloads. When the completion handler returns the SpeculativeLoad is deleted. So, we should always
     11        ensure that SpeculativeLoad is not used after didComplete() call. In SpeculativeLoad::willSendRedirectedRequest(),
     12        the call to NetworkLoad::continueWillSendRequest() causes SpeculativeLoad::didFailLoading() to be called. We
     13        don't really need to call continueWillSendRequest() though, since the network load is going to be deleted anyway
     14        by didComplete(), and the willSendRequest completion handler does nothing when the request is null.
     15
     16        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
     17        (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
     18
    1192017-02-28  Alexey Proskuryakov  <ap@apple.com>
    220
  • trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp

    r212993 r213206  
    7777        m_cacheEntry = NetworkCache::singleton().makeRedirectEntry(request, redirectResponse, redirectRequest);
    7878
    79     auto load = WTFMove(m_networkLoad);
    80 
    8179    // Don't follow the redirect. The redirect target will be registered for speculative load when it is loaded.
    8280    didComplete();
    83 
    84     // This causes call to didFailLoading().
    85     if (load)
    86         load->continueWillSendRequest({ });
    8781}
    8882
Note: See TracChangeset for help on using the changeset viewer.