Changeset 206867 in webkit


Ignore:
Timestamp:
Oct 6, 2016 9:53:58 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

CachedResource client handling methods should take reference
https://bugs.webkit.org/show_bug.cgi?id=163014

Patch by Youenn Fablet <youenn@apple.com> on 2016-10-06
Reviewed by Alex Christensen.

Source/WebCore:

No change of behavior.

  • bindings/js/CachedScriptSourceProvider.h:

(WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):

  • css/CSSCrossfadeValue.cpp:

(WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
(WebCore::CSSCrossfadeValue::loadSubimages):

  • css/CSSFilterImageValue.cpp:

(WebCore::CSSFilterImageValue::~CSSFilterImageValue):
(WebCore::CSSFilterImageValue::loadSubimages):

  • css/CSSFontFaceSource.cpp:

(WebCore::CSSFontFaceSource::CSSFontFaceSource):
(WebCore::CSSFontFaceSource::~CSSFontFaceSource):

  • css/StyleRuleImport.cpp:

(WebCore::StyleRuleImport::~StyleRuleImport):
(WebCore::StyleRuleImport::requestStyleSheet):

  • dom/DataTransfer.cpp:

(WebCore::DragImageLoader::startLoading):
(WebCore::DragImageLoader::stopLoading):

  • dom/LoadableClassicScript.cpp:

(WebCore::LoadableClassicScript::create):
(WebCore::LoadableClassicScript::~LoadableClassicScript):

  • dom/ProcessingInstruction.cpp:

(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::parseStyleSheet):

  • html/HTMLLinkElement.cpp:

(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::process):

  • loader/CrossOriginPreflightChecker.cpp:

(WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
(WebCore::CrossOriginPreflightChecker::startPreflight):

  • loader/DocumentLoader.cpp:

(WebCore::DocumentLoader::detachFromFrame):
(WebCore::DocumentLoader::clearMainResource):
(WebCore::DocumentLoader::becomeMainResourceClient):

  • loader/DocumentThreadableLoader.cpp:

(WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::loadRequest):

  • loader/ImageLoader.cpp:

(WebCore::ImageLoader::~ImageLoader):
(WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):

  • loader/LinkLoader.cpp:

(WebCore::LinkLoader::~LinkLoader):
(WebCore::LinkLoader::notifyFinished):
(WebCore::LinkLoader::loadLink):

  • loader/LinkPreloadResourceClients.h:

(WebCore::LinkPreloadResourceClient::addResource):
(WebCore::LinkPreloadResourceClient::clearResource):

  • loader/MediaResourceLoader.cpp:

(WebCore::MediaResource::MediaResource):
(WebCore::MediaResource::stop):

  • loader/TextTrackLoader.cpp:

(WebCore::TextTrackLoader::~TextTrackLoader):
(WebCore::TextTrackLoader::cancelLoad):
(WebCore::TextTrackLoader::load):

  • loader/cache/CachedCSSStyleSheet.cpp:

(WebCore::CachedCSSStyleSheet::didAddClient):

  • loader/cache/CachedCSSStyleSheet.h:
  • loader/cache/CachedFont.cpp:

(WebCore::CachedFont::didAddClient):

  • loader/cache/CachedFont.h:
  • loader/cache/CachedImage.cpp:

(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::didRemoveClient):

  • loader/cache/CachedImage.h:
  • loader/cache/CachedRawResource.cpp:

(WebCore::CachedRawResource::didAddClient):

  • loader/cache/CachedRawResource.h:
  • loader/cache/CachedResource.cpp:

(WebCore::CachedResource::addClient):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::removeClient):
(WebCore::CachedResource::switchClientsToRevalidatedResource):
(WebCore::CachedResource::Callback::timerFired):

  • loader/cache/CachedResource.h:

(WebCore::CachedResource::hasClient):
(WebCore::CachedResource::didRemoveClient):

  • loader/cache/CachedSVGDocumentReference.cpp:

(WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
(WebCore::CachedSVGDocumentReference::load):

  • loader/cache/CachedXSLStyleSheet.cpp:

(WebCore::CachedXSLStyleSheet::didAddClient):

  • loader/cache/CachedXSLStyleSheet.h:
  • loader/cache/MemoryCache.cpp:

(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeImageFromCache):

  • loader/icon/IconLoader.cpp:

(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::stopLoading):

  • platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:

(WebCore::WebCoreAVCFResourceLoader::startLoading):
(WebCore::WebCoreAVCFResourceLoader::stopLoading):

  • platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:

(WebCore::WebCoreAVFResourceLoader::startLoading):
(WebCore::WebCoreAVFResourceLoader::stopLoading):

  • rendering/RenderImageResource.cpp:

(WebCore::RenderImageResource::shutdown):
(WebCore::RenderImageResource::setCachedImage):

  • rendering/RenderLayerFilterInfo.cpp:

(WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
(WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):

  • rendering/style/StyleCachedImage.cpp:

(WebCore::StyleCachedImage::addClient):
(WebCore::StyleCachedImage::removeClient):

  • svg/SVGFEImageElement.cpp:

(WebCore::SVGFEImageElement::clearResourceReferences):
(WebCore::SVGFEImageElement::requestImageResource):

  • svg/SVGFontFaceUriElement.cpp:

(WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
(WebCore::SVGFontFaceUriElement::loadFont):

  • svg/SVGUseElement.cpp:

(WebCore::SVGUseElement::~SVGUseElement):
(WebCore::SVGUseElement::updateExternalDocument):

  • xml/XSLImportRule.cpp:

(WebCore::XSLImportRule::~XSLImportRule):
(WebCore::XSLImportRule::setXSLStyleSheet):
(WebCore::XSLImportRule::loadSheet):

  • xml/parser/XMLDocumentParser.cpp:

(WebCore::XMLDocumentParser::notifyFinished):

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):

Source/WebKit/mac:

  • WebView/WebHTMLView.mm:

(promisedDataClient):

Location:
trunk/Source
Files:
46 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206866 r206867  
     12016-10-06  Youenn Fablet  <youenn@apple.com>
     2
     3        CachedResource client handling methods should take reference
     4        https://bugs.webkit.org/show_bug.cgi?id=163014
     5
     6        Reviewed by Alex Christensen.
     7
     8        No change of behavior.
     9
     10        * bindings/js/CachedScriptSourceProvider.h:
     11        (WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
     12        (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
     13        * css/CSSCrossfadeValue.cpp:
     14        (WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
     15        (WebCore::CSSCrossfadeValue::loadSubimages):
     16        * css/CSSFilterImageValue.cpp:
     17        (WebCore::CSSFilterImageValue::~CSSFilterImageValue):
     18        (WebCore::CSSFilterImageValue::loadSubimages):
     19        * css/CSSFontFaceSource.cpp:
     20        (WebCore::CSSFontFaceSource::CSSFontFaceSource):
     21        (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
     22        * css/StyleRuleImport.cpp:
     23        (WebCore::StyleRuleImport::~StyleRuleImport):
     24        (WebCore::StyleRuleImport::requestStyleSheet):
     25        * dom/DataTransfer.cpp:
     26        (WebCore::DragImageLoader::startLoading):
     27        (WebCore::DragImageLoader::stopLoading):
     28        * dom/LoadableClassicScript.cpp:
     29        (WebCore::LoadableClassicScript::create):
     30        (WebCore::LoadableClassicScript::~LoadableClassicScript):
     31        * dom/ProcessingInstruction.cpp:
     32        (WebCore::ProcessingInstruction::~ProcessingInstruction):
     33        (WebCore::ProcessingInstruction::checkStyleSheet):
     34        (WebCore::ProcessingInstruction::parseStyleSheet):
     35        * html/HTMLLinkElement.cpp:
     36        (WebCore::HTMLLinkElement::~HTMLLinkElement):
     37        (WebCore::HTMLLinkElement::process):
     38        * loader/CrossOriginPreflightChecker.cpp:
     39        (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
     40        (WebCore::CrossOriginPreflightChecker::startPreflight):
     41        * loader/DocumentLoader.cpp:
     42        (WebCore::DocumentLoader::detachFromFrame):
     43        (WebCore::DocumentLoader::clearMainResource):
     44        (WebCore::DocumentLoader::becomeMainResourceClient):
     45        * loader/DocumentThreadableLoader.cpp:
     46        (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
     47        (WebCore::DocumentThreadableLoader::clearResource):
     48        (WebCore::DocumentThreadableLoader::loadRequest):
     49        * loader/ImageLoader.cpp:
     50        (WebCore::ImageLoader::~ImageLoader):
     51        (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
     52        (WebCore::ImageLoader::updateFromElement):
     53        (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
     54        * loader/LinkLoader.cpp:
     55        (WebCore::LinkLoader::~LinkLoader):
     56        (WebCore::LinkLoader::notifyFinished):
     57        (WebCore::LinkLoader::loadLink):
     58        * loader/LinkPreloadResourceClients.h:
     59        (WebCore::LinkPreloadResourceClient::addResource):
     60        (WebCore::LinkPreloadResourceClient::clearResource):
     61        * loader/MediaResourceLoader.cpp:
     62        (WebCore::MediaResource::MediaResource):
     63        (WebCore::MediaResource::stop):
     64        * loader/TextTrackLoader.cpp:
     65        (WebCore::TextTrackLoader::~TextTrackLoader):
     66        (WebCore::TextTrackLoader::cancelLoad):
     67        (WebCore::TextTrackLoader::load):
     68        * loader/cache/CachedCSSStyleSheet.cpp:
     69        (WebCore::CachedCSSStyleSheet::didAddClient):
     70        * loader/cache/CachedCSSStyleSheet.h:
     71        * loader/cache/CachedFont.cpp:
     72        (WebCore::CachedFont::didAddClient):
     73        * loader/cache/CachedFont.h:
     74        * loader/cache/CachedImage.cpp:
     75        (WebCore::CachedImage::didAddClient):
     76        (WebCore::CachedImage::didRemoveClient):
     77        * loader/cache/CachedImage.h:
     78        * loader/cache/CachedRawResource.cpp:
     79        (WebCore::CachedRawResource::didAddClient):
     80        * loader/cache/CachedRawResource.h:
     81        * loader/cache/CachedResource.cpp:
     82        (WebCore::CachedResource::addClient):
     83        (WebCore::CachedResource::didAddClient):
     84        (WebCore::CachedResource::addClientToSet):
     85        (WebCore::CachedResource::removeClient):
     86        (WebCore::CachedResource::switchClientsToRevalidatedResource):
     87        (WebCore::CachedResource::Callback::timerFired):
     88        * loader/cache/CachedResource.h:
     89        (WebCore::CachedResource::hasClient):
     90        (WebCore::CachedResource::didRemoveClient):
     91        * loader/cache/CachedSVGDocumentReference.cpp:
     92        (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
     93        (WebCore::CachedSVGDocumentReference::load):
     94        * loader/cache/CachedXSLStyleSheet.cpp:
     95        (WebCore::CachedXSLStyleSheet::didAddClient):
     96        * loader/cache/CachedXSLStyleSheet.h:
     97        * loader/cache/MemoryCache.cpp:
     98        (WebCore::MemoryCache::addImageToCache):
     99        (WebCore::MemoryCache::removeImageFromCache):
     100        * loader/icon/IconLoader.cpp:
     101        (WebCore::IconLoader::startLoading):
     102        (WebCore::IconLoader::stopLoading):
     103        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
     104        (WebCore::WebCoreAVCFResourceLoader::startLoading):
     105        (WebCore::WebCoreAVCFResourceLoader::stopLoading):
     106        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
     107        (WebCore::WebCoreAVFResourceLoader::startLoading):
     108        (WebCore::WebCoreAVFResourceLoader::stopLoading):
     109        * rendering/RenderImageResource.cpp:
     110        (WebCore::RenderImageResource::shutdown):
     111        (WebCore::RenderImageResource::setCachedImage):
     112        * rendering/RenderLayerFilterInfo.cpp:
     113        (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
     114        (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
     115        * rendering/style/StyleCachedImage.cpp:
     116        (WebCore::StyleCachedImage::addClient):
     117        (WebCore::StyleCachedImage::removeClient):
     118        * svg/SVGFEImageElement.cpp:
     119        (WebCore::SVGFEImageElement::clearResourceReferences):
     120        (WebCore::SVGFEImageElement::requestImageResource):
     121        * svg/SVGFontFaceUriElement.cpp:
     122        (WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
     123        (WebCore::SVGFontFaceUriElement::loadFont):
     124        * svg/SVGUseElement.cpp:
     125        (WebCore::SVGUseElement::~SVGUseElement):
     126        (WebCore::SVGUseElement::updateExternalDocument):
     127        * xml/XSLImportRule.cpp:
     128        (WebCore::XSLImportRule::~XSLImportRule):
     129        (WebCore::XSLImportRule::setXSLStyleSheet):
     130        (WebCore::XSLImportRule::loadSheet):
     131        * xml/parser/XMLDocumentParser.cpp:
     132        (WebCore::XMLDocumentParser::notifyFinished):
     133        * xml/parser/XMLDocumentParserLibxml2.cpp:
     134        (WebCore::XMLDocumentParser::~XMLDocumentParser):
     135        (WebCore::XMLDocumentParser::endElementNs):
     136
    11372016-10-05  Philippe Normand  <pnormand@igalia.com>
    2138
  • trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h

    r206653 r206867  
    4242    virtual ~CachedScriptSourceProvider()
    4343    {
    44         m_cachedScript->removeClient(this);
     44        m_cachedScript->removeClient(*this);
    4545    }
    4646
     
    5353        , m_cachedScript(cachedScript)
    5454    {
    55         m_cachedScript->addClient(this);
     55        m_cachedScript->addClient(*this);
    5656    }
    5757
  • trunk/Source/WebCore/css/CSSCrossfadeValue.cpp

    r205181 r206867  
    6262{
    6363    if (m_cachedFromImage)
    64         m_cachedFromImage->removeClient(&m_crossfadeSubimageObserver);
     64        m_cachedFromImage->removeClient(m_crossfadeSubimageObserver);
    6565    if (m_cachedToImage)
    66         m_cachedToImage->removeClient(&m_crossfadeSubimageObserver);
     66        m_cachedToImage->removeClient(m_crossfadeSubimageObserver);
    6767}
    6868
     
    132132    if (m_cachedFromImage != oldCachedFromImage) {
    133133        if (oldCachedFromImage)
    134             oldCachedFromImage->removeClient(&m_crossfadeSubimageObserver);
     134            oldCachedFromImage->removeClient(m_crossfadeSubimageObserver);
    135135        if (m_cachedFromImage)
    136             m_cachedFromImage->addClient(&m_crossfadeSubimageObserver);
     136            m_cachedFromImage->addClient(m_crossfadeSubimageObserver);
    137137    }
    138138
    139139    if (m_cachedToImage != oldCachedToImage) {
    140140        if (oldCachedToImage)
    141             oldCachedToImage->removeClient(&m_crossfadeSubimageObserver);
     141            oldCachedToImage->removeClient(m_crossfadeSubimageObserver);
    142142        if (m_cachedToImage)
    143             m_cachedToImage->addClient(&m_crossfadeSubimageObserver);
     143            m_cachedToImage->addClient(m_crossfadeSubimageObserver);
    144144    }
    145145
  • trunk/Source/WebCore/css/CSSFilterImageValue.cpp

    r205421 r206867  
    4646{
    4747    if (m_cachedImage)
    48         m_cachedImage->removeClient(&m_filterSubimageObserver);
     48        m_cachedImage->removeClient(m_filterSubimageObserver);
    4949}
    5050
     
    9393    if (m_cachedImage != oldCachedImage) {
    9494        if (oldCachedImage)
    95             oldCachedImage->removeClient(&m_filterSubimageObserver);
     95            oldCachedImage->removeClient(m_filterSubimageObserver);
    9696        if (m_cachedImage)
    97             m_cachedImage->addClient(&m_filterSubimageObserver);
     97            m_cachedImage->addClient(m_filterSubimageObserver);
    9898    }
    9999
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r206830 r206867  
    8989    // This may synchronously call fontLoaded().
    9090    if (m_font)
    91         m_font->addClient(this);
     91        m_font->addClient(*this);
    9292
    9393    if (status() == Status::Pending && (!m_font || m_font->isLoaded())) {
     
    103103{
    104104    if (m_font)
    105         m_font->removeClient(this);
     105        m_font->removeClient(*this);
    106106}
    107107
  • trunk/Source/WebCore/css/StyleRuleImport.cpp

    r206016 r206867  
    5959        m_styleSheet->clearOwnerRule();
    6060    if (m_cachedSheet)
    61         m_cachedSheet->removeClient(&m_styleSheetClient);
     61        m_cachedSheet->removeClient(m_styleSheetClient);
    6262}
    6363
     
    119119    request.setInitiator(cachedResourceRequestInitiators().css);
    120120    if (m_cachedSheet)
    121         m_cachedSheet->removeClient(&m_styleSheetClient);
     121        m_cachedSheet->removeClient(m_styleSheetClient);
    122122    if (m_parentStyleSheet->isUserStyleSheet()) {
    123123        request.setOptions(ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, ClientCredentialPolicy::MayAskClientForCredentials, FetchOptions::Credentials::Include, SkipSecurityCheck, FetchOptions::Mode::NoCors, DoNotIncludeCertificateInfo, ContentSecurityPolicyImposition::SkipPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::AllowCaching));
     
    132132            m_parentStyleSheet->startLoadingDynamicSheet();
    133133        m_loading = true;
    134         m_cachedSheet->addClient(&m_styleSheetClient);
     134        m_cachedSheet->addClient(m_styleSheetClient);
    135135    }
    136136}
  • trunk/Source/WebCore/dom/DataTransfer.cpp

    r200192 r206867  
    312312{
    313313    // FIXME: Does this really trigger a load? Does it need to?
    314     image->addClient(this);
     314    image->addClient(*this);
    315315}
    316316
    317317void DragImageLoader::stopLoading(CachedResourceHandle<WebCore::CachedImage>& image)
    318318{
    319     image->removeClient(this);
     319    image->removeClient(*this);
    320320}
    321321
  • trunk/Source/WebCore/dom/LoadableClassicScript.cpp

    r205854 r206867  
    3838    ASSERT(cachedScript);
    3939    auto script = adoptRef(*new LoadableClassicScript(WTFMove(cachedScript)));
    40     cachedScript->addClient(script.ptr());
     40    cachedScript->addClient(script.get());
    4141    return script;
    4242}
     
    4444LoadableClassicScript::~LoadableClassicScript()
    4545{
    46     m_cachedScript->removeClient(this);
     46    m_cachedScript->removeClient(*this);
    4747}
    4848
  • trunk/Source/WebCore/dom/ProcessingInstruction.cpp

    r206361 r206867  
    5757
    5858    if (m_cachedSheet)
    59         m_cachedSheet->removeClient(this);
     59        m_cachedSheet->removeClient(*this);
    6060
    6161    if (inDocument())
     
    127127        } else {
    128128            if (m_cachedSheet) {
    129                 m_cachedSheet->removeClient(this);
     129                m_cachedSheet->removeClient(*this);
    130130                m_cachedSheet = nullptr;
    131131            }
     
    155155            }
    156156            if (m_cachedSheet)
    157                 m_cachedSheet->addClient(this);
     157                m_cachedSheet->addClient(*this);
    158158            else {
    159159                // The request may have been denied if (for example) the stylesheet is local and the document is remote.
     
    226226
    227227    if (m_cachedSheet)
    228         m_cachedSheet->removeClient(this);
     228        m_cachedSheet->removeClient(*this);
    229229    m_cachedSheet = nullptr;
    230230
  • trunk/Source/WebCore/html/HTMLLinkElement.cpp

    r206616 r206867  
    100100
    101101    if (m_cachedSheet)
    102         m_cachedSheet->removeClient(this);
     102        m_cachedSheet->removeClient(*this);
    103103
    104104    if (inDocument())
     
    232232        if (charset.isEmpty() && document().frame())
    233233            charset = document().charset();
    234        
     234
    235235        if (m_cachedSheet) {
    236236            removePendingSheet();
    237             m_cachedSheet->removeClient(this);
     237            m_cachedSheet->removeClient(*this);
    238238            m_cachedSheet = nullptr;
    239239        }
     
    275275
    276276        if (m_cachedSheet)
    277             m_cachedSheet->addClient(this);
     277            m_cachedSheet->addClient(*this);
    278278        else {
    279279            // The request may have been denied if (for example) the stylesheet is local and the document is remote.
  • trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp

    r206524 r206867  
    5454{
    5555    if (m_resource)
    56         m_resource->removeClient(this);
     56        m_resource->removeClient(*this);
    5757}
    5858
     
    120120    m_resource = m_loader.document().cachedResourceLoader().requestRawResource(WTFMove(preflightRequest));
    121121    if (m_resource)
    122         m_resource->addClient(this);
     122        m_resource->addClient(*this);
    123123}
    124124
  • trunk/Source/WebCore/loader/DocumentLoader.cpp

    r206224 r206867  
    10211021    // frame have any loads active, so kill all the loads.
    10221022    stopLoading();
    1023     if (m_mainResource && m_mainResource->hasClient(this))
    1024         m_mainResource->removeClient(this);
     1023    if (m_mainResource && m_mainResource->hasClient(*this))
     1024        m_mainResource->removeClient(*this);
    10251025#if ENABLE(CONTENT_FILTERING)
    10261026    if (m_contentFilter)
     
    15961596void DocumentLoader::clearMainResource()
    15971597{
    1598     if (m_mainResource && m_mainResource->hasClient(this))
    1599         m_mainResource->removeClient(this);
     1598    if (m_mainResource && m_mainResource->hasClient(*this))
     1599        m_mainResource->removeClient(*this);
    16001600#if ENABLE(CONTENT_FILTERING)
    16011601    if (m_contentFilter)
     
    17001700        m_contentFilter->startFilteringMainResource(*m_mainResource);
    17011701#endif
    1702     m_mainResource->addClient(this);
     1702    m_mainResource->addClient(*this);
    17031703}
    17041704
  • trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp

    r206858 r206867  
    168168{
    169169    if (m_resource)
    170         m_resource->removeClient(this);
     170        m_resource->removeClient(*this);
    171171}
    172172
     
    201201    if (CachedResourceHandle<CachedRawResource> resource = m_resource) {
    202202        m_resource = nullptr;
    203         resource->removeClient(this);
     203        resource->removeClient(*this);
    204204    }
    205205    if (m_preflightChecker)
     
    392392        m_resource = m_document.cachedResourceLoader().requestRawResource(WTFMove(newRequest));
    393393        if (m_resource)
    394             m_resource->addClient(this);
     394            m_resource->addClient(*this);
    395395        else {
    396396            // FIXME: Since we receive a synchronous error, this is probably due to some AccessControl checks. We should try to retrieve the actual error.
  • trunk/Source/WebCore/loader/ImageLoader.cpp

    r206016 r206867  
    105105{
    106106    if (m_image)
    107         m_image->removeClient(this);
     107        m_image->removeClient(*this);
    108108
    109109    ASSERT(m_hasPendingBeforeLoadEvent || !beforeLoadEventSender().hasPendingEvents(*this));
     
    149149        m_imageComplete = true;
    150150        if (oldImage)
    151             oldImage->removeClient(this);
     151            oldImage->removeClient(*this);
    152152    }
    153153
     
    249249            // being queued to fire. Ensure this happens after beforeload is
    250250            // dispatched.
    251             newImage->addClient(this);
     251            newImage->addClient(*this);
    252252        }
    253253        if (oldImage) {
    254             oldImage->removeClient(this);
     254            oldImage->removeClient(*this);
    255255            updateRenderer();
    256256        }
     
    401401    }
    402402    if (m_image) {
    403         m_image->removeClient(this);
     403        m_image->removeClient(*this);
    404404        m_image = nullptr;
    405405    }
  • trunk/Source/WebCore/loader/LinkLoader.cpp

    r206203 r206867  
    6161{
    6262    if (m_cachedLinkResource)
    63         m_cachedLinkResource->removeClient(this);
     63        m_cachedLinkResource->removeClient(*this);
    6464    if (m_preloadResourceClient)
    6565        m_preloadResourceClient->clear();
     
    8080    triggerEvents(m_cachedLinkResource.get());
    8181
    82     m_cachedLinkResource->removeClient(this);
     82    m_cachedLinkResource->removeClient(*this);
    8383    m_cachedLinkResource = nullptr;
    8484}
     
    198198
    199199        if (m_cachedLinkResource) {
    200             m_cachedLinkResource->removeClient(this);
     200            m_cachedLinkResource->removeClient(*this);
    201201            m_cachedLinkResource = nullptr;
    202202        }
     
    205205        m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, CachedResourceRequest(ResourceRequest(document.completeURL(href)), options, priority));
    206206        if (m_cachedLinkResource)
    207             m_cachedLinkResource->addClient(this);
     207            m_cachedLinkResource->addClient(*this);
    208208    }
    209209#endif
  • trunk/Source/WebCore/loader/LinkPreloadResourceClients.h

    r205269 r206867  
    5555    LinkPreloadResourceClient(LinkLoader&, CachedResource&);
    5656
    57     void addResource(CachedResourceClient* client)
     57    void addResource(CachedResourceClient& client)
    5858    {
    5959        m_resource->addClient(client);
    6060    }
    6161
    62     void clearResource(CachedResourceClient* client)
     62    void clearResource(CachedResourceClient& client)
    6363    {
    6464        if (m_resource)
     
    9090    }
    9191
    92     void clear() override { clearResource(this); }
     92    void clear() override { clearResource(*this); }
    9393
    9494private:
     
    9696        : LinkPreloadResourceClient(loader, resource)
    9797    {
    98         addResource(this);
     98        addResource(*this);
    9999    }
    100100};
     
    115115    }
    116116
    117     void clear() override { clearResource(this); }
     117    void clear() override { clearResource(*this); }
    118118
    119119private:
     
    121121        : LinkPreloadResourceClient(loader, resource)
    122122    {
    123         addResource(this);
     123        addResource(*this);
    124124    }
    125125};
     
    140140    }
    141141
    142     void clear() override { clearResource(this); }
     142    void clear() override { clearResource(*this); }
    143143
    144144private:
     
    146146        : LinkPreloadResourceClient(loader, dynamic_cast<CachedResource&>(resource))
    147147    {
    148         addResource(this);
     148        addResource(*this);
    149149    }
    150150};
     
    165165    }
    166166
    167     void clear() override { clearResource(this); }
     167    void clear() override { clearResource(*this); }
    168168
    169169private:
     
    171171        : LinkPreloadResourceClient(loader, resource)
    172172    {
    173         addResource(this);
     173        addResource(*this);
    174174    }
    175175};
     
    190190    }
    191191
    192     void clear() override { clearResource(this); }
     192    void clear() override { clearResource(*this); }
    193193
    194194private:
     
    196196        : LinkPreloadResourceClient(loader, resource)
    197197    {
    198         addResource(this);
     198        addResource(*this);
    199199    }
    200200};
  • trunk/Source/WebCore/loader/MediaResourceLoader.cpp

    r206016 r206867  
    106106{
    107107    ASSERT(resource);
    108     resource->addClient(this);
     108    resource->addClient(*this);
    109109}
    110110
     
    120120        return;
    121121
    122     m_resource->removeClient(this);
     122    m_resource->removeClient(*this);
    123123    m_resource = nullptr;
    124124}
  • trunk/Source/WebCore/loader/TextTrackLoader.cpp

    r206016 r206867  
    5757{
    5858    if (m_resource)
    59         m_resource->removeClient(this);
     59        m_resource->removeClient(*this);
    6060}
    6161
     
    7474{
    7575    if (m_resource) {
    76         m_resource->removeClient(this);
     76        m_resource->removeClient(*this);
    7777        m_resource = nullptr;
    7878    }
     
    162162        return false;
    163163
    164     m_resource->addClient(this);
     164    m_resource->addClient(*this);
    165165
    166166    return true;
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp

    r206206 r206867  
    5454}
    5555
    56 void CachedCSSStyleSheet::didAddClient(CachedResourceClient* c)
     56void CachedCSSStyleSheet::didAddClient(CachedResourceClient& client)
    5757{
    58     ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
     58    ASSERT(client.resourceClientType() == CachedStyleSheetClient::expectedType());
    5959    // CachedResource::didAddClient() must be before setCSSStyleSheet(),
    6060    // because setCSSStyleSheet() may cause scripts to be executed, which could destroy 'c' if it is an instance of HTMLLinkElement.
    6161    // see the comment of HTMLLinkElement::setCSSStyleSheet.
    62     CachedResource::didAddClient(c);
     62    CachedResource::didAddClient(client);
    6363
    6464    if (!isLoading())
    65         static_cast<CachedStyleSheetClient*>(c)->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
     65        static_cast<CachedStyleSheetClient&>(client).setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
    6666}
    6767
  • trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h

    r206016 r206867  
    5151        bool mayTryReplaceEncodedData() const final { return true; }
    5252
    53         void didAddClient(CachedResourceClient*) final;
     53        void didAddClient(CachedResourceClient&) final;
    5454
    5555        void setEncoding(const String&) final;
  • trunk/Source/WebCore/loader/cache/CachedFont.cpp

    r206830 r206867  
    6464}
    6565
    66 void CachedFont::didAddClient(CachedResourceClient* client)
     66void CachedFont::didAddClient(CachedResourceClient& client)
    6767{
    68     ASSERT(client->resourceClientType() == CachedFontClient::expectedType());
     68    ASSERT(client.resourceClientType() == CachedFontClient::expectedType());
    6969    if (!isLoading())
    70         static_cast<CachedFontClient*>(client)->fontLoaded(*this);
     70        static_cast<CachedFontClient&>(client).fontLoaded(*this);
    7171}
    7272
  • trunk/Source/WebCore/loader/cache/CachedFont.h

    r206664 r206867  
    7070    NO_RETURN_DUE_TO_ASSERT void setBodyDataFrom(const CachedResource&) final { ASSERT_NOT_REACHED(); }
    7171
    72     void didAddClient(CachedResourceClient*) override;
     72    void didAddClient(CachedResourceClient&) override;
    7373    void finishLoading(SharedBuffer*) override;
    7474
  • trunk/Source/WebCore/loader/cache/CachedImage.cpp

    r206637 r206867  
    103103}
    104104
    105 void CachedImage::didAddClient(CachedResourceClient* client)
     105void CachedImage::didAddClient(CachedResourceClient& client)
    106106{
    107107    if (m_data && !m_image && !errorOccurred()) {
     
    110110    }
    111111
    112     ASSERT(client->resourceClientType() == CachedImageClient::expectedType());
     112    ASSERT(client.resourceClientType() == CachedImageClient::expectedType());
    113113    if (m_image && !m_image->isNull())
    114         static_cast<CachedImageClient*>(client)->imageChanged(this);
     114        static_cast<CachedImageClient&>(client).imageChanged(this);
    115115
    116116    CachedResource::didAddClient(client);
    117117}
    118118
    119 void CachedImage::didRemoveClient(CachedResourceClient* client)
    120 {
    121     ASSERT(client);
    122     ASSERT(client->resourceClientType() == CachedImageClient::expectedType());
    123 
    124     m_pendingContainerSizeRequests.remove(static_cast<CachedImageClient*>(client));
     119void CachedImage::didRemoveClient(CachedResourceClient& client)
     120{
     121    ASSERT(client.resourceClientType() == CachedImageClient::expectedType());
     122
     123    m_pendingContainerSizeRequests.remove(&static_cast<CachedImageClient&>(client));
    125124
    126125    if (m_svgImageCache)
    127         m_svgImageCache->removeClientFromCache(static_cast<CachedImageClient*>(client));
     126        m_svgImageCache->removeClientFromCache(&static_cast<CachedImageClient&>(client));
    128127
    129128    CachedResource::didRemoveClient(client);
  • trunk/Source/WebCore/loader/cache/CachedImage.h

    r206635 r206867  
    100100    void checkShouldPaintBrokenImage();
    101101
    102     void switchClientsToRevalidatedResource() override;
    103     bool mayTryReplaceEncodedData() const override { return true; }
     102    void switchClientsToRevalidatedResource() final;
     103    bool mayTryReplaceEncodedData() const final { return true; }
    104104
    105     void didAddClient(CachedResourceClient*) override;
    106     void didRemoveClient(CachedResourceClient*) override;
     105    void didAddClient(CachedResourceClient&) final;
     106    void didRemoveClient(CachedResourceClient&) final;
    107107
    108108    void allClientsRemoved() override;
  • trunk/Source/WebCore/loader/cache/CachedRawResource.cpp

    r206016 r206867  
    119119}
    120120
    121 void CachedRawResource::didAddClient(CachedResourceClient* c)
     121void CachedRawResource::didAddClient(CachedResourceClient& c)
    122122{
    123123    if (!hasClient(c))
     
    127127    // so a protector is necessary.
    128128    CachedResourceHandle<CachedRawResource> protectedThis(this);
    129     CachedRawResourceClient* client = static_cast<CachedRawResourceClient*>(c);
     129    CachedRawResourceClient& client = static_cast<CachedRawResourceClient&>(c);
    130130    size_t redirectCount = m_redirectChain.size();
    131131    for (size_t i = 0; i < redirectCount; i++) {
    132132        RedirectPair redirect = m_redirectChain[i];
    133133        ResourceRequest request(redirect.m_request);
    134         client->redirectReceived(this, request, redirect.m_redirectResponse);
     134        client.redirectReceived(this, request, redirect.m_redirectResponse);
    135135        if (!hasClient(c))
    136136            return;
     
    146146            response.setSource(ResourceResponse::Source::MemoryCache);
    147147        }
    148         client->responseReceived(this, response);
     148        client.responseReceived(this, response);
    149149    }
    150150    if (!hasClient(c))
    151151        return;
    152152    if (m_data)
    153         client->dataReceived(this, m_data->data(), m_data->size());
     153        client.dataReceived(this, m_data->data(), m_data->size());
    154154    if (!hasClient(c))
    155155       return;
  • trunk/Source/WebCore/loader/cache/CachedRawResource.h

    r206016 r206867  
    5252
    5353private:
    54     void didAddClient(CachedResourceClient*) override;
    55     void addDataBuffer(SharedBuffer&) override;
    56     void addData(const char* data, unsigned length) override;
    57     void finishLoading(SharedBuffer*) override;
     54    void didAddClient(CachedResourceClient&) final;
     55    void addDataBuffer(SharedBuffer&) final;
     56    void addData(const char* data, unsigned length) final;
     57    void finishLoading(SharedBuffer*) final;
    5858
    5959    bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; }
  • trunk/Source/WebCore/loader/cache/CachedResource.cpp

    r206635 r206867  
    530530}
    531531
    532 void CachedResource::addClient(CachedResourceClient* client)
     532void CachedResource::addClient(CachedResourceClient& client)
    533533{
    534534    if (addClientToSet(client))
     
    536536}
    537537
    538 void CachedResource::didAddClient(CachedResourceClient* client)
     538void CachedResource::didAddClient(CachedResourceClient& client)
    539539{
    540540    if (m_decodedDataDeletionTimer.isActive())
    541541        m_decodedDataDeletionTimer.stop();
    542542
    543     if (m_clientsAwaitingCallback.remove(client))
    544         m_clients.add(client);
     543    if (m_clientsAwaitingCallback.remove(&client))
     544        m_clients.add(&client);
    545545    if (!isLoading() && !stillNeedsLoad())
    546         client->notifyFinished(this);
    547 }
    548 
    549 bool CachedResource::addClientToSet(CachedResourceClient* client)
     546        client.notifyFinished(this);
     547}
     548
     549bool CachedResource::addClientToSet(CachedResourceClient& client)
    550550{
    551551    if (m_preloadResult == PreloadNotReferenced) {
     
    565565        // Therefore, rather than immediately sending callbacks on a cache hit like other CachedResources,
    566566        // we schedule the callbacks and ensure we never finish synchronously.
    567         ASSERT(!m_clientsAwaitingCallback.contains(client));
    568         m_clientsAwaitingCallback.add(client, std::make_unique<Callback>(*this, *client));
     567        ASSERT(!m_clientsAwaitingCallback.contains(&client));
     568        m_clientsAwaitingCallback.add(&client, std::make_unique<Callback>(*this, client));
    569569        return false;
    570570    }
    571571
    572     m_clients.add(client);
     572    m_clients.add(&client);
    573573    return true;
    574574}
    575575
    576 void CachedResource::removeClient(CachedResourceClient* client)
    577 {
    578     auto callback = m_clientsAwaitingCallback.take(client);
     576void CachedResource::removeClient(CachedResourceClient& client)
     577{
     578    auto callback = m_clientsAwaitingCallback.take(&client);
    579579    if (callback) {
    580         ASSERT(!m_clients.contains(client));
     580        ASSERT(!m_clients.contains(&client));
    581581        callback->cancel();
    582582        callback = nullptr;
    583583    } else {
    584         ASSERT(m_clients.contains(client));
    585         m_clients.remove(client);
     584        ASSERT(m_clients.contains(&client));
     585        m_clients.remove(&client);
    586586        didRemoveClient(client);
    587587    }
     
    776776
    777777    for (auto& client : clientsToMove)
    778         removeClient(client);
     778        removeClient(*client);
    779779    ASSERT(m_clients.isEmpty());
    780780
    781781    for (auto& client : clientsToMove)
    782         m_resourceToRevalidate->addClientToSet(client);
     782        m_resourceToRevalidate->addClientToSet(*client);
    783783    for (auto& client : clientsToMove) {
    784784        // Calling didAddClient may do anything, including trying to cancel revalidation.
     
    787787        // Calling didAddClient for a client may end up removing another client. In that case it won't be in the set anymore.
    788788        if (m_resourceToRevalidate->m_clients.contains(client))
    789             m_resourceToRevalidate->didAddClient(client);
     789            m_resourceToRevalidate->didAddClient(*client);
    790790    }
    791791    m_switchingClientsToRevalidatedResource = false;
     
    912912void CachedResource::Callback::timerFired()
    913913{
    914     m_resource.didAddClient(&m_client);
     914    m_resource.didAddClient(m_client);
    915915}
    916916
  • trunk/Source/WebCore/loader/cache/CachedResource.h

    r206388 r206867  
    125125    void setLoadPriority(const Optional<ResourceLoadPriority>&);
    126126
    127     WEBCORE_EXPORT void addClient(CachedResourceClient*);
    128     WEBCORE_EXPORT void removeClient(CachedResourceClient*);
     127    WEBCORE_EXPORT void addClient(CachedResourceClient&);
     128    WEBCORE_EXPORT void removeClient(CachedResourceClient&);
    129129    bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty(); }
    130     bool hasClient(CachedResourceClient* client) { return m_clients.contains(client) || m_clientsAwaitingCallback.contains(client); }
     130    bool hasClient(CachedResourceClient& client) { return m_clients.contains(&client) || m_clientsAwaitingCallback.contains(&client); }
    131131    bool deleteIfPossible();
    132132
     
    139139    PreloadResult preloadResult() const { return static_cast<PreloadResult>(m_preloadResult); }
    140140
    141     virtual void didAddClient(CachedResourceClient*);
    142     virtual void didRemoveClient(CachedResourceClient*) { }
     141    virtual void didAddClient(CachedResourceClient&);
     142    virtual void didRemoveClient(CachedResourceClient&) { }
    143143    virtual void allClientsRemoved() { }
    144144    void destroyDecodedDataIfNeeded();
     
    304304    void finishRequestInitialization();
    305305
    306     bool addClientToSet(CachedResourceClient*);
     306    bool addClientToSet(CachedResourceClient&);
    307307
    308308    void decodedDataDeletionTimerFired();
  • trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp

    r206203 r206867  
    4545{
    4646    if (m_document)
    47         m_document->removeClient(this);
     47        m_document->removeClient(*this);
    4848}
    4949
     
    5959    m_document = loader.requestSVGDocument(WTFMove(request));
    6060    if (m_document)
    61         m_document->addClient(this);
     61        m_document->addClient(*this);
    6262
    6363    m_loadRequested = true;
  • trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp

    r206206 r206867  
    4747}
    4848
    49 void CachedXSLStyleSheet::didAddClient(CachedResourceClient* c)
     49void CachedXSLStyleSheet::didAddClient(CachedResourceClient& client)
    5050{
    51     ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
     51    ASSERT(client.resourceClientType() == CachedStyleSheetClient::expectedType());
    5252    if (!isLoading())
    53         static_cast<CachedStyleSheetClient*>(c)->setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
     53        static_cast<CachedStyleSheetClient&>(client).setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
    5454}
    5555
  • trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h

    r206016 r206867  
    2424*/
    2525
    26 #ifndef CachedXSLStyleSheet_h
    27 #define CachedXSLStyleSheet_h
     26#pragma once
    2827
    2928#if ENABLE(XSLT)
     
    4342
    4443private:
    45     void checkNotify() override;
    46     bool mayTryReplaceEncodedData() const override { return true; }
    47     void didAddClient(CachedResourceClient*) override;
    48     void setEncoding(const String&) override;
    49     String encoding() const override;
    50     const TextResourceDecoder* textResourceDecoder() const override { return m_decoder.get(); }
    51     void finishLoading(SharedBuffer*) override;
     44    void checkNotify() final;
     45    bool mayTryReplaceEncodedData() const final { return true; }
     46    void didAddClient(CachedResourceClient&) final;
     47    void setEncoding(const String&) final;
     48    String encoding() const final;
     49    const TextResourceDecoder* textResourceDecoder() const final { return m_decoder.get(); }
     50    void finishLoading(SharedBuffer*) final;
    5251
    5352    String m_sheet;
     
    6059
    6160#endif // ENABLE(XSLT)
    62 
    63 #endif // CachedXSLStyleSheet_h
  • trunk/Source/WebCore/loader/cache/MemoryCache.cpp

    r206635 r206867  
    224224    auto cachedImage = std::make_unique<CachedImage>(url, bitmapImage.get(), sessionID);
    225225
    226     cachedImage->addClient(&dummyCachedImageClient());
     226    cachedImage->addClient(dummyCachedImageClient());
    227227    cachedImage->setDecodedSize(bitmapImage->decodedSize());
    228228#if ENABLE(CACHE_PARTITIONING)
     
    259259    // removing the last client triggers a MemoryCache::prune, so the
    260260    // resource may be deleted after this call.
    261     downcast<CachedImage>(*resource).removeClient(&dummyCachedImageClient());
     261    downcast<CachedImage>(*resource).removeClient(dummyCachedImageClient());
    262262}
    263263
  • trunk/Source/WebCore/loader/icon/IconLoader.cpp

    r206016 r206867  
    6767    m_resource = m_frame.document()->cachedResourceLoader().requestRawResource(WTFMove(request));
    6868    if (m_resource)
    69         m_resource->addClient(this);
     69        m_resource->addClient(*this);
    7070    else
    7171        LOG_ERROR("Failed to start load for icon at url %s", m_frame.loader().icon().url().string().ascii().data());
     
    7575{
    7676    if (m_resource) {
    77         m_resource->removeClient(this);
     77        m_resource->removeClient(*this);
    7878        m_resource = nullptr;
    7979    }
  • trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp

    r206016 r206867  
    7878    m_resource = loader ? loader->requestRawResource(WTFMove(request)) : 0;
    7979    if (m_resource)
    80         m_resource->addClient(this);
     80        m_resource->addClient(*this);
    8181    else {
    8282        LOG_ERROR("Failed to start load for media at url %s", URL(CFURLRequestGetURL(urlRequest.get())).string().ascii().data());
     
    9191        return;
    9292
    93     m_resource->removeClient(this);
     93    m_resource->removeClient(*this);
    9494    m_resource = 0;
    9595
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm

    r206185 r206867  
    7676
    7777    if (m_resource)
    78         m_resource->addClient(this);
     78        m_resource->addClient(*this);
    7979    else {
    8080        LOG_ERROR("Failed to start load for media at url %s", [[[nsRequest URL] absoluteString] UTF8String]);
     
    8888        return;
    8989
    90     m_resource->removeClient(this);
     90    m_resource->removeClient(*this);
    9191    m_resource = 0;
    9292
  • trunk/Source/WebCore/rendering/RenderImageResource.cpp

    r191083 r206867  
    5858
    5959    if (m_cachedImage)
    60         m_cachedImage->removeClient(m_renderer);
     60        m_cachedImage->removeClient(*m_renderer);
    6161}
    6262
     
    6969
    7070    if (m_cachedImage)
    71         m_cachedImage->removeClient(m_renderer);
     71        m_cachedImage->removeClient(*m_renderer);
    7272    m_cachedImage = newImage;
    7373    if (m_cachedImage) {
    74         m_cachedImage->addClient(m_renderer);
     74        m_cachedImage->addClient(*m_renderer);
    7575        if (m_cachedImage->errorOccurred())
    7676            m_renderer->imageChanged(m_cachedImage.get());
  • trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp

    r201588 r206867  
    9292    m_layer.filterNeedsRepaint();
    9393}
    94    
     94
    9595void RenderLayer::FilterInfo::updateReferenceFilterClients(const FilterOperations& operations)
    9696{
     
    103103        if (auto* cachedSVGDocument = documentReference ? documentReference->document() : nullptr) {
    104104            // Reference is external; wait for notifyFinished().
    105             cachedSVGDocument->addClient(this);
     105            cachedSVGDocument->addClient(*this);
    106106            m_externalSVGReferences.append(cachedSVGDocument);
    107107        } else {
     
    122122{
    123123    for (auto& resourceHandle : m_externalSVGReferences)
    124         resourceHandle->removeClient(this);
     124        resourceHandle->removeClient(*this);
    125125    m_externalSVGReferences.clear();
    126126
  • trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp

    r205997 r206867  
    177177    if (!m_cachedImage)
    178178        return;
    179     m_cachedImage->addClient(renderer);
     179    ASSERT(renderer);
     180    m_cachedImage->addClient(*renderer);
    180181}
    181182
     
    185186    if (!m_cachedImage)
    186187        return;
    187     m_cachedImage->removeClient(renderer);
     188    ASSERT(renderer);
     189    m_cachedImage->removeClient(*renderer);
    188190}
    189191
  • trunk/Source/WebCore/svg/SVGFEImageElement.cpp

    r206016 r206867  
    7777{
    7878    if (m_cachedImage) {
    79         m_cachedImage->removeClient(this);
     79        m_cachedImage->removeClient(*this);
    8080        m_cachedImage = nullptr;
    8181    }
     
    9494
    9595    if (m_cachedImage)
    96         m_cachedImage->addClient(this);
     96        m_cachedImage->addClient(*this);
    9797}
    9898
  • trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp

    r206016 r206867  
    5151{
    5252    if (m_cachedFont)
    53         m_cachedFont->removeClient(this);
     53        m_cachedFont->removeClient(*this);
    5454}
    5555
     
    9797{
    9898    if (m_cachedFont)
    99         m_cachedFont->removeClient(this);
     99        m_cachedFont->removeClient(*this);
    100100
    101101    const AtomicString& href = getAttribute(XLinkNames::hrefAttr);
     
    109109        m_cachedFont = cachedResourceLoader.requestFont(WTFMove(request), isSVGFontTarget(*this));
    110110        if (m_cachedFont) {
    111             m_cachedFont->addClient(this);
     111            m_cachedFont->addClient(*this);
    112112            m_cachedFont->beginLoadIfNeeded(cachedResourceLoader);
    113113        }
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r206203 r206867  
    8080{
    8181    if (m_externalDocument)
    82         m_externalDocument->removeClient(this);
     82        m_externalDocument->removeClient(*this);
    8383}
    8484
     
    564564
    565565    if (m_externalDocument)
    566         m_externalDocument->removeClient(this);
     566        m_externalDocument->removeClient(*this);
    567567
    568568    if (externalDocumentURL.isNull())
     
    576576        m_externalDocument = document().cachedResourceLoader().requestSVGDocument(WTFMove(request));
    577577        if (m_externalDocument)
    578             m_externalDocument->addClient(this);
     578            m_externalDocument->addClient(*this);
    579579    }
    580580
  • trunk/Source/WebCore/xml/XSLImportRule.cpp

    r206203 r206867  
    4444    if (m_styleSheet)
    4545        m_styleSheet->setParentStyleSheet(nullptr);
    46    
     46
    4747    if (m_cachedSheet)
    48         m_cachedSheet->removeClient(this);
     48        m_cachedSheet->removeClient(*this);
    4949}
    5050
     
    6262    m_styleSheet->parseString(sheet);
    6363    m_loading = false;
    64    
     64
    6565    if (parent)
    6666        parent->checkLoaded();
     
    8585    if (rootSheet)
    8686        cachedResourceLoader = rootSheet->cachedResourceLoader();
    87    
     87
    8888    String absHref = m_strHref;
    8989    XSLStyleSheet* parentSheet = parentStyleSheet();
     
    100100
    101101    if (m_cachedSheet)
    102         m_cachedSheet->removeClient(this);
     102        m_cachedSheet->removeClient(*this);
    103103
    104104    auto options = CachedResourceLoader::defaultCachedResourceOptions();
     
    107107
    108108    if (m_cachedSheet) {
    109         m_cachedSheet->addClient(this);
     109        m_cachedSheet->addClient(*this);
    110110
    111111        // If the imported sheet is in the cache, then setXSLStyleSheet gets called,
  • trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp

    r206361 r206867  
    238238    bool wasCanceled = m_pendingScript->wasCanceled();
    239239
    240     m_pendingScript->removeClient(this);
     240    m_pendingScript->removeClient(*this);
    241241    m_pendingScript = nullptr;
    242242
  • trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp

    r206361 r206867  
    667667    // FIXME: m_pendingScript handling should be moved into XMLDocumentParser.cpp!
    668668    if (m_pendingScript)
    669         m_pendingScript->removeClient(this);
     669        m_pendingScript->removeClient(*this);
    670670}
    671671
     
    928928            m_pendingScript = &downcast<LoadableClassicScript>(*scriptElement->loadableScript()).cachedScript();
    929929            m_scriptElement = &element;
    930             m_pendingScript->addClient(this);
     930            m_pendingScript->addClient(*this);
    931931
    932932            // m_pendingScript will be 0 if script was already loaded and addClient() executed it.
  • trunk/Source/WebKit/mac/ChangeLog

    r206839 r206867  
     12016-10-06  Youenn Fablet  <youenn@apple.com>
     2
     3        CachedResource client handling methods should take reference
     4        https://bugs.webkit.org/show_bug.cgi?id=163014
     5
     6        Reviewed by Alex Christensen.
     7
     8        * WebView/WebHTMLView.mm:
     9        (promisedDataClient):
     10
    1112016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r206802 r206867  
    790790#if !PLATFORM(IOS)
    791791// We need this to be able to safely reference the CachedImage for the promised drag data
    792 static CachedImageClient* promisedDataClient()
     792static CachedImageClient& promisedDataClient()
    793793{
    794794    static CachedImageClient* staticCachedResourceClient = new CachedImageClient;
    795     return staticCachedResourceClient;
     795    return *staticCachedResourceClient;
    796796}
    797797#endif
Note: See TracChangeset for help on using the changeset viewer.