Commit 2c814c47 authored by hyatt@apple.com's avatar hyatt@apple.com

WebCore:

2008-04-11  David Hyatt  <hyatt@apple.com>

        Rename CachedResource's ref/deref methods to addClient/removeClient.  This matches the new
        StyleImage class and is a more accurate description of what those methods really do.

        Reviewed by olliej

        * WebCore.base.exp:
        * css/CSSCursorImageValue.cpp:
        (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::CSSFontFaceSource):
        (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::~CSSImageValue):
        (WebCore::CSSImageValue::image):
        * css/CSSImportRule.cpp:
        (WebCore::CSSImportRule::~CSSImportRule):
        (WebCore::CSSImportRule::insertedIntoParent):
        * dom/ProcessingInstruction.cpp:
        (WebCore::ProcessingInstruction::~ProcessingInstruction):
        (WebCore::ProcessingInstruction::checkStyleSheet):
        (WebCore::ProcessingInstruction::parseStyleSheet):
        * dom/XMLTokenizer.cpp:
        (WebCore::XMLTokenizer::~XMLTokenizer):
        (WebCore::XMLTokenizer::endElementNs):
        (WebCore::XMLTokenizer::notifyFinished):
        * html/CanvasPattern.cpp:
        (WebCore::CanvasPattern::CanvasPattern):
        (WebCore::CanvasPattern::~CanvasPattern):
        * html/HTMLImageLoader.cpp:
        (WebCore::HTMLImageLoader::~HTMLImageLoader):
        (WebCore::HTMLImageLoader::setImage):
        (WebCore::HTMLImageLoader::updateFromElement):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::~HTMLLinkElement):
        (WebCore::HTMLLinkElement::process):
        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::~HTMLScriptElement):
        (WebCore::HTMLScriptElement::parseMappedAttribute):
        (WebCore::HTMLScriptElement::insertedIntoDocument):
        (WebCore::HTMLScriptElement::removedFromDocument):
        (WebCore::HTMLScriptElement::notifyFinished):
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::reset):
        (WebCore::HTMLTokenizer::scriptHandler):
        (WebCore::HTMLTokenizer::notifyFinished):
        * loader/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::addClient):
        * loader/CachedCSSStyleSheet.h:
        * loader/CachedFont.cpp:
        (WebCore::CachedFont::addClient):
        * loader/CachedFont.h:
        * loader/CachedImage.cpp:
        (WebCore::CachedImage::addClient):
        * loader/CachedImage.h:
        * loader/CachedResource.cpp:
        (WebCore::CachedResource::addClient):
        (WebCore::CachedResource::removeClient):
        * loader/CachedResource.h:
        * loader/CachedScript.cpp:
        (WebCore::CachedScript::addClient):
        * loader/CachedScript.h:
        * loader/CachedXBLDocument.h:
        * loader/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::addClient):
        * loader/CachedXSLStyleSheet.h:
        * loader/mac/UserStyleSheetLoader.cpp:
        (UserStyleSheetLoader::UserStyleSheetLoader):
        (UserStyleSheetLoader::~UserStyleSheetLoader):
        * platform/mac/ClipboardMac.mm:
        (WebCore::ClipboardMac::setDragImage):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::~RenderImage):
        (WebCore::RenderImage::setCachedImage):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::~RenderListMarker):
        (WebCore::RenderListMarker::setStyle):
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::updateBackgroundImages):
        (WebCore::RenderObject::arenaDelete):
        * rendering/RenderStyle.cpp:
        (WebCore::StyleCachedImage::addClient):
        (WebCore::StyleCachedImage::removeClient):
        * svg/SVGImageLoader.cpp:
        (WebCore::SVGImageLoader::updateFromElement):
        * xml/XSLImportRule.cpp:
        (WebCore::XSLImportRule::~XSLImportRule):
        (WebCore::XSLImportRule::loadSheet):

WebKit/mac:

2008-04-11  David Hyatt  <hyatt@apple.com>

        Rename CachedResource ref/deref methods to addClient/removeClient.

        Reviewed by olliej

        * WebView/WebHTMLView.mm:
        (-[WebHTMLViewPrivate dealloc]):
        (-[WebHTMLViewPrivate finalize]):
        (-[WebHTMLViewPrivate clear]):
        (-[WebHTMLView setPromisedDragTIFFDataSource:WebCore::]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bd04d32b
2008-04-11 David Hyatt <hyatt@apple.com>
Rename CachedResource's ref/deref methods to addClient/removeClient. This matches the new
StyleImage class and is a more accurate description of what those methods really do.
Reviewed by olliej
* WebCore.base.exp:
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource):
(WebCore::CSSFontFaceSource::~CSSFontFaceSource):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::~CSSImageValue):
(WebCore::CSSImageValue::image):
* css/CSSImportRule.cpp:
(WebCore::CSSImportRule::~CSSImportRule):
(WebCore::CSSImportRule::insertedIntoParent):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::parseStyleSheet):
* dom/XMLTokenizer.cpp:
(WebCore::XMLTokenizer::~XMLTokenizer):
(WebCore::XMLTokenizer::endElementNs):
(WebCore::XMLTokenizer::notifyFinished):
* html/CanvasPattern.cpp:
(WebCore::CanvasPattern::CanvasPattern):
(WebCore::CanvasPattern::~CanvasPattern):
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::~HTMLImageLoader):
(WebCore::HTMLImageLoader::setImage):
(WebCore::HTMLImageLoader::updateFromElement):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::process):
* html/HTMLScriptElement.cpp:
(WebCore::HTMLScriptElement::~HTMLScriptElement):
(WebCore::HTMLScriptElement::parseMappedAttribute):
(WebCore::HTMLScriptElement::insertedIntoDocument):
(WebCore::HTMLScriptElement::removedFromDocument):
(WebCore::HTMLScriptElement::notifyFinished):
* html/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::reset):
(WebCore::HTMLTokenizer::scriptHandler):
(WebCore::HTMLTokenizer::notifyFinished):
* loader/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::addClient):
* loader/CachedCSSStyleSheet.h:
* loader/CachedFont.cpp:
(WebCore::CachedFont::addClient):
* loader/CachedFont.h:
* loader/CachedImage.cpp:
(WebCore::CachedImage::addClient):
* loader/CachedImage.h:
* loader/CachedResource.cpp:
(WebCore::CachedResource::addClient):
(WebCore::CachedResource::removeClient):
* loader/CachedResource.h:
* loader/CachedScript.cpp:
(WebCore::CachedScript::addClient):
* loader/CachedScript.h:
* loader/CachedXBLDocument.h:
* loader/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::addClient):
* loader/CachedXSLStyleSheet.h:
* loader/mac/UserStyleSheetLoader.cpp:
(UserStyleSheetLoader::UserStyleSheetLoader):
(UserStyleSheetLoader::~UserStyleSheetLoader):
* platform/mac/ClipboardMac.mm:
(WebCore::ClipboardMac::setDragImage):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::~RenderImage):
(WebCore::RenderImage::setCachedImage):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::~RenderListMarker):
(WebCore::RenderListMarker::setStyle):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::updateBackgroundImages):
(WebCore::RenderObject::arenaDelete):
* rendering/RenderStyle.cpp:
(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::updateFromElement):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::~XSLImportRule):
(WebCore::XSLImportRule::loadSheet):
2008-04-11 David Hyatt <hyatt@apple.com>
This patch adds support for CSS gradients as background images. RenderStyles now hold a StyleImage
......@@ -265,7 +265,7 @@ __ZN7WebCore13KeyboardEventC1ERKNS_12AtomicStringEbbPNS_9DOMWindowERKNS_6StringE
__ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
__ZN7WebCore13toJSDOMWindowEPNS_5FrameE
__ZN7WebCore14CachedResource5derefEPNS_20CachedResourceClientE
__ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE
__ZN7WebCore14DocumentLoader13attachToFrameEv
__ZN7WebCore14DocumentLoader15detachFromFrameEv
__ZN7WebCore14DocumentLoader18addArchiveResourceEN3WTF10PassRefPtrINS_15ArchiveResourceEEE
......
......@@ -97,7 +97,7 @@ bool CSSCursorImageValue::updateIfSVGCursorIsUsed(Element* element)
m_hotspot.setY(y);
if (m_image && m_image->url() != element->document()->completeURL(cursorElement->href())) {
m_image->deref(this);
m_image->removeClient(this);
m_image = 0;
m_accessedImage = false;
......
......@@ -51,13 +51,13 @@ CSSFontFaceSource::CSSFontFaceSource(const String& str, CachedFont* font)
, m_face(0)
{
if (m_font)
m_font->ref(this);
m_font->addClient(this);
}
CSSFontFaceSource::~CSSFontFaceSource()
{
if (m_font)
m_font->deref(this);
m_font->removeClient(this);
pruneTable();
}
......
......@@ -45,7 +45,7 @@ CSSImageValue::CSSImageValue()
CSSImageValue::~CSSImageValue()
{
if (m_image)
m_image->deref(this);
m_image->removeClient(this);
}
CachedImage* CSSImageValue::image(DocLoader* loader)
......@@ -66,7 +66,7 @@ CachedImage* CSSImageValue::image(DocLoader* loader, const String& url)
}
if (m_image)
m_image->ref(this);
m_image->addClient(this);
}
return m_image;
......
......@@ -52,7 +52,7 @@ CSSImportRule::~CSSImportRule()
if (m_styleSheet)
m_styleSheet->setParent(0);
if (m_cachedSheet)
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
}
void CSSImportRule::setCSSStyleSheet(const String& url, const String& charset, const CachedCSSStyleSheet* sheet)
......@@ -107,7 +107,7 @@ void CSSImportRule::insertedIntoParent()
if (parentSheet && parentSheet->loadCompleted() && parentSheet->doc())
parentSheet->doc()->addPendingSheet();
m_loading = true;
m_cachedSheet->ref(this);
m_cachedSheet->addClient(this);
}
}
......
......@@ -61,7 +61,7 @@ ProcessingInstruction::ProcessingInstruction(Document* doc, const String& target
ProcessingInstruction::~ProcessingInstruction()
{
if (m_cachedSheet)
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
}
void ProcessingInstruction::setData(const String& data, ExceptionCode& ec)
......@@ -160,7 +160,7 @@ bool ProcessingInstruction::checkStyleSheet()
m_loading = true;
document()->addPendingSheet();
if (m_cachedSheet)
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
#if ENABLE(XSLT)
if (m_isXSL)
m_cachedSheet = document()->docLoader()->requestXSLStyleSheet(document()->completeURL(href).string());
......@@ -174,7 +174,7 @@ bool ProcessingInstruction::checkStyleSheet()
m_cachedSheet = document()->docLoader()->requestCSSStyleSheet(document()->completeURL(href).string(), charset);
}
if (m_cachedSheet)
m_cachedSheet->ref(this);
m_cachedSheet->addClient(this);
#if ENABLE(XSLT)
return !m_isXSL;
#endif
......@@ -228,7 +228,7 @@ void ProcessingInstruction::parseStyleSheet(const String& sheet)
{
m_sheet->parseString(sheet, true);
if (m_cachedSheet)
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
m_cachedSheet = 0;
m_loading = false;
......
......@@ -591,7 +591,7 @@ XMLTokenizer::~XMLTokenizer()
if (m_parsingFragment && m_doc)
m_doc->deref();
if (m_pendingScript)
m_pendingScript->deref(this);
m_pendingScript->removeClient(this);
#if defined(USE_QXMLSTREAM) && QT_VERSION >= 0x040400
delete m_stream.entityResolver();
#endif
......@@ -854,7 +854,7 @@ void XMLTokenizer::endElementNs()
const AtomicString& charset = scriptElement->getAttribute(charsetAttr);
if ((m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, charset))) {
m_scriptElement = scriptElement;
m_pendingScript->ref(this);
m_pendingScript->addClient(this);
// m_pendingScript will be 0 if script was already loaded and ref() executed it
if (m_pendingScript)
......@@ -1418,7 +1418,7 @@ void XMLTokenizer::notifyFinished(CachedResource* finishedObj)
String cachedScriptUrl = m_pendingScript->url();
String scriptSource = m_pendingScript->script();
bool errorOccurred = m_pendingScript->errorOccurred();
m_pendingScript->deref(this);
m_pendingScript->removeClient(this);
m_pendingScript = 0;
RefPtr<Element> e = m_scriptElement;
......
......@@ -100,7 +100,7 @@ CanvasPattern::CanvasPattern(CachedImage* cachedImage, bool repeatX, bool repeat
, m_originClean(originClean)
{
if (cachedImage)
cachedImage->ref(this);
cachedImage->addClient(this);
}
CanvasPattern::~CanvasPattern()
......@@ -110,7 +110,7 @@ CanvasPattern::~CanvasPattern()
cairo_surface_destroy(m_platformImage);
#endif
if (m_cachedImage)
m_cachedImage->deref(this);
m_cachedImage->removeClient(this);
}
#if PLATFORM(CG)
......
......@@ -51,7 +51,7 @@ HTMLImageLoader::HTMLImageLoader(Element* elt)
HTMLImageLoader::~HTMLImageLoader()
{
if (m_image)
m_image->deref(this);
m_image->removeClient(this);
m_element->document()->removeImage(this);
}
......@@ -63,9 +63,9 @@ void HTMLImageLoader::setImage(CachedImage *newImage)
m_firedLoad = true;
m_imageComplete = true;
if (newImage)
newImage->ref(this);
newImage->addClient(this);
if (oldImage)
oldImage->deref(this);
oldImage->removeClient(this);
}
if (RenderObject* renderer = element()->renderer())
......@@ -112,9 +112,9 @@ void HTMLImageLoader::updateFromElement()
#endif
setLoadingImage(newImage);
if (newImage)
newImage->ref(this);
newImage->addClient(this);
if (oldImage)
oldImage->deref(this);
oldImage->removeClient(this);
}
if (RenderObject* renderer = elem->renderer())
......
......@@ -52,7 +52,7 @@ HTMLLinkElement::HTMLLinkElement(Document *doc)
HTMLLinkElement::~HTMLLinkElement()
{
if (m_cachedSheet) {
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
if (m_loading && !isDisabled() && !isAlternate())
document()->removePendingSheet();
}
......@@ -190,12 +190,12 @@ void HTMLLinkElement::process()
if (m_cachedSheet) {
if (m_loading)
document()->removePendingSheet();
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
}
m_loading = true;
m_cachedSheet = document()->docLoader()->requestCSSStyleSheet(m_url, chset);
if (m_cachedSheet)
m_cachedSheet->ref(this);
m_cachedSheet->addClient(this);
else if (!isAlternate()) { // request may have been denied if stylesheet is local and document is remote.
m_loading = false;
document()->removePendingSheet();
......
......@@ -50,7 +50,7 @@ HTMLScriptElement::HTMLScriptElement(Document* doc)
HTMLScriptElement::~HTMLScriptElement()
{
if (m_cachedScript)
m_cachedScript->deref(this);
m_cachedScript->removeClient(this);
}
bool HTMLScriptElement::isURLAttribute(Attribute* attr) const
......@@ -84,7 +84,7 @@ void HTMLScriptElement::parseMappedAttribute(MappedAttribute* attr)
if (!url.isEmpty()) {
m_cachedScript = document()->docLoader()->requestScript(url, scriptCharset());
if (m_cachedScript)
m_cachedScript->ref(this);
m_cachedScript->addClient(this);
else
dispatchHTMLEvent(errorEvent, true, false);
}
......@@ -122,7 +122,7 @@ void HTMLScriptElement::insertedIntoDocument()
if (!url.isEmpty()) {
m_cachedScript = document()->docLoader()->requestScript(url, scriptCharset());
if (m_cachedScript)
m_cachedScript->ref(this);
m_cachedScript->addClient(this);
else
dispatchHTMLEvent(errorEvent, true, false);
return;
......@@ -141,7 +141,7 @@ void HTMLScriptElement::removedFromDocument()
HTMLElement::removedFromDocument();
if (m_cachedScript) {
m_cachedScript->deref(this);
m_cachedScript->removeClient(this);
m_cachedScript = 0;
}
}
......@@ -165,7 +165,7 @@ void HTMLScriptElement::notifyFinished(CachedResource* o)
// script evaluation may have dereffed it already
if (m_cachedScript) {
m_cachedScript->deref(this);
m_cachedScript->removeClient(this);
m_cachedScript = 0;
}
}
......
......@@ -213,7 +213,7 @@ void HTMLTokenizer::reset()
while (!pendingScripts.isEmpty()) {
CachedScript *cs = pendingScripts.dequeue();
ASSERT(cache()->disabled() || cs->accessCount() > 0);
cs->deref(this);
cs->removeClient(this);
}
fastFree(buffer);
......@@ -465,7 +465,7 @@ HTMLTokenizer::State HTMLTokenizer::scriptHandler(State state)
m_state = state;
bool savedRequestingScript = m_requestingScript;
m_requestingScript = true;
cs->ref(this);
cs->addClient(this);
m_requestingScript = savedRequestingScript;
state = m_state;
// will be 0 if script was already loaded and ref() executed it
......@@ -1972,7 +1972,7 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
// infinite recursion might happen otherwise
String cachedScriptUrl(cs->url());
bool errorOccurred = cs->errorOccurred();
cs->deref(this);
cs->removeClient(this);
RefPtr<Node> n = scriptNode.release();
#ifdef INSTRUMENT_LAYOUT_SCHEDULING
......
......@@ -49,9 +49,9 @@ CachedCSSStyleSheet::~CachedCSSStyleSheet()
{
}
void CachedCSSStyleSheet::ref(CachedResourceClient *c)
void CachedCSSStyleSheet::addClient(CachedResourceClient *c)
{
CachedResource::ref(c);
CachedResource::addClient(c);
if (!m_loading)
c->setCSSStyleSheet(m_url, m_decoder->encoding().name(), this);
......
......@@ -44,7 +44,7 @@ namespace WebCore {
const String sheetText(bool strict = true) const { return canUseSheet(strict) ? m_sheet : ""; }
virtual void ref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
virtual void setEncoding(const String&);
virtual String encoding() const;
......
......@@ -71,9 +71,9 @@ void CachedFont::load(DocLoader* docLoader)
m_loading = true;
}
void CachedFont::ref(CachedResourceClient* c)
void CachedFont::addClient(CachedResourceClient* c)
{
CachedResource::ref(c);
CachedResource::addClient(c);
if (!m_loading)
c->fontLoaded(this);
......
......@@ -50,7 +50,7 @@ public:
virtual void load(DocLoader* docLoader);
virtual void ref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
virtual void error();
......
......@@ -74,9 +74,9 @@ void CachedImage::load(DocLoader* docLoader)
m_loading = false;
}
void CachedImage::ref(CachedResourceClient* c)
void CachedImage::addClient(CachedResourceClient* c)
{
CachedResource::ref(c);
CachedResource::addClient(c);
if (m_image && !m_image->rect().isEmpty())
c->imageChanged(this);
......
......@@ -59,7 +59,7 @@ public:
IntSize imageSize(float multiplier) const; // returns the size of the complete image.
IntRect imageRect(float multiplier) const; // The size of the currently decoded portion of the image.
virtual void ref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
virtual void allReferencesRemoved();
virtual void destroyDecodedData();
......
......@@ -111,7 +111,7 @@ void CachedResource::setRequest(Request* request)
delete this;
}
void CachedResource::ref(CachedResourceClient *c)
void CachedResource::addClient(CachedResourceClient *c)
{
if (m_preloadResult == PreloadNotReferenced) {
if (isLoaded())
......@@ -126,7 +126,7 @@ void CachedResource::ref(CachedResourceClient *c)
m_clients.add(c);
}
void CachedResource::deref(CachedResourceClient *c)
void CachedResource::removeClient(CachedResourceClient *c)
{
ASSERT(m_clients.contains(c));
m_clients.remove(c);
......
......@@ -80,8 +80,8 @@ public:
const String &url() const { return m_url; }
Type type() const { return m_type; }
virtual void ref(CachedResourceClient*);
void deref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
void removeClient(CachedResourceClient*);
bool referenced() const { return !m_clients.isEmpty(); }
enum PreloadResult {
......
......@@ -53,9 +53,9 @@ CachedScript::~CachedScript()
{
}
void CachedScript::ref(CachedResourceClient* c)
void CachedScript::addClient(CachedResourceClient* c)
{
CachedResource::ref(c);
CachedResource::addClient(c);
if (!m_loading)
c->notifyFinished(this);
}
......
......@@ -42,7 +42,7 @@ namespace WebCore {
const String& script() const { return m_script; }
virtual void ref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
virtual void setEncoding(const String&);
virtual String encoding() const;
......
......@@ -46,7 +46,7 @@ namespace WebCore {
XBL::XBLDocument* document() const { return m_document; }
virtual void ref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
virtual void setEncoding(const String&);
virtual String encoding() const;
......
......@@ -49,9 +49,9 @@ CachedXSLStyleSheet::CachedXSLStyleSheet(const String &url)
setAccept("text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml");
}
void CachedXSLStyleSheet::ref(CachedResourceClient *c)
void CachedXSLStyleSheet::addClient(CachedResourceClient *c)
{
CachedResource::ref(c);
CachedResource::addClient(c);
if (!m_loading)
c->setXSLStyleSheet(m_url, m_sheet);
......
......@@ -43,7 +43,7 @@ namespace WebCore {
const String& sheet() const { return m_sheet; }
virtual void ref(CachedResourceClient*);
virtual void addClient(CachedResourceClient*);
virtual void setEncoding(const String&);
virtual String encoding() const;
......
......@@ -41,7 +41,7 @@ UserStyleSheetLoader::UserStyleSheetLoader(PassRefPtr<Document> document, const
{
if (m_cachedSheet) {
m_document->addPendingSheet();
m_cachedSheet->ref(this);
m_cachedSheet->addClient(this);
}
}
......@@ -50,7 +50,7 @@ UserStyleSheetLoader::~UserStyleSheetLoader()
if (m_cachedSheet) {
if (!m_cachedSheet->isLoaded())
m_document->removePendingSheet();
m_cachedSheet->deref(this);
m_cachedSheet->removeClient(this);
}
}
......
......@@ -275,10 +275,10 @@ void ClipboardMac::setDragImage(CachedImage* image, Node *node, const IntPoint &
{
if (policy() == ClipboardImageWritable || policy() == ClipboardWritable) {
if (m_dragImage)
m_dragImage->deref(this);
m_dragImage->removeClient(this);
m_dragImage = image;
if (m_dragImage)
m_dragImage->ref(this);
m_dragImage->addClient(this);
m_dragLoc = loc;
m_dragImageElement = node;
......
......@@ -54,7 +54,7 @@ RenderImage::RenderImage(Node* node)
RenderImage::~RenderImage()
{
if (m_cachedImage)
m_cachedImage->deref(this);
m_cachedImage->removeClient(this);
}
void RenderImage::setCachedImage(CachedImage* newImage)
......@@ -62,10 +62,10 @@ void RenderImage::setCachedImage(CachedImage* newImage)
if (m_isAnonymousImage || m_cachedImage == newImage)
return;
if (m_cachedImage)
m_cachedImage->deref(this);
m_cachedImage->removeClient(this);
m_cachedImage = newImage;
if (m_cachedImage) {
m_cachedImage->ref(this);
m_cachedImage->addClient(this);
if (m_cachedImage->errorOccurred())
imageChanged(m_cachedImage);
}
......
......@@ -483,7 +483,7 @@ RenderListMarker::RenderListMarker(RenderListItem* item)
RenderListMarker::~RenderListMarker()
{
if (m_image)
m_image->deref(this);
m_image->removeClient(this);
}
void RenderListMarker::setStyle(RenderStyle* s)
......@@ -495,10 +495,10 @@ void RenderListMarker::setStyle(RenderStyle* s)
if (m_image != style()->listStyleImage()) {
if (m_image)
m_image->deref(this);
m_image->removeClient(this);
m_image = style()->listStyleImage();
if (m_image)
m_image->ref(this);
m_image->addClient(this);
}
}
......
......@@ -2287,9 +2287,9 @@ void RenderObject::updateBackgroundImages(RenderStyle* oldStyle)
CachedImage* newBorderImage = m_style ? m_style->borderImage().image() : 0;
if (oldBorderImage != newBorderImage) {
if (oldBorderImage)
oldBorderImage->deref(this);
oldBorderImage->removeClient(this);
if (newBorderImage)
newBorderImage->ref(this);
newBorderImage->addClient(this);
}
}
......@@ -2484,7 +2484,7 @@ void RenderObject::arenaDelete(RenderArena* arena, void* base)
}
if (CachedImage* borderImage = m_style->borderImage().image())
borderImage->deref(this);
borderImage->removeClient(this);
m_style->deref(arena);
}
......
......@@ -134,12 +134,12 @@ void StyleCachedImage::setImageContainerSize(const IntSize& size)
void StyleCachedImage::addClient(RenderObject* renderer)
{
return m_image->ref(renderer);
return m_image->addClient(renderer);
}