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

Changeset 99415 in webkit


Ignore:
Timestamp:
Nov 7, 2011, 6:10:56 AM (15 years ago)
Author:
andreas.kling@nokia.com
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r99412 r99415  
     12011-11-07  Andreas Kling  <kling@webkit.org>
     2
     3        CSSImageValue: Remove inheritance from CachedImageClient.
     4        <http://webkit.org/b/71675>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        CSSImageValue doesn't actually use any of the CachedImageClient
     9        functionality, and holds a reference to the resource via the
     10        CachedResourceHandle in StyleCachedImage.
     11
     12        So we can safely remove the multiple inheritance and simplify
     13        the class.
     14
     15        * css/CSSImageValue.cpp:
     16        (WebCore::CSSImageValue::~CSSImageValue):
     17        (WebCore::CSSImageValue::cachedImage):
     18        (WebCore::CSSImageValue::clearCachedImage):
     19        * css/CSSImageValue.h:
     20
    1212011-11-07  Andreas Kling  <kling@webkit.org>
    222
  • trunk/Source/WebCore/css/CSSImageValue.cpp

    r97854 r99415  
    4646CSSImageValue::~CSSImageValue()
    4747{
    48     if (m_image && m_image->isCachedImage())
    49         static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->removeClient(this);
    5048}
    5149
     
    7472
    7573        ResourceRequest request(loader->document()->completeURL(url));
    76         if (CachedImage* cachedImage = loader->requestImage(request)) {
    77             cachedImage->addClient(this);
     74        if (CachedImage* cachedImage = loader->requestImage(request))
    7875            m_image = StyleCachedImage::create(cachedImage);
    79         }
    8076    }
    8177
     
    9288void CSSImageValue::clearCachedImage()
    9389{
    94     if (m_image && m_image->isCachedImage())
    95         static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->removeClient(this);
    9690    m_image = 0;
    9791    m_accessedImage = false;
  • trunk/Source/WebCore/css/CSSImageValue.h

    r97854 r99415  
    2323
    2424#include "CSSPrimitiveValue.h"
    25 #include "CachedImage.h"
    2625#include <wtf/RefPtr.h>
    2726
     
    3231class StyleImage;
    3332
    34 class CSSImageValue : public CSSPrimitiveValue, private CachedImageClient {
     33class CSSImageValue : public CSSPrimitiveValue {
    3534    WTF_MAKE_FAST_ALLOCATED;
    3635public:
Note: See TracChangeset for help on using the changeset viewer.