Title: [206867] trunk/Source
Revision
206867
Author
[email protected]
Date
2016-10-06 09:53:58 -0700 (Thu, 06 Oct 2016)

Log Message

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

Patch by Youenn Fablet <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (206866 => 206867)


--- trunk/Source/WebCore/ChangeLog	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/ChangeLog	2016-10-06 16:53:58 UTC (rev 206867)
@@ -1,3 +1,139 @@
+2016-10-06  Youenn Fablet  <[email protected]>
+
+        CachedResource client handling methods should take reference
+        https://bugs.webkit.org/show_bug.cgi?id=163014
+
+        Reviewed by Alex Christensen.
+
+        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):
+
 2016-10-05  Philippe Normand  <[email protected]>
 
         [GStreamer][OWR] GL rendering support

Modified: trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h (206866 => 206867)


--- trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/bindings/js/CachedScriptSourceProvider.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -41,7 +41,7 @@
 
     virtual ~CachedScriptSourceProvider()
     {
-        m_cachedScript->removeClient(this);
+        m_cachedScript->removeClient(*this);
     }
 
     unsigned hash() const override { return m_cachedScript->scriptHash(); }
@@ -52,7 +52,7 @@
         : SourceProvider(cachedScript->response().url(), TextPosition::minimumPosition(), JSC::SourceProviderSourceType::Program)
         , m_cachedScript(cachedScript)
     {
-        m_cachedScript->addClient(this);
+        m_cachedScript->addClient(*this);
     }
 
     CachedResourceHandle<CachedScript> m_cachedScript;

Modified: trunk/Source/WebCore/css/CSSCrossfadeValue.cpp (206866 => 206867)


--- trunk/Source/WebCore/css/CSSCrossfadeValue.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/css/CSSCrossfadeValue.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -61,9 +61,9 @@
 CSSCrossfadeValue::~CSSCrossfadeValue()
 {
     if (m_cachedFromImage)
-        m_cachedFromImage->removeClient(&m_crossfadeSubimageObserver);
+        m_cachedFromImage->removeClient(m_crossfadeSubimageObserver);
     if (m_cachedToImage)
-        m_cachedToImage->removeClient(&m_crossfadeSubimageObserver);
+        m_cachedToImage->removeClient(m_crossfadeSubimageObserver);
 }
 
 String CSSCrossfadeValue::customCSSText() const
@@ -131,16 +131,16 @@
 
     if (m_cachedFromImage != oldCachedFromImage) {
         if (oldCachedFromImage)
-            oldCachedFromImage->removeClient(&m_crossfadeSubimageObserver);
+            oldCachedFromImage->removeClient(m_crossfadeSubimageObserver);
         if (m_cachedFromImage)
-            m_cachedFromImage->addClient(&m_crossfadeSubimageObserver);
+            m_cachedFromImage->addClient(m_crossfadeSubimageObserver);
     }
 
     if (m_cachedToImage != oldCachedToImage) {
         if (oldCachedToImage)
-            oldCachedToImage->removeClient(&m_crossfadeSubimageObserver);
+            oldCachedToImage->removeClient(m_crossfadeSubimageObserver);
         if (m_cachedToImage)
-            m_cachedToImage->addClient(&m_crossfadeSubimageObserver);
+            m_cachedToImage->addClient(m_crossfadeSubimageObserver);
     }
 
     m_crossfadeSubimageObserver.setReady(true);

Modified: trunk/Source/WebCore/css/CSSFilterImageValue.cpp (206866 => 206867)


--- trunk/Source/WebCore/css/CSSFilterImageValue.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/css/CSSFilterImageValue.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -45,7 +45,7 @@
 CSSFilterImageValue::~CSSFilterImageValue()
 {
     if (m_cachedImage)
-        m_cachedImage->removeClient(&m_filterSubimageObserver);
+        m_cachedImage->removeClient(m_filterSubimageObserver);
 }
 
 String CSSFilterImageValue::customCSSText() const
@@ -92,9 +92,9 @@
 
     if (m_cachedImage != oldCachedImage) {
         if (oldCachedImage)
-            oldCachedImage->removeClient(&m_filterSubimageObserver);
+            oldCachedImage->removeClient(m_filterSubimageObserver);
         if (m_cachedImage)
-            m_cachedImage->addClient(&m_filterSubimageObserver);
+            m_cachedImage->addClient(m_filterSubimageObserver);
     }
 
     for (auto& filterOperation : m_filterOperations.operations()) {

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (206866 => 206867)


--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -88,7 +88,7 @@
 
     // This may synchronously call fontLoaded().
     if (m_font)
-        m_font->addClient(this);
+        m_font->addClient(*this);
 
     if (status() == Status::Pending && (!m_font || m_font->isLoaded())) {
         setStatus(Status::Loading);
@@ -102,7 +102,7 @@
 CSSFontFaceSource::~CSSFontFaceSource()
 {
     if (m_font)
-        m_font->removeClient(this);
+        m_font->removeClient(*this);
 }
 
 void CSSFontFaceSource::fontLoaded(CachedFont& loadedFont)

Modified: trunk/Source/WebCore/css/StyleRuleImport.cpp (206866 => 206867)


--- trunk/Source/WebCore/css/StyleRuleImport.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/css/StyleRuleImport.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -58,7 +58,7 @@
     if (m_styleSheet)
         m_styleSheet->clearOwnerRule();
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(&m_styleSheetClient);
+        m_cachedSheet->removeClient(m_styleSheetClient);
 }
 
 void StyleRuleImport::setCSSStyleSheet(const String& href, const URL& baseURL, const String& charset, const CachedCSSStyleSheet* cachedStyleSheet)
@@ -118,7 +118,7 @@
     CachedResourceRequest request(ResourceRequest(absURL), m_parentStyleSheet->charset());
     request.setInitiator(cachedResourceRequestInitiators().css);
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(&m_styleSheetClient);
+        m_cachedSheet->removeClient(m_styleSheetClient);
     if (m_parentStyleSheet->isUserStyleSheet()) {
         request.setOptions(ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, ClientCredentialPolicy::MayAskClientForCredentials, FetchOptions::Credentials::Include, SkipSecurityCheck, FetchOptions::Mode::NoCors, DoNotIncludeCertificateInfo, ContentSecurityPolicyImposition::SkipPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::AllowCaching));
         m_cachedSheet = document->cachedResourceLoader().requestUserCSSStyleSheet(WTFMove(request));
@@ -131,7 +131,7 @@
         if (m_parentStyleSheet && m_parentStyleSheet->loadCompleted() && rootSheet == m_parentStyleSheet)
             m_parentStyleSheet->startLoadingDynamicSheet();
         m_loading = true;
-        m_cachedSheet->addClient(&m_styleSheetClient);
+        m_cachedSheet->addClient(m_styleSheetClient);
     }
 }
 

Modified: trunk/Source/WebCore/dom/DataTransfer.cpp (206866 => 206867)


--- trunk/Source/WebCore/dom/DataTransfer.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/dom/DataTransfer.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -311,12 +311,12 @@
 void DragImageLoader::startLoading(CachedResourceHandle<WebCore::CachedImage>& image)
 {
     // FIXME: Does this really trigger a load? Does it need to?
-    image->addClient(this);
+    image->addClient(*this);
 }
 
 void DragImageLoader::stopLoading(CachedResourceHandle<WebCore::CachedImage>& image)
 {
-    image->removeClient(this);
+    image->removeClient(*this);
 }
 
 void DragImageLoader::imageChanged(CachedImage*, const IntRect*)

Modified: trunk/Source/WebCore/dom/LoadableClassicScript.cpp (206866 => 206867)


--- trunk/Source/WebCore/dom/LoadableClassicScript.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/dom/LoadableClassicScript.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -37,13 +37,13 @@
 {
     ASSERT(cachedScript);
     auto script = adoptRef(*new LoadableClassicScript(WTFMove(cachedScript)));
-    cachedScript->addClient(script.ptr());
+    cachedScript->addClient(script.get());
     return script;
 }
 
 LoadableClassicScript::~LoadableClassicScript()
 {
-    m_cachedScript->removeClient(this);
+    m_cachedScript->removeClient(*this);
 }
 
 bool LoadableClassicScript::isLoaded() const

Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (206866 => 206867)


--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -56,7 +56,7 @@
         m_sheet->clearOwnerNode();
 
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(this);
+        m_cachedSheet->removeClient(*this);
 
     if (inDocument())
         document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
@@ -126,7 +126,7 @@
 #endif
         } else {
             if (m_cachedSheet) {
-                m_cachedSheet->removeClient(this);
+                m_cachedSheet->removeClient(*this);
                 m_cachedSheet = nullptr;
             }
 
@@ -154,7 +154,7 @@
                 m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request));
             }
             if (m_cachedSheet)
-                m_cachedSheet->addClient(this);
+                m_cachedSheet->addClient(*this);
             else {
                 // The request may have been denied if (for example) the stylesheet is local and the document is remote.
                 m_loading = false;
@@ -225,7 +225,7 @@
 #endif
 
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(this);
+        m_cachedSheet->removeClient(*this);
     m_cachedSheet = nullptr;
 
     m_loading = false;

Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (206866 => 206867)


--- trunk/Source/WebCore/html/HTMLLinkElement.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -99,7 +99,7 @@
         m_sheet->clearOwnerNode();
 
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(this);
+        m_cachedSheet->removeClient(*this);
 
     if (inDocument())
         document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
@@ -231,10 +231,10 @@
         AtomicString charset = attributeWithoutSynchronization(charsetAttr);
         if (charset.isEmpty() && document().frame())
             charset = document().charset();
-        
+
         if (m_cachedSheet) {
             removePendingSheet();
-            m_cachedSheet->removeClient(this);
+            m_cachedSheet->removeClient(*this);
             m_cachedSheet = nullptr;
         }
 
@@ -274,7 +274,7 @@
         m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request));
 
         if (m_cachedSheet)
-            m_cachedSheet->addClient(this);
+            m_cachedSheet->addClient(*this);
         else {
             // The request may have been denied if (for example) the stylesheet is local and the document is remote.
             m_loading = false;

Modified: trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -53,7 +53,7 @@
 CrossOriginPreflightChecker::~CrossOriginPreflightChecker()
 {
     if (m_resource)
-        m_resource->removeClient(this);
+        m_resource->removeClient(*this);
 }
 
 void CrossOriginPreflightChecker::validatePreflightResponse(DocumentThreadableLoader& loader, ResourceRequest&& request, unsigned long identifier, const ResourceResponse& response)
@@ -119,7 +119,7 @@
     ASSERT(!m_resource);
     m_resource = m_loader.document().cachedResourceLoader().requestRawResource(WTFMove(preflightRequest));
     if (m_resource)
-        m_resource->addClient(this);
+        m_resource->addClient(*this);
 }
 
 void CrossOriginPreflightChecker::doPreflight(DocumentThreadableLoader& loader, ResourceRequest&& request)

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -1020,8 +1020,8 @@
     // It never makes sense to have a document loader that is detached from its
     // frame have any loads active, so kill all the loads.
     stopLoading();
-    if (m_mainResource && m_mainResource->hasClient(this))
-        m_mainResource->removeClient(this);
+    if (m_mainResource && m_mainResource->hasClient(*this))
+        m_mainResource->removeClient(*this);
 #if ENABLE(CONTENT_FILTERING)
     if (m_contentFilter)
         m_contentFilter->stopFilteringMainResource();
@@ -1595,8 +1595,8 @@
 
 void DocumentLoader::clearMainResource()
 {
-    if (m_mainResource && m_mainResource->hasClient(this))
-        m_mainResource->removeClient(this);
+    if (m_mainResource && m_mainResource->hasClient(*this))
+        m_mainResource->removeClient(*this);
 #if ENABLE(CONTENT_FILTERING)
     if (m_contentFilter)
         m_contentFilter->stopFilteringMainResource();
@@ -1699,7 +1699,7 @@
     if (m_contentFilter)
         m_contentFilter->startFilteringMainResource(*m_mainResource);
 #endif
-    m_mainResource->addClient(this);
+    m_mainResource->addClient(*this);
 }
 
 #if ENABLE(CONTENT_EXTENSIONS)

Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -167,7 +167,7 @@
 DocumentThreadableLoader::~DocumentThreadableLoader()
 {
     if (m_resource)
-        m_resource->removeClient(this);
+        m_resource->removeClient(*this);
 }
 
 void DocumentThreadableLoader::cancel()
@@ -200,7 +200,7 @@
     // prevent the reentrancy.
     if (CachedResourceHandle<CachedRawResource> resource = m_resource) {
         m_resource = nullptr;
-        resource->removeClient(this);
+        resource->removeClient(*this);
     }
     if (m_preflightChecker)
         m_preflightChecker = Nullopt;
@@ -391,7 +391,7 @@
         URL requestUrl = newRequest.resourceRequest().url();
         m_resource = m_document.cachedResourceLoader().requestRawResource(WTFMove(newRequest));
         if (m_resource)
-            m_resource->addClient(this);
+            m_resource->addClient(*this);
         else {
             // FIXME: Since we receive a synchronous error, this is probably due to some AccessControl checks. We should try to retrieve the actual error.
             m_client->didFail(ResourceError(String(), 0, requestUrl, String(), ResourceError::Type::AccessControl));

Modified: trunk/Source/WebCore/loader/ImageLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/ImageLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/ImageLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -104,7 +104,7 @@
 ImageLoader::~ImageLoader()
 {
     if (m_image)
-        m_image->removeClient(this);
+        m_image->removeClient(*this);
 
     ASSERT(m_hasPendingBeforeLoadEvent || !beforeLoadEventSender().hasPendingEvents(*this));
     if (m_hasPendingBeforeLoadEvent)
@@ -148,7 +148,7 @@
         }
         m_imageComplete = true;
         if (oldImage)
-            oldImage->removeClient(this);
+            oldImage->removeClient(*this);
     }
 
     if (RenderImageResource* imageResource = renderImageResource())
@@ -248,10 +248,10 @@
             // If newImage is cached, addClient() will result in the load event
             // being queued to fire. Ensure this happens after beforeload is
             // dispatched.
-            newImage->addClient(this);
+            newImage->addClient(*this);
         }
         if (oldImage) {
-            oldImage->removeClient(this);
+            oldImage->removeClient(*this);
             updateRenderer();
         }
     }
@@ -400,7 +400,7 @@
         return;
     }
     if (m_image) {
-        m_image->removeClient(this);
+        m_image->removeClient(*this);
         m_image = nullptr;
     }
 

Modified: trunk/Source/WebCore/loader/LinkLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/LinkLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/LinkLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -60,7 +60,7 @@
 LinkLoader::~LinkLoader()
 {
     if (m_cachedLinkResource)
-        m_cachedLinkResource->removeClient(this);
+        m_cachedLinkResource->removeClient(*this);
     if (m_preloadResourceClient)
         m_preloadResourceClient->clear();
 }
@@ -79,7 +79,7 @@
 
     triggerEvents(m_cachedLinkResource.get());
 
-    m_cachedLinkResource->removeClient(this);
+    m_cachedLinkResource->removeClient(*this);
     m_cachedLinkResource = nullptr;
 }
 
@@ -197,7 +197,7 @@
         }
 
         if (m_cachedLinkResource) {
-            m_cachedLinkResource->removeClient(this);
+            m_cachedLinkResource->removeClient(*this);
             m_cachedLinkResource = nullptr;
         }
         ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions();
@@ -204,7 +204,7 @@
         options.contentSecurityPolicyImposition = ContentSecurityPolicyImposition::SkipPolicyCheck;
         m_cachedLinkResource = document.cachedResourceLoader().requestLinkResource(type, CachedResourceRequest(ResourceRequest(document.completeURL(href)), options, priority));
         if (m_cachedLinkResource)
-            m_cachedLinkResource->addClient(this);
+            m_cachedLinkResource->addClient(*this);
     }
 #endif
 

Modified: trunk/Source/WebCore/loader/LinkPreloadResourceClients.h (206866 => 206867)


--- trunk/Source/WebCore/loader/LinkPreloadResourceClients.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/LinkPreloadResourceClients.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -54,12 +54,12 @@
 
     LinkPreloadResourceClient(LinkLoader&, CachedResource&);
 
-    void addResource(CachedResourceClient* client)
+    void addResource(CachedResourceClient& client)
     {
         m_resource->addClient(client);
     }
 
-    void clearResource(CachedResourceClient* client)
+    void clearResource(CachedResourceClient& client)
     {
         if (m_resource)
             m_resource->removeClient(client);
@@ -89,13 +89,13 @@
         triggerEvents(resource);
     }
 
-    void clear() override { clearResource(this); }
+    void clear() override { clearResource(*this); }
 
 private:
     LinkPreloadScriptResourceClient(LinkLoader& loader, CachedScript& resource)
         : LinkPreloadResourceClient(loader, resource)
     {
-        addResource(this);
+        addResource(*this);
     }
 };
 
@@ -114,13 +114,13 @@
         triggerEvents(resource);
     }
 
-    void clear() override { clearResource(this); }
+    void clear() override { clearResource(*this); }
 
 private:
     LinkPreloadStyleResourceClient(LinkLoader& loader, CachedCSSStyleSheet& resource)
         : LinkPreloadResourceClient(loader, resource)
     {
-        addResource(this);
+        addResource(*this);
     }
 };
 
@@ -139,13 +139,13 @@
         triggerEvents(resource);
     }
 
-    void clear() override { clearResource(this); }
+    void clear() override { clearResource(*this); }
 
 private:
     LinkPreloadImageResourceClient(LinkLoader& loader, CachedImage& resource)
         : LinkPreloadResourceClient(loader, dynamic_cast<CachedResource&>(resource))
     {
-        addResource(this);
+        addResource(*this);
     }
 };
 
@@ -164,13 +164,13 @@
         triggerEvents(&resource);
     }
 
-    void clear() override { clearResource(this); }
+    void clear() override { clearResource(*this); }
 
 private:
     LinkPreloadFontResourceClient(LinkLoader& loader, CachedFont& resource)
         : LinkPreloadResourceClient(loader, resource)
     {
-        addResource(this);
+        addResource(*this);
     }
 };
 
@@ -189,13 +189,13 @@
         triggerEvents(resource);
     }
 
-    void clear() override { clearResource(this); }
+    void clear() override { clearResource(*this); }
 
 private:
     LinkPreloadRawResourceClient(LinkLoader& loader, CachedRawResource& resource)
         : LinkPreloadResourceClient(loader, resource)
     {
-        addResource(this);
+        addResource(*this);
     }
 };
 

Modified: trunk/Source/WebCore/loader/MediaResourceLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/MediaResourceLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/MediaResourceLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -105,7 +105,7 @@
     , m_resource(resource)
 {
     ASSERT(resource);
-    resource->addClient(this);
+    resource->addClient(*this);
 }
 
 MediaResource::~MediaResource()
@@ -119,7 +119,7 @@
     if (!m_resource)
         return;
 
-    m_resource->removeClient(this);
+    m_resource->removeClient(*this);
     m_resource = nullptr;
 }
 

Modified: trunk/Source/WebCore/loader/TextTrackLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/TextTrackLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/TextTrackLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -56,7 +56,7 @@
 TextTrackLoader::~TextTrackLoader()
 {
     if (m_resource)
-        m_resource->removeClient(this);
+        m_resource->removeClient(*this);
 }
 
 void TextTrackLoader::cueLoadTimerFired()
@@ -73,7 +73,7 @@
 void TextTrackLoader::cancelLoad()
 {
     if (m_resource) {
-        m_resource->removeClient(this);
+        m_resource->removeClient(*this);
         m_resource = nullptr;
     }
 }
@@ -161,7 +161,7 @@
     if (!m_resource)
         return false;
 
-    m_resource->addClient(this);
+    m_resource->addClient(*this);
 
     return true;
 }

Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -53,16 +53,16 @@
         m_parsedStyleSheetCache->removedFromMemoryCache();
 }
 
-void CachedCSSStyleSheet::didAddClient(CachedResourceClient* c)
+void CachedCSSStyleSheet::didAddClient(CachedResourceClient& client)
 {
-    ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
+    ASSERT(client.resourceClientType() == CachedStyleSheetClient::expectedType());
     // CachedResource::didAddClient() must be before setCSSStyleSheet(),
     // because setCSSStyleSheet() may cause scripts to be executed, which could destroy 'c' if it is an instance of HTMLLinkElement.
     // see the comment of HTMLLinkElement::setCSSStyleSheet.
-    CachedResource::didAddClient(c);
+    CachedResource::didAddClient(client);
 
     if (!isLoading())
-        static_cast<CachedStyleSheetClient*>(c)->setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
+        static_cast<CachedStyleSheetClient&>(client).setCSSStyleSheet(m_resourceRequest.url(), m_response.url(), m_decoder->encoding().name(), this);
 }
 
 void CachedCSSStyleSheet::setEncoding(const String& chs)

Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -50,7 +50,7 @@
         bool canUseSheet(MIMETypeCheck, bool* hasValidMIMEType) const;
         bool mayTryReplaceEncodedData() const final { return true; }
 
-        void didAddClient(CachedResourceClient*) final;
+        void didAddClient(CachedResourceClient&) final;
 
         void setEncoding(const String&) final;
         String encoding() const final;

Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedFont.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -63,11 +63,11 @@
     setLoading(true);
 }
 
-void CachedFont::didAddClient(CachedResourceClient* client)
+void CachedFont::didAddClient(CachedResourceClient& client)
 {
-    ASSERT(client->resourceClientType() == CachedFontClient::expectedType());
+    ASSERT(client.resourceClientType() == CachedFontClient::expectedType());
     if (!isLoading())
-        static_cast<CachedFontClient*>(client)->fontLoaded(*this);
+        static_cast<CachedFontClient&>(client).fontLoaded(*this);
 }
 
 void CachedFont::finishLoading(SharedBuffer* data)

Modified: trunk/Source/WebCore/loader/cache/CachedFont.h (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedFont.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -69,7 +69,7 @@
     void load(CachedResourceLoader&) override;
     NO_RETURN_DUE_TO_ASSERT void setBodyDataFrom(const CachedResource&) final { ASSERT_NOT_REACHED(); }
 
-    void didAddClient(CachedResourceClient*) override;
+    void didAddClient(CachedResourceClient&) override;
     void finishLoading(SharedBuffer*) override;
 
     void allClientsRemoved() override;

Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedImage.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -102,7 +102,7 @@
         m_svgImageCache = std::make_unique<SVGImageCache>(&downcast<SVGImage>(*m_image));
 }
 
-void CachedImage::didAddClient(CachedResourceClient* client)
+void CachedImage::didAddClient(CachedResourceClient& client)
 {
     if (m_data && !m_image && !errorOccurred()) {
         createImage();
@@ -109,22 +109,21 @@
         m_image->setData(m_data.copyRef(), true);
     }
 
-    ASSERT(client->resourceClientType() == CachedImageClient::expectedType());
+    ASSERT(client.resourceClientType() == CachedImageClient::expectedType());
     if (m_image && !m_image->isNull())
-        static_cast<CachedImageClient*>(client)->imageChanged(this);
+        static_cast<CachedImageClient&>(client).imageChanged(this);
 
     CachedResource::didAddClient(client);
 }
 
-void CachedImage::didRemoveClient(CachedResourceClient* client)
+void CachedImage::didRemoveClient(CachedResourceClient& client)
 {
-    ASSERT(client);
-    ASSERT(client->resourceClientType() == CachedImageClient::expectedType());
+    ASSERT(client.resourceClientType() == CachedImageClient::expectedType());
 
-    m_pendingContainerSizeRequests.remove(static_cast<CachedImageClient*>(client));
+    m_pendingContainerSizeRequests.remove(&static_cast<CachedImageClient&>(client));
 
     if (m_svgImageCache)
-        m_svgImageCache->removeClientFromCache(static_cast<CachedImageClient*>(client));
+        m_svgImageCache->removeClientFromCache(&static_cast<CachedImageClient&>(client));
 
     CachedResource::didRemoveClient(client);
 }

Modified: trunk/Source/WebCore/loader/cache/CachedImage.h (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedImage.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedImage.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -99,11 +99,11 @@
     void notifyObservers(const IntRect* changeRect = nullptr);
     void checkShouldPaintBrokenImage();
 
-    void switchClientsToRevalidatedResource() override;
-    bool mayTryReplaceEncodedData() const override { return true; }
+    void switchClientsToRevalidatedResource() final;
+    bool mayTryReplaceEncodedData() const final { return true; }
 
-    void didAddClient(CachedResourceClient*) override;
-    void didRemoveClient(CachedResourceClient*) override;
+    void didAddClient(CachedResourceClient&) final;
+    void didRemoveClient(CachedResourceClient&) final;
 
     void allClientsRemoved() override;
     void destroyDecodedData() override;

Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedRawResource.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -118,7 +118,7 @@
         c->dataReceived(this, data, length);
 }
 
-void CachedRawResource::didAddClient(CachedResourceClient* c)
+void CachedRawResource::didAddClient(CachedResourceClient& c)
 {
     if (!hasClient(c))
         return;
@@ -126,12 +126,12 @@
     // this resource to be evicted from the cache and all clients to be removed,
     // so a protector is necessary.
     CachedResourceHandle<CachedRawResource> protectedThis(this);
-    CachedRawResourceClient* client = static_cast<CachedRawResourceClient*>(c);
+    CachedRawResourceClient& client = static_cast<CachedRawResourceClient&>(c);
     size_t redirectCount = m_redirectChain.size();
     for (size_t i = 0; i < redirectCount; i++) {
         RedirectPair redirect = m_redirectChain[i];
         ResourceRequest request(redirect.m_request);
-        client->redirectReceived(this, request, redirect.m_redirectResponse);
+        client.redirectReceived(this, request, redirect.m_redirectResponse);
         if (!hasClient(c))
             return;
     }
@@ -145,12 +145,12 @@
             ASSERT(!validationInProgress());
             response.setSource(ResourceResponse::Source::MemoryCache);
         }
-        client->responseReceived(this, response);
+        client.responseReceived(this, response);
     }
     if (!hasClient(c))
         return;
     if (m_data)
-        client->dataReceived(this, m_data->data(), m_data->size());
+        client.dataReceived(this, m_data->data(), m_data->size());
     if (!hasClient(c))
        return;
     CachedResource::didAddClient(client);

Modified: trunk/Source/WebCore/loader/cache/CachedRawResource.h (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedRawResource.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedRawResource.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -51,10 +51,10 @@
     bool wasRedirected() const { return !m_redirectChain.isEmpty(); };
 
 private:
-    void didAddClient(CachedResourceClient*) override;
-    void addDataBuffer(SharedBuffer&) override;
-    void addData(const char* data, unsigned length) override;
-    void finishLoading(SharedBuffer*) override;
+    void didAddClient(CachedResourceClient&) final;
+    void addDataBuffer(SharedBuffer&) final;
+    void addData(const char* data, unsigned length) final;
+    void finishLoading(SharedBuffer*) final;
 
     bool shouldIgnoreHTTPStatusCodeErrors() const override { return true; }
     void allClientsRemoved() override;

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -529,24 +529,24 @@
     deleteIfPossible();
 }
 
-void CachedResource::addClient(CachedResourceClient* client)
+void CachedResource::addClient(CachedResourceClient& client)
 {
     if (addClientToSet(client))
         didAddClient(client);
 }
 
-void CachedResource::didAddClient(CachedResourceClient* client)
+void CachedResource::didAddClient(CachedResourceClient& client)
 {
     if (m_decodedDataDeletionTimer.isActive())
         m_decodedDataDeletionTimer.stop();
 
-    if (m_clientsAwaitingCallback.remove(client))
-        m_clients.add(client);
+    if (m_clientsAwaitingCallback.remove(&client))
+        m_clients.add(&client);
     if (!isLoading() && !stillNeedsLoad())
-        client->notifyFinished(this);
+        client.notifyFinished(this);
 }
 
-bool CachedResource::addClientToSet(CachedResourceClient* client)
+bool CachedResource::addClientToSet(CachedResourceClient& client)
 {
     if (m_preloadResult == PreloadNotReferenced) {
         if (isLoaded())
@@ -564,25 +564,25 @@
         // synchronously (e.g., scripts may not have set all the state they need to handle the load).
         // Therefore, rather than immediately sending callbacks on a cache hit like other CachedResources,
         // we schedule the callbacks and ensure we never finish synchronously.
-        ASSERT(!m_clientsAwaitingCallback.contains(client));
-        m_clientsAwaitingCallback.add(client, std::make_unique<Callback>(*this, *client));
+        ASSERT(!m_clientsAwaitingCallback.contains(&client));
+        m_clientsAwaitingCallback.add(&client, std::make_unique<Callback>(*this, client));
         return false;
     }
 
-    m_clients.add(client);
+    m_clients.add(&client);
     return true;
 }
 
-void CachedResource::removeClient(CachedResourceClient* client)
+void CachedResource::removeClient(CachedResourceClient& client)
 {
-    auto callback = m_clientsAwaitingCallback.take(client);
+    auto callback = m_clientsAwaitingCallback.take(&client);
     if (callback) {
-        ASSERT(!m_clients.contains(client));
+        ASSERT(!m_clients.contains(&client));
         callback->cancel();
         callback = nullptr;
     } else {
-        ASSERT(m_clients.contains(client));
-        m_clients.remove(client);
+        ASSERT(m_clients.contains(&client));
+        m_clients.remove(&client);
         didRemoveClient(client);
     }
 
@@ -775,11 +775,11 @@
     }
 
     for (auto& client : clientsToMove)
-        removeClient(client);
+        removeClient(*client);
     ASSERT(m_clients.isEmpty());
 
     for (auto& client : clientsToMove)
-        m_resourceToRevalidate->addClientToSet(client);
+        m_resourceToRevalidate->addClientToSet(*client);
     for (auto& client : clientsToMove) {
         // Calling didAddClient may do anything, including trying to cancel revalidation.
         // Assert that it didn't succeed.
@@ -786,7 +786,7 @@
         ASSERT(m_resourceToRevalidate);
         // Calling didAddClient for a client may end up removing another client. In that case it won't be in the set anymore.
         if (m_resourceToRevalidate->m_clients.contains(client))
-            m_resourceToRevalidate->didAddClient(client);
+            m_resourceToRevalidate->didAddClient(*client);
     }
     m_switchingClientsToRevalidatedResource = false;
 }
@@ -911,7 +911,7 @@
 
 void CachedResource::Callback::timerFired()
 {
-    m_resource.didAddClient(&m_client);
+    m_resource.didAddClient(m_client);
 }
 
 #if USE(FOUNDATION) || USE(SOUP)

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -124,10 +124,10 @@
     ResourceLoadPriority loadPriority() const { return m_loadPriority; }
     void setLoadPriority(const Optional<ResourceLoadPriority>&);
 
-    WEBCORE_EXPORT void addClient(CachedResourceClient*);
-    WEBCORE_EXPORT void removeClient(CachedResourceClient*);
+    WEBCORE_EXPORT void addClient(CachedResourceClient&);
+    WEBCORE_EXPORT void removeClient(CachedResourceClient&);
     bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty(); }
-    bool hasClient(CachedResourceClient* client) { return m_clients.contains(client) || m_clientsAwaitingCallback.contains(client); }
+    bool hasClient(CachedResourceClient& client) { return m_clients.contains(&client) || m_clientsAwaitingCallback.contains(&client); }
     bool deleteIfPossible();
 
     enum PreloadResult {
@@ -138,8 +138,8 @@
     };
     PreloadResult preloadResult() const { return static_cast<PreloadResult>(m_preloadResult); }
 
-    virtual void didAddClient(CachedResourceClient*);
-    virtual void didRemoveClient(CachedResourceClient*) { }
+    virtual void didAddClient(CachedResourceClient&);
+    virtual void didRemoveClient(CachedResourceClient&) { }
     virtual void allClientsRemoved() { }
     void destroyDecodedDataIfNeeded();
 
@@ -303,7 +303,7 @@
 
     void finishRequestInitialization();
 
-    bool addClientToSet(CachedResourceClient*);
+    bool addClientToSet(CachedResourceClient&);
 
     void decodedDataDeletionTimerFired();
 

Modified: trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedSVGDocumentReference.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -44,7 +44,7 @@
 CachedSVGDocumentReference::~CachedSVGDocumentReference()
 {
     if (m_document)
-        m_document->removeClient(this);
+        m_document->removeClient(*this);
 }
 
 void CachedSVGDocumentReference::load(CachedResourceLoader& loader, const ResourceLoaderOptions& options)
@@ -58,7 +58,7 @@
     request.setInitiator(cachedResourceRequestInitiators().css);
     m_document = loader.requestSVGDocument(WTFMove(request));
     if (m_document)
-        m_document->addClient(this);
+        m_document->addClient(*this);
 
     m_loadRequested = true;
 }

Modified: trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -46,11 +46,11 @@
 {
 }
 
-void CachedXSLStyleSheet::didAddClient(CachedResourceClient* c)
+void CachedXSLStyleSheet::didAddClient(CachedResourceClient& client)
 {
-    ASSERT(c->resourceClientType() == CachedStyleSheetClient::expectedType());
+    ASSERT(client.resourceClientType() == CachedStyleSheetClient::expectedType());
     if (!isLoading())
-        static_cast<CachedStyleSheetClient*>(c)->setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
+        static_cast<CachedStyleSheetClient&>(client).setXSLStyleSheet(m_resourceRequest.url(), m_response.url(), m_sheet);
 }
 
 void CachedXSLStyleSheet::setEncoding(const String& chs)

Modified: trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.h	2016-10-06 16:53:58 UTC (rev 206867)
@@ -23,8 +23,7 @@
     pages from the web. It has a memory cache for these objects.
 */
 
-#ifndef CachedXSLStyleSheet_h
-#define CachedXSLStyleSheet_h
+#pragma once
 
 #if ENABLE(XSLT)
 
@@ -42,13 +41,13 @@
     const String& sheet() const { return m_sheet; }
 
 private:
-    void checkNotify() override;
-    bool mayTryReplaceEncodedData() const override { return true; }
-    void didAddClient(CachedResourceClient*) override;
-    void setEncoding(const String&) override;
-    String encoding() const override;
-    const TextResourceDecoder* textResourceDecoder() const override { return m_decoder.get(); }
-    void finishLoading(SharedBuffer*) override;
+    void checkNotify() final;
+    bool mayTryReplaceEncodedData() const final { return true; }
+    void didAddClient(CachedResourceClient&) final;
+    void setEncoding(const String&) final;
+    String encoding() const final;
+    const TextResourceDecoder* textResourceDecoder() const final { return m_decoder.get(); }
+    void finishLoading(SharedBuffer*) final;
 
     String m_sheet;
     RefPtr<TextResourceDecoder> m_decoder;
@@ -59,5 +58,3 @@
 SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(CachedXSLStyleSheet, CachedResource::XSLStyleSheet)
 
 #endif // ENABLE(XSLT)
-
-#endif // CachedXSLStyleSheet_h

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -223,7 +223,7 @@
 
     auto cachedImage = std::make_unique<CachedImage>(url, bitmapImage.get(), sessionID);
 
-    cachedImage->addClient(&dummyCachedImageClient());
+    cachedImage->addClient(dummyCachedImageClient());
     cachedImage->setDecodedSize(bitmapImage->decodedSize());
 #if ENABLE(CACHE_PARTITIONING)
     cachedImage->resourceRequest().setDomainForCachePartition(domainForCachePartition);
@@ -258,7 +258,7 @@
     // dead resources are pruned. That might be immediately since
     // removing the last client triggers a MemoryCache::prune, so the
     // resource may be deleted after this call.
-    downcast<CachedImage>(*resource).removeClient(&dummyCachedImageClient());
+    downcast<CachedImage>(*resource).removeClient(dummyCachedImageClient());
 }
 
 void MemoryCache::pruneLiveResources(bool shouldDestroyDecodedDataForAllLiveResources)

Modified: trunk/Source/WebCore/loader/icon/IconLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/loader/icon/IconLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/loader/icon/IconLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -66,7 +66,7 @@
 
     m_resource = m_frame.document()->cachedResourceLoader().requestRawResource(WTFMove(request));
     if (m_resource)
-        m_resource->addClient(this);
+        m_resource->addClient(*this);
     else
         LOG_ERROR("Failed to start load for icon at url %s", m_frame.loader().icon().url().string().ascii().data());
 }
@@ -74,7 +74,7 @@
 void IconLoader::stopLoading()
 {
     if (m_resource) {
-        m_resource->removeClient(this);
+        m_resource->removeClient(*this);
         m_resource = nullptr;
     }
 }

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp (206866 => 206867)


--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -77,7 +77,7 @@
     CachedResourceLoader* loader = m_parent->player()->cachedResourceLoader();
     m_resource = loader ? loader->requestRawResource(WTFMove(request)) : 0;
     if (m_resource)
-        m_resource->addClient(this);
+        m_resource->addClient(*this);
     else {
         LOG_ERROR("Failed to start load for media at url %s", URL(CFURLRequestGetURL(urlRequest.get())).string().ascii().data());
         RetainPtr<CFErrorRef> error = adoptCF(CFErrorCreate(kCFAllocatorDefault, kCFErrorDomainCFNetwork, kCFURLErrorUnknown, nullptr));
@@ -90,7 +90,7 @@
     if (!m_resource)
         return;
 
-    m_resource->removeClient(this);
+    m_resource->removeClient(*this);
     m_resource = 0;
 
     if (m_parent)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm (206866 => 206867)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm	2016-10-06 16:53:58 UTC (rev 206867)
@@ -75,7 +75,7 @@
         m_resource = loader->requestMedia(WTFMove(request));
 
     if (m_resource)
-        m_resource->addClient(this);
+        m_resource->addClient(*this);
     else {
         LOG_ERROR("Failed to start load for media at url %s", [[[nsRequest URL] absoluteString] UTF8String]);
         [m_avRequest.get() finishLoadingWithError:0];
@@ -87,7 +87,7 @@
     if (!m_resource)
         return;
 
-    m_resource->removeClient(this);
+    m_resource->removeClient(*this);
     m_resource = 0;
 
     if (m_parent && m_avRequest)

Modified: trunk/Source/WebCore/rendering/RenderImageResource.cpp (206866 => 206867)


--- trunk/Source/WebCore/rendering/RenderImageResource.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/rendering/RenderImageResource.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -57,7 +57,7 @@
     ASSERT(m_renderer);
 
     if (m_cachedImage)
-        m_cachedImage->removeClient(m_renderer);
+        m_cachedImage->removeClient(*m_renderer);
 }
 
 void RenderImageResource::setCachedImage(CachedImage* newImage)
@@ -68,10 +68,10 @@
         return;
 
     if (m_cachedImage)
-        m_cachedImage->removeClient(m_renderer);
+        m_cachedImage->removeClient(*m_renderer);
     m_cachedImage = newImage;
     if (m_cachedImage) {
-        m_cachedImage->addClient(m_renderer);
+        m_cachedImage->addClient(*m_renderer);
         if (m_cachedImage->errorOccurred())
             m_renderer->imageChanged(m_cachedImage.get());
     }

Modified: trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp (206866 => 206867)


--- trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -91,7 +91,7 @@
 {
     m_layer.filterNeedsRepaint();
 }
-    
+
 void RenderLayer::FilterInfo::updateReferenceFilterClients(const FilterOperations& operations)
 {
     removeReferenceFilterClients();
@@ -102,7 +102,7 @@
         auto* documentReference = referenceOperation.cachedSVGDocumentReference();
         if (auto* cachedSVGDocument = documentReference ? documentReference->document() : nullptr) {
             // Reference is external; wait for notifyFinished().
-            cachedSVGDocument->addClient(this);
+            cachedSVGDocument->addClient(*this);
             m_externalSVGReferences.append(cachedSVGDocument);
         } else {
             // Reference is internal; add layer as a client so we can trigger filter repaint on SVG attribute change.
@@ -121,7 +121,7 @@
 void RenderLayer::FilterInfo::removeReferenceFilterClients()
 {
     for (auto& resourceHandle : m_externalSVGReferences)
-        resourceHandle->removeClient(this);
+        resourceHandle->removeClient(*this);
     m_externalSVGReferences.clear();
 
     for (auto& filter : m_internalSVGReferences) {

Modified: trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp (206866 => 206867)


--- trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/rendering/style/StyleCachedImage.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -176,7 +176,8 @@
     ASSERT(!m_isPending);
     if (!m_cachedImage)
         return;
-    m_cachedImage->addClient(renderer);
+    ASSERT(renderer);
+    m_cachedImage->addClient(*renderer);
 }
 
 void StyleCachedImage::removeClient(RenderElement* renderer)
@@ -184,7 +185,8 @@
     ASSERT(!m_isPending);
     if (!m_cachedImage)
         return;
-    m_cachedImage->removeClient(renderer);
+    ASSERT(renderer);
+    m_cachedImage->removeClient(*renderer);
 }
 
 RefPtr<Image> StyleCachedImage::image(RenderElement* renderer, const FloatSize&) const

Modified: trunk/Source/WebCore/svg/SVGFEImageElement.cpp (206866 => 206867)


--- trunk/Source/WebCore/svg/SVGFEImageElement.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/svg/SVGFEImageElement.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -76,7 +76,7 @@
 void SVGFEImageElement::clearResourceReferences()
 {
     if (m_cachedImage) {
-        m_cachedImage->removeClient(this);
+        m_cachedImage->removeClient(*this);
         m_cachedImage = nullptr;
     }
 
@@ -93,7 +93,7 @@
     m_cachedImage = document().cachedResourceLoader().requestImage(WTFMove(request));
 
     if (m_cachedImage)
-        m_cachedImage->addClient(this);
+        m_cachedImage->addClient(*this);
 }
 
 void SVGFEImageElement::buildPendingResource()

Modified: trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp (206866 => 206867)


--- trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/svg/SVGFontFaceUriElement.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -50,7 +50,7 @@
 SVGFontFaceUriElement::~SVGFontFaceUriElement()
 {
     if (m_cachedFont)
-        m_cachedFont->removeClient(this);
+        m_cachedFont->removeClient(*this);
 }
 
 Ref<CSSFontFaceSrcValue> SVGFontFaceUriElement::srcValue() const
@@ -96,7 +96,7 @@
 void SVGFontFaceUriElement::loadFont()
 {
     if (m_cachedFont)
-        m_cachedFont->removeClient(this);
+        m_cachedFont->removeClient(*this);
 
     const AtomicString& href = ""
     if (!href.isNull()) {
@@ -108,7 +108,7 @@
         request.setInitiator(this);
         m_cachedFont = cachedResourceLoader.requestFont(WTFMove(request), isSVGFontTarget(*this));
         if (m_cachedFont) {
-            m_cachedFont->addClient(this);
+            m_cachedFont->addClient(*this);
             m_cachedFont->beginLoadIfNeeded(cachedResourceLoader);
         }
     } else

Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (206866 => 206867)


--- trunk/Source/WebCore/svg/SVGUseElement.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -79,7 +79,7 @@
 SVGUseElement::~SVGUseElement()
 {
     if (m_externalDocument)
-        m_externalDocument->removeClient(this);
+        m_externalDocument->removeClient(*this);
 }
 
 void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -563,7 +563,7 @@
         return;
 
     if (m_externalDocument)
-        m_externalDocument->removeClient(this);
+        m_externalDocument->removeClient(*this);
 
     if (externalDocumentURL.isNull())
         m_externalDocument = nullptr;
@@ -575,7 +575,7 @@
         request.setInitiator(this);
         m_externalDocument = document().cachedResourceLoader().requestSVGDocument(WTFMove(request));
         if (m_externalDocument)
-            m_externalDocument->addClient(this);
+            m_externalDocument->addClient(*this);
     }
 
     invalidateShadowTree();

Modified: trunk/Source/WebCore/xml/XSLImportRule.cpp (206866 => 206867)


--- trunk/Source/WebCore/xml/XSLImportRule.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/xml/XSLImportRule.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -43,9 +43,9 @@
 {
     if (m_styleSheet)
         m_styleSheet->setParentStyleSheet(nullptr);
-    
+
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(this);
+        m_cachedSheet->removeClient(*this);
 }
 
 void XSLImportRule::setXSLStyleSheet(const String& href, const URL& baseURL, const String& sheet)
@@ -61,7 +61,7 @@
 
     m_styleSheet->parseString(sheet);
     m_loading = false;
-    
+
     if (parent)
         parent->checkLoaded();
 }
@@ -84,7 +84,7 @@
 
     if (rootSheet)
         cachedResourceLoader = rootSheet->cachedResourceLoader();
-    
+
     String absHref = m_strHref;
     XSLStyleSheet* parentSheet = parentStyleSheet();
     if (!parentSheet->baseURL().isNull())
@@ -99,7 +99,7 @@
     }
 
     if (m_cachedSheet)
-        m_cachedSheet->removeClient(this);
+        m_cachedSheet->removeClient(*this);
 
     auto options = CachedResourceLoader::defaultCachedResourceOptions();
     options.mode = FetchOptions::Mode::SameOrigin;
@@ -106,7 +106,7 @@
     m_cachedSheet = cachedResourceLoader->requestXSLStyleSheet({ResourceRequest(cachedResourceLoader->document()->completeURL(absHref)), options});
 
     if (m_cachedSheet) {
-        m_cachedSheet->addClient(this);
+        m_cachedSheet->addClient(*this);
 
         // If the imported sheet is in the cache, then setXSLStyleSheet gets called,
         // and the sheet even gets parsed (via parseString).  In this case we have

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (206866 => 206867)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -237,7 +237,7 @@
     bool errorOccurred = m_pendingScript->errorOccurred();
     bool wasCanceled = m_pendingScript->wasCanceled();
 
-    m_pendingScript->removeClient(this);
+    m_pendingScript->removeClient(*this);
     m_pendingScript = nullptr;
 
     RefPtr<Element> e = m_scriptElement;

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (206866 => 206867)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2016-10-06 16:53:58 UTC (rev 206867)
@@ -666,7 +666,7 @@
 
     // FIXME: m_pendingScript handling should be moved into XMLDocumentParser.cpp!
     if (m_pendingScript)
-        m_pendingScript->removeClient(this);
+        m_pendingScript->removeClient(*this);
 }
 
 void XMLDocumentParser::doWrite(const String& parseString)
@@ -927,7 +927,7 @@
             // https://bugs.webkit.org/show_bug.cgi?id=161651
             m_pendingScript = &downcast<LoadableClassicScript>(*scriptElement->loadableScript()).cachedScript();
             m_scriptElement = &element;
-            m_pendingScript->addClient(this);
+            m_pendingScript->addClient(*this);
 
             // m_pendingScript will be 0 if script was already loaded and addClient() executed it.
             if (m_pendingScript)

Modified: trunk/Source/WebKit/mac/ChangeLog (206866 => 206867)


--- trunk/Source/WebKit/mac/ChangeLog	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebKit/mac/ChangeLog	2016-10-06 16:53:58 UTC (rev 206867)
@@ -1,3 +1,13 @@
+2016-10-06  Youenn Fablet  <[email protected]>
+
+        CachedResource client handling methods should take reference
+        https://bugs.webkit.org/show_bug.cgi?id=163014
+
+        Reviewed by Alex Christensen.
+
+        * WebView/WebHTMLView.mm:
+        (promisedDataClient):
+
 2016-10-05  Myles C. Maxfield  <[email protected]>
 
         Put variation fonts work behind a compile-time flag

Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (206866 => 206867)


--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2016-10-06 16:38:48 UTC (rev 206866)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2016-10-06 16:53:58 UTC (rev 206867)
@@ -789,10 +789,10 @@
 
 #if !PLATFORM(IOS)
 // We need this to be able to safely reference the CachedImage for the promised drag data
-static CachedImageClient* promisedDataClient()
+static CachedImageClient& promisedDataClient()
 {
     static CachedImageClient* staticCachedResourceClient = new CachedImageClient;
-    return staticCachedResourceClient;
+    return *staticCachedResourceClient;
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to