Changeset 49828 in webkit


Ignore:
Timestamp:
Oct 19, 2009 6:28:44 PM (15 years ago)
Author:
abarth@webkit.org
Message:

2009-10-19 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Move sendRemainingDelegateMessages to ResourceLoadNotifier
https://bugs.webkit.org/show_bug.cgi?id=30531

This method is about notifying folks and doesn't interact with the rest
of FrameLoader.

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::willLoadMediaElementURL): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::loadResourceSynchronously): (WebCore::FrameLoader::loadedResourceFromMemoryCache):
  • loader/FrameLoader.h:
  • loader/ResourceLoadNotifier.cpp: (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
  • loader/ResourceLoadNotifier.h:
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r49827 r49828  
     12009-10-19  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Move sendRemainingDelegateMessages to ResourceLoadNotifier
     6        https://bugs.webkit.org/show_bug.cgi?id=30531
     7
     8        This method is about notifying folks and doesn't interact with the rest
     9        of FrameLoader.
     10
     11        * loader/FrameLoader.cpp:
     12        (WebCore::FrameLoader::willLoadMediaElementURL):
     13        (WebCore::FrameLoader::commitProvisionalLoad):
     14        (WebCore::FrameLoader::loadResourceSynchronously):
     15        (WebCore::FrameLoader::loadedResourceFromMemoryCache):
     16        * loader/FrameLoader.h:
     17        * loader/ResourceLoadNotifier.cpp:
     18        (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
     19        * loader/ResourceLoadNotifier.h:
     20
    1212009-10-19  Adam Barth  <abarth@webkit.org>
    222
  • trunk/WebCore/loader/FrameLoader.cpp

    r49809 r49828  
    20442044    ResourceError error;
    20452045    requestFromDelegate(request, identifier, error);
    2046     sendRemainingDelegateMessages(identifier, ResourceResponse(url, String(), -1, String(), String()), -1, error);
     2046    notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, ResourceResponse(url, String(), -1, String(), String()), -1, error);
    20472047
    20482048    url = request.url();
     
    24122412            // However, with today's computers and networking speeds, this won't happen in practice.
    24132413            // Could be an issue with a giant local file.
    2414             sendRemainingDelegateMessages(identifier, response, static_cast<int>(response.expectedContentLength()), error);
     2414            notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, static_cast<int>(response.expectedContentLength()), error);
    24152415        }
    24162416       
     
    32643264#endif
    32653265    }
    3266    
    3267     sendRemainingDelegateMessages(identifier, response, data.size(), error);
     3266
     3267    notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, response, data.size(), error);
    32683268    return identifier;
    32693269}
     
    34793479}
    34803480
    3481 void FrameLoader::sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse& response, int length, const ResourceError& error)
    3482 {   
    3483     if (!response.isNull())
    3484         notifier()->dispatchDidReceiveResponse(m_documentLoader.get(), identifier, response);
    3485    
    3486     if (length > 0)
    3487         notifier()->dispatchDidReceiveContentLength(m_documentLoader.get(), identifier, length);
    3488    
    3489     if (error.isNull())
    3490         notifier()->dispatchDidFinishLoading(m_documentLoader.get(), identifier);
    3491     else
    3492         m_client->dispatchDidFailLoading(m_documentLoader.get(), identifier, error);
    3493 }
    3494 
    34953481void FrameLoader::requestFromDelegate(ResourceRequest& request, unsigned long& identifier, ResourceError& error)
    34963482{
     
    35423528    ResourceError error;
    35433529    requestFromDelegate(request, identifier, error);
    3544     sendRemainingDelegateMessages(identifier, resource->response(), resource->encodedSize(), error);
     3530    notifier()->sendRemainingDelegateMessages(m_documentLoader.get(), identifier, resource->response(), resource->encodedSize(), error);
    35453531}
    35463532
  • trunk/WebCore/loader/FrameLoader.h

    r49809 r49828  
    404404    bool shouldReload(const KURL& currentURL, const KURL& destinationURL);
    405405
    406     void sendRemainingDelegateMessages(unsigned long identifier, const ResourceResponse&, int length, const ResourceError&);
    407406    void requestFromDelegate(ResourceRequest&, unsigned long& identifier, ResourceError&);
    408407
  • trunk/WebCore/loader/ResourceLoadNotifier.cpp

    r49671 r49828  
    166166}
    167167
     168void ResourceLoadNotifier::sendRemainingDelegateMessages(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, int length, const ResourceError& error)
     169{
     170    if (!response.isNull())
     171        dispatchDidReceiveResponse(loader, identifier, response);
     172
     173    if (length > 0)
     174        dispatchDidReceiveContentLength(loader, identifier, length);
     175
     176    if (error.isNull())
     177        dispatchDidFinishLoading(loader, identifier);
     178    else
     179        m_frame->loader()->client()->dispatchDidFailLoading(loader, identifier, error);
     180}
     181
    168182DocumentLoader* ResourceLoadNotifier::activeDocumentLoader() const
    169183{
  • trunk/WebCore/loader/ResourceLoadNotifier.h

    r49706 r49828  
    6565    void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier);
    6666
     67    void sendRemainingDelegateMessages(DocumentLoader*, unsigned long identifier, const ResourceResponse&, int length, const ResourceError&);
     68
    6769private:
    6870    inline DocumentLoader* activeDocumentLoader() const;
Note: See TracChangeset for help on using the changeset viewer.