⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 157979 in webkit


Ignore:
Timestamp:
Oct 24, 2013, 6:35:45 PM (13 years ago)
Author:
akling@apple.com
Message:

DocumentLoader::cachedResourceLoader() should return a reference.
<​https://webkit.org/b/123303>

..and while we're at it, make DocumentLoader::m_cachedResourceLoader
a Ref, and have CachedResourceLoader::create return a PassRef.

Reviewed by Sam Weinig.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r157971 r157979  
     12013-10-24  Andreas Kling  <akling@apple.com>
     2
     3        DocumentLoader::cachedResourceLoader() should return a reference.
     4        <https://webkit.org/b/123303>
     5
     6        ..and while we're at it, make DocumentLoader::m_cachedResourceLoader
     7        a Ref, and have CachedResourceLoader::create return a PassRef.
     8
     9        Reviewed by Sam Weinig.
     10
    1112013-10-24  Anders Carlsson  <andersca@apple.com>
    212
  • trunk/Source/WebCore/dom/Document.cpp

    r157971 r157979  
    505505
    506506    if (m_frame)
    507         m_cachedResourceLoader = m_frame->loader().activeDocumentLoader()->cachedResourceLoader();
     507        m_cachedResourceLoader = &m_frame->loader().activeDocumentLoader()->cachedResourceLoader();
    508508    if (!m_cachedResourceLoader)
    509509        m_cachedResourceLoader = CachedResourceLoader::create(nullptr);
  • trunk/Source/WebCore/loader/DocumentLoader.h

    r157653 r157979  
    105105        ResourceRequest& request();
    106106
    107         CachedResourceLoader* cachedResourceLoader() const { return m_cachedResourceLoader.get(); }
     107        CachedResourceLoader& cachedResourceLoader() { return m_cachedResourceLoader.get(); }
    108108
    109109        const SubstituteData& substituteData() const { return m_substituteData; }
    … …  
    313313
    314314        Frame* m_frame;
    315         RefPtr<CachedResourceLoader> m_cachedResourceLoader;
     315        Ref<CachedResourceLoader> m_cachedResourceLoader;
    316316
    317317        CachedResourceHandle<CachedRawResource> m_mainResource;
  • trunk/Source/WebCore/loader/SubresourceLoader.cpp

    r156625 r157979  
    138138        }
    139139       
    140         if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url(), options())) {
     140        if (!m_documentLoader->cachedResourceLoader().canRequest(m_resource->type(), newRequest.url(), options())) {
    141141            cancel();
    142142            return;
    143143        }
    144         if (m_resource->type() == CachedResource::ImageResource && m_documentLoader->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
     144        if (m_resource->type() == CachedResource::ImageResource && m_documentLoader->cachedResourceLoader().shouldDeferImageLoad(newRequest.url())) {
    145145            cancel();
    146146            return;
    … …  
    349349
    350350    m_requestCountTracker.clear();
    351     m_documentLoader->cachedResourceLoader()->loadDone(m_resource);
     351    m_documentLoader->cachedResourceLoader().loadDone(m_resource);
    352352    if (reachedTerminalState())
    353353        return;
  • trunk/Source/WebCore/loader/cache/CachedResourceLoader.h

    r157653 r157979  
    7070
    7171public:
    72     static PassRefPtr<CachedResourceLoader> create(DocumentLoader* documentLoader) { return adoptRef(new CachedResourceLoader(documentLoader)); }
     72    static PassRef<CachedResourceLoader> create(DocumentLoader* documentLoader) { return adoptRef(*new CachedResourceLoader(documentLoader)); }
    7373    ~CachedResourceLoader();
    7474
Note: See TracChangeset for help on using the changeset viewer.