Title: [99415] trunk/Source/WebCore
Revision
99415
Author
[email protected]
Date
2011-11-07 06:10:56 -0800 (Mon, 07 Nov 2011)

Log Message

CSSImageValue: Remove inheritance from CachedImageClient.
<http://webkit.org/b/71675>

Reviewed by Antti Koivisto.

CSSImageValue doesn't actually use any of the CachedImageClient
functionality, and holds a reference to the resource via the
CachedResourceHandle in StyleCachedImage.

So we can safely remove the multiple inheritance and simplify
the class.

* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::~CSSImageValue):
(WebCore::CSSImageValue::cachedImage):
(WebCore::CSSImageValue::clearCachedImage):
* css/CSSImageValue.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (99414 => 99415)


--- trunk/Source/WebCore/ChangeLog	2011-11-07 14:09:57 UTC (rev 99414)
+++ trunk/Source/WebCore/ChangeLog	2011-11-07 14:10:56 UTC (rev 99415)
@@ -1,5 +1,25 @@
 2011-11-07  Andreas Kling  <[email protected]>
 
+        CSSImageValue: Remove inheritance from CachedImageClient.
+        <http://webkit.org/b/71675>
+
+        Reviewed by Antti Koivisto.
+
+        CSSImageValue doesn't actually use any of the CachedImageClient
+        functionality, and holds a reference to the resource via the
+        CachedResourceHandle in StyleCachedImage.
+
+        So we can safely remove the multiple inheritance and simplify
+        the class.
+
+        * css/CSSImageValue.cpp:
+        (WebCore::CSSImageValue::~CSSImageValue):
+        (WebCore::CSSImageValue::cachedImage):
+        (WebCore::CSSImageValue::clearCachedImage):
+        * css/CSSImageValue.h:
+
+2011-11-07  Andreas Kling  <[email protected]>
+
         CSSPrimitiveValue: Remove unused virtual function parseString().
         <http://webkit.org/b/71671>
 

Modified: trunk/Source/WebCore/css/CSSImageValue.cpp (99414 => 99415)


--- trunk/Source/WebCore/css/CSSImageValue.cpp	2011-11-07 14:09:57 UTC (rev 99414)
+++ trunk/Source/WebCore/css/CSSImageValue.cpp	2011-11-07 14:10:56 UTC (rev 99415)
@@ -45,8 +45,6 @@
 
 CSSImageValue::~CSSImageValue()
 {
-    if (m_image && m_image->isCachedImage())
-        static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->removeClient(this);
 }
 
 StyleImage* CSSImageValue::cachedOrPendingImage()
@@ -73,10 +71,8 @@
         m_accessedImage = true;
 
         ResourceRequest request(loader->document()->completeURL(url));
-        if (CachedImage* cachedImage = loader->requestImage(request)) {
-            cachedImage->addClient(this);
+        if (CachedImage* cachedImage = loader->requestImage(request))
             m_image = StyleCachedImage::create(cachedImage);
-        }
     }
 
     return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*>(m_image.get()) : 0;
@@ -91,8 +87,6 @@
 
 void CSSImageValue::clearCachedImage()
 {
-    if (m_image && m_image->isCachedImage())
-        static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->removeClient(this);
     m_image = 0;
     m_accessedImage = false;
 }

Modified: trunk/Source/WebCore/css/CSSImageValue.h (99414 => 99415)


--- trunk/Source/WebCore/css/CSSImageValue.h	2011-11-07 14:09:57 UTC (rev 99414)
+++ trunk/Source/WebCore/css/CSSImageValue.h	2011-11-07 14:10:56 UTC (rev 99415)
@@ -22,7 +22,6 @@
 #define CSSImageValue_h
 
 #include "CSSPrimitiveValue.h"
-#include "CachedImage.h"
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
@@ -31,7 +30,7 @@
 class StyleCachedImage;
 class StyleImage;
 
-class CSSImageValue : public CSSPrimitiveValue, private CachedImageClient {
+class CSSImageValue : public CSSPrimitiveValue {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     static PassRefPtr<CSSImageValue> create() { return adoptRef(new CSSImageValue); }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to