Title: [157979] trunk/Source/WebCore
Revision
157979
Author
[email protected]
Date
2013-10-24 18:35:45 -0700 (Thu, 24 Oct 2013)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (157978 => 157979)


--- trunk/Source/WebCore/ChangeLog	2013-10-25 01:34:56 UTC (rev 157978)
+++ trunk/Source/WebCore/ChangeLog	2013-10-25 01:35:45 UTC (rev 157979)
@@ -1,3 +1,13 @@
+2013-10-24  Andreas Kling  <[email protected]>
+
+        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.
+
 2013-10-24  Anders Carlsson  <[email protected]>
 
         Stop bringing in the std namespace

Modified: trunk/Source/WebCore/dom/Document.cpp (157978 => 157979)


--- trunk/Source/WebCore/dom/Document.cpp	2013-10-25 01:34:56 UTC (rev 157978)
+++ trunk/Source/WebCore/dom/Document.cpp	2013-10-25 01:35:45 UTC (rev 157979)
@@ -504,7 +504,7 @@
         setURL(url);
 
     if (m_frame)
-        m_cachedResourceLoader = m_frame->loader().activeDocumentLoader()->cachedResourceLoader();
+        m_cachedResourceLoader = &m_frame->loader().activeDocumentLoader()->cachedResourceLoader();
     if (!m_cachedResourceLoader)
         m_cachedResourceLoader = CachedResourceLoader::create(nullptr);
     m_cachedResourceLoader->setDocument(this);

Modified: trunk/Source/WebCore/loader/DocumentLoader.h (157978 => 157979)


--- trunk/Source/WebCore/loader/DocumentLoader.h	2013-10-25 01:34:56 UTC (rev 157978)
+++ trunk/Source/WebCore/loader/DocumentLoader.h	2013-10-25 01:35:45 UTC (rev 157979)
@@ -104,7 +104,7 @@
         const ResourceRequest& request() const;
         ResourceRequest& request();
 
-        CachedResourceLoader* cachedResourceLoader() const { return m_cachedResourceLoader.get(); }
+        CachedResourceLoader& cachedResourceLoader() { return m_cachedResourceLoader.get(); }
 
         const SubstituteData& substituteData() const { return m_substituteData; }
 
@@ -312,7 +312,7 @@
         void clearMainResource();
 
         Frame* m_frame;
-        RefPtr<CachedResourceLoader> m_cachedResourceLoader;
+        Ref<CachedResourceLoader> m_cachedResourceLoader;
 
         CachedResourceHandle<CachedRawResource> m_mainResource;
         ResourceLoaderSet m_subresourceLoaders;

Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (157978 => 157979)


--- trunk/Source/WebCore/loader/SubresourceLoader.cpp	2013-10-25 01:34:56 UTC (rev 157978)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp	2013-10-25 01:35:45 UTC (rev 157979)
@@ -137,11 +137,11 @@
             memoryCache()->revalidationFailed(m_resource);
         }
         
-        if (!m_documentLoader->cachedResourceLoader()->canRequest(m_resource->type(), newRequest.url(), options())) {
+        if (!m_documentLoader->cachedResourceLoader().canRequest(m_resource->type(), newRequest.url(), options())) {
             cancel();
             return;
         }
-        if (m_resource->type() == CachedResource::ImageResource && m_documentLoader->cachedResourceLoader()->shouldDeferImageLoad(newRequest.url())) {
+        if (m_resource->type() == CachedResource::ImageResource && m_documentLoader->cachedResourceLoader().shouldDeferImageLoad(newRequest.url())) {
             cancel();
             return;
         }
@@ -348,7 +348,7 @@
         return;
 
     m_requestCountTracker.clear();
-    m_documentLoader->cachedResourceLoader()->loadDone(m_resource);
+    m_documentLoader->cachedResourceLoader().loadDone(m_resource);
     if (reachedTerminalState())
         return;
     m_documentLoader->removeSubresourceLoader(this);

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (157978 => 157979)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h	2013-10-25 01:34:56 UTC (rev 157978)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h	2013-10-25 01:35:45 UTC (rev 157979)
@@ -69,7 +69,7 @@
 friend class ResourceCacheValidationSuppressor;
 
 public:
-    static PassRefPtr<CachedResourceLoader> create(DocumentLoader* documentLoader) { return adoptRef(new CachedResourceLoader(documentLoader)); }
+    static PassRef<CachedResourceLoader> create(DocumentLoader* documentLoader) { return adoptRef(*new CachedResourceLoader(documentLoader)); }
     ~CachedResourceLoader();
 
     CachedResourceHandle<CachedImage> requestImage(CachedResourceRequest&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to