Changeset 138222 in webkit


Ignore:
Timestamp:
Dec 19, 2012 9:44:54 PM (11 years ago)
Author:
Nate Chapin
Message:

REGRESSION(r137607): resource load client callbacks are not called for the main resource when loading HTML string
https://bugs.webkit.org/show_bug.cgi?id=105330

Reviewed by Brady Eidson.

  • loader/MainResourceLoader.cpp:

(WebCore::MainResourceLoader::responseReceived):
(WebCore::MainResourceLoader::dataReceived):
(WebCore::MainResourceLoader::didFinishLoading):
(WebCore::MainResourceLoader::load):
(WebCore::MainResourceLoader::identifier):

  • loader/MainResourceLoader.h:

(MainResourceLoader):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r138218 r138222  
     12012-12-19  Nate Chapin  <japhet@chromium.org>
     2
     3        REGRESSION(r137607): resource load client callbacks are not called for the main resource when loading HTML string
     4        https://bugs.webkit.org/show_bug.cgi?id=105330
     5
     6        Reviewed by Brady Eidson.
     7
     8        * loader/MainResourceLoader.cpp:
     9        (WebCore::MainResourceLoader::responseReceived):
     10        (WebCore::MainResourceLoader::dataReceived):
     11        (WebCore::MainResourceLoader::didFinishLoading):
     12        (WebCore::MainResourceLoader::load):
     13        (WebCore::MainResourceLoader::identifier):
     14        * loader/MainResourceLoader.h:
     15        (MainResourceLoader):
     16
    1172012-12-19  Cosmin Truta  <ctruta@rim.com>
    218
  • trunk/Source/WebCore/loader/MainResourceLoader.cpp

    r138012 r138222  
    7474    , m_waitingForContentPolicy(false)
    7575    , m_timeOfLastDataReceived(0.0)
     76    , m_substituteDataLoadIdentifier(0)
    7677#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
    7778    , m_filter(0)
     
    413414    m_response = r;
    414415
     416    if (!loader())
     417        frameLoader()->notifier()->dispatchDidReceiveResponse(documentLoader(), identifier(), m_response, 0);
     418
    415419    ASSERT(!m_waitingForContentPolicy);
    416420    m_waitingForContentPolicy = true;
     
    477481#endif
    478482
     483    if (!loader())
     484        frameLoader()->notifier()->dispatchDidReceiveData(documentLoader(), identifier(), data, length, -1);
     485
    479486    documentLoader()->applicationCacheHost()->mainResourceDataReceived(data, length, -1, false);
    480487
     
    513520    RefPtr<MainResourceLoader> protect(this);
    514521    RefPtr<DocumentLoader> dl = documentLoader();
     522
     523    if (!loader())
     524        frameLoader()->notifier()->dispatchDidFinishLoading(documentLoader(), identifier(), finishTime);
    515525
    516526#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
     
    635645    if (m_substituteData.isValid()) {
    636646        handleSubstituteDataLoadSoon(request);
     647        m_substituteDataLoadIdentifier = m_documentLoader->frame()->page()->progress()->createUniqueIdentifier();
     648        frameLoader()->notifier()->assignIdentifierToInitialRequest(m_substituteDataLoadIdentifier, documentLoader(), request);
     649        frameLoader()->notifier()->dispatchWillSendRequest(documentLoader(), m_substituteDataLoadIdentifier, request, ResourceResponse());
    637650        return;
    638651    }
     
    680693unsigned long MainResourceLoader::identifier() const
    681694{
     695    ASSERT(!m_substituteDataLoadIdentifier || !loader() || !loader()->identifier());
     696    if (m_substituteDataLoadIdentifier)
     697        return m_substituteDataLoadIdentifier;
    682698    if (ResourceLoader* resourceLoader = loader())
    683699        return resourceLoader->identifier();
  • trunk/Source/WebCore/loader/MainResourceLoader.h

    r137607 r138222  
    129129    bool m_waitingForContentPolicy;
    130130    double m_timeOfLastDataReceived;
     131    unsigned long m_substituteDataLoadIdentifier;
    131132
    132133#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
Note: See TracChangeset for help on using the changeset viewer.