Changeset 206903 in webkit
- Timestamp:
- Oct 7, 2016 12:02:02 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206902 r206903 1 2016-10-07 Youenn Fablet <youenn@apple.com> 2 3 Refactor CachedResourceClient::notifyFinished 4 https://bugs.webkit.org/show_bug.cgi?id=162060 5 6 Reviewed by Darin Adler. 7 8 No change of behavior. 9 10 Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers. 11 In most cases, the CachedResource parameter is only used for assertions. 12 Removing that parameter might be contemplated in the future. 13 The only real case is in RenderImage. 14 15 Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values. 16 17 * dom/LoadableClassicScript.cpp: 18 (WebCore::LoadableClassicScript::notifyFinished): 19 * dom/LoadableClassicScript.h: 20 * html/HTMLImageLoader.cpp: 21 (WebCore::HTMLImageLoader::notifyFinished): 22 * html/HTMLImageLoader.h: 23 * loader/ContentFilter.cpp: 24 (WebCore::ContentFilter::continueAfterResponseReceived): 25 (WebCore::ContentFilter::continueAfterDataReceived): 26 (WebCore::ContentFilter::continueAfterNotifyFinished): 27 (WebCore::ContentFilter::deliverResourceData): 28 * loader/ContentFilter.h: 29 * loader/CrossOriginPreflightChecker.cpp: 30 (WebCore::CrossOriginPreflightChecker::notifyFinished): 31 * loader/CrossOriginPreflightChecker.h: 32 * loader/DocumentLoader.cpp: 33 (WebCore::DocumentLoader::notifyFinished): 34 (WebCore::DocumentLoader::handleSubstituteDataLoadNow): 35 (WebCore::DocumentLoader::redirectReceived): 36 (WebCore::DocumentLoader::responseReceived): 37 (WebCore::DocumentLoader::continueAfterContentPolicy): 38 (WebCore::DocumentLoader::dataReceived): 39 * loader/DocumentLoader.h: 40 * loader/DocumentThreadableLoader.cpp: 41 (WebCore::DocumentThreadableLoader::redirectReceived): 42 (WebCore::DocumentThreadableLoader::dataSent): 43 (WebCore::DocumentThreadableLoader::responseReceived): 44 (WebCore::DocumentThreadableLoader::dataReceived): 45 (WebCore::DocumentThreadableLoader::notifyFinished): 46 * loader/DocumentThreadableLoader.h: 47 * loader/ImageLoader.cpp: 48 (WebCore::ImageLoader::notifyFinished): 49 * loader/ImageLoader.h: 50 * loader/LinkLoader.cpp: 51 (WebCore::LinkLoader::triggerEvents): 52 (WebCore::LinkLoader::notifyFinished): 53 * loader/LinkLoader.h: 54 * loader/LinkPreloadResourceClients.cpp: 55 (WebCore::LinkPreloadResourceClient::triggerEvents): 56 * loader/LinkPreloadResourceClients.h: 57 * loader/MediaResourceLoader.cpp: 58 (WebCore::MediaResource::responseReceived): 59 (WebCore::MediaResource::shouldCacheResponse): 60 (WebCore::MediaResource::redirectReceived): 61 (WebCore::MediaResource::dataSent): 62 (WebCore::MediaResource::dataReceived): 63 (WebCore::MediaResource::notifyFinished): 64 (WebCore::MediaResource::getOrCreateReadBuffer): 65 * loader/MediaResourceLoader.h: 66 * loader/TextTrackLoader.cpp: 67 (WebCore::TextTrackLoader::processNewCueData): 68 (WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource): 69 (WebCore::TextTrackLoader::notifyFinished): 70 * loader/TextTrackLoader.h: 71 * loader/cache/CachedRawResource.cpp: 72 (WebCore::CachedRawResource::notifyClientsDataWasReceived): 73 (WebCore::CachedRawResource::didAddClient): 74 (WebCore::CachedRawResource::redirectReceived): 75 (WebCore::CachedRawResource::responseReceived): 76 (WebCore::CachedRawResource::shouldCacheResponse): 77 (WebCore::CachedRawResource::didSendData): 78 * loader/cache/CachedRawResourceClient.h: 79 (WebCore::CachedRawResourceClient::dataSent): 80 (WebCore::CachedRawResourceClient::responseReceived): 81 (WebCore::CachedRawResourceClient::shouldCacheResponse): 82 (WebCore::CachedRawResourceClient::dataReceived): 83 (WebCore::CachedRawResourceClient::redirectReceived): 84 (WebCore::CachedRawResourceClient::getOrCreateReadBuffer): 85 * loader/cache/CachedResource.cpp: 86 (WebCore::CachedResource::checkNotify): 87 (WebCore::CachedResource::didAddClient): 88 * loader/cache/CachedResourceClient.h: 89 (WebCore::CachedResourceClient::notifyFinished): 90 (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource): 91 * loader/cache/CachedTextTrack.cpp: 92 (WebCore::CachedTextTrack::updateData): 93 * loader/icon/IconLoader.cpp: 94 (WebCore::IconLoader::notifyFinished): 95 * loader/icon/IconLoader.h: 96 * loader/soup/CachedRawResourceSoup.cpp: 97 * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp: 98 (WebCore::WebCoreAVCFResourceLoader::responseReceived): 99 (WebCore::WebCoreAVCFResourceLoader::dataReceived): 100 (WebCore::WebCoreAVCFResourceLoader::notifyFinished): 101 (WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource): 102 * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h: 103 * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h: 104 * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: 105 (WebCore::WebCoreAVFResourceLoader::responseReceived): 106 (WebCore::WebCoreAVFResourceLoader::dataReceived): 107 (WebCore::WebCoreAVFResourceLoader::notifyFinished): 108 (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): 109 * rendering/RenderImage.cpp: 110 (WebCore::RenderImage::notifyFinished): 111 * rendering/RenderImage.h: 112 * rendering/RenderLayerFilterInfo.cpp: 113 (WebCore::RenderLayer::FilterInfo::setRenderer): 114 (WebCore::RenderLayer::FilterInfo::notifyFinished): 115 * rendering/RenderLayerFilterInfo.h: 116 * svg/SVGFEImageElement.cpp: 117 (WebCore::SVGFEImageElement::notifyFinished): 118 * svg/SVGFEImageElement.h: 119 * svg/SVGUseElement.cpp: 120 (WebCore::SVGUseElement::notifyFinished): 121 * svg/SVGUseElement.h: 122 * xml/parser/XMLDocumentParser.cpp: 123 (WebCore::XMLDocumentParser::notifyFinished): 124 * xml/parser/XMLDocumentParser.h: 125 1 126 2016-10-06 Youenn Fablet <youenn@apple.com> 2 127 -
trunk/Source/WebCore/dom/LoadableClassicScript.cpp
r206867 r206903 68 68 } 69 69 70 void LoadableClassicScript::notifyFinished(CachedResource *resource)70 void LoadableClassicScript::notifyFinished(CachedResource& resource) 71 71 { 72 ASSERT(resource); 73 if (resource->resourceError().isAccessControl()) { 72 if (resource.resourceError().isAccessControl()) { 74 73 static NeverDestroyed<String> consoleMessage(ASCIILiteral("Cross-origin script load denied by Cross-Origin Resource Sharing policy.")); 75 74 m_error = Error { -
trunk/Source/WebCore/dom/LoadableClassicScript.h
r205854 r206903 56 56 LoadableClassicScript(CachedResourceHandle<CachedScript>&& cachedScript) : m_cachedScript(WTFMove(cachedScript)) { } 57 57 58 void notifyFinished(CachedResource *) override;58 void notifyFinished(CachedResource&) final; 59 59 60 60 CachedResourceHandle<CachedScript> m_cachedScript; -
trunk/Source/WebCore/html/HTMLImageLoader.cpp
r182266 r206903 74 74 } 75 75 76 void HTMLImageLoader::notifyFinished(CachedResource *)76 void HTMLImageLoader::notifyFinished(CachedResource&) 77 77 { 78 CachedImage* cachedImage = image(); 78 ASSERT(image()); 79 CachedImage& cachedImage = *image(); 79 80 80 81 Ref<Element> protect(element()); 81 82 ImageLoader::notifyFinished(cachedImage); 82 83 83 bool loadError = cachedImage ->errorOccurred() || cachedImage->response().httpStatusCode() >= 400;84 bool loadError = cachedImage.errorOccurred() || cachedImage.response().httpStatusCode() >= 400; 84 85 if (!loadError) { 85 86 if (!element().inDocument()) { … … 88 89 // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated. 89 90 // https://bugs.webkit.org/show_bug.cgi?id=142595 90 vm.heap.deprecatedReportExtraMemory(cachedImage ->encodedSize());91 vm.heap.deprecatedReportExtraMemory(cachedImage.encodedSize()); 91 92 } 92 93 } -
trunk/Source/WebCore/html/HTMLImageLoader.h
r197563 r206903 21 21 */ 22 22 23 #ifndef HTMLImageLoader_h 24 #define HTMLImageLoader_h 23 #pragma once 25 24 26 25 #include "ImageLoader.h" … … 36 35 String sourceURI(const AtomicString&) const override; 37 36 38 void notifyFinished(CachedResource *) override;37 void notifyFinished(CachedResource&) final; 39 38 }; 40 39 41 40 } 42 43 #endif -
trunk/Source/WebCore/loader/ContentFilter.cpp
r203003 r206903 134 134 } 135 135 136 bool ContentFilter::continueAfterResponseReceived(CachedResource* resource, const ResourceResponse& response) 137 { 138 ASSERT_UNUSED(resource, resource == m_mainResource); 136 bool ContentFilter::continueAfterResponseReceived(const ResourceResponse& response) 137 { 139 138 Ref<DocumentLoader> protectedDocumentLoader { m_documentLoader }; 140 139 … … 149 148 } 150 149 151 bool ContentFilter::continueAfterDataReceived(CachedResource* resource, const char* data, int length) 152 { 153 ASSERT(resource == m_mainResource); 150 bool ContentFilter::continueAfterDataReceived(const char* data, int length) 151 { 154 152 Ref<DocumentLoader> protectedDocumentLoader { m_documentLoader }; 155 153 156 154 if (m_state == State::Filtering) { 157 LOG(ContentFiltering, "ContentFilter received %d bytes of data from <%s>.\n", length, resource->url().string().ascii().data());155 LOG(ContentFiltering, "ContentFilter received %d bytes of data from <%s>.\n", length, m_mainResource->url().string().ascii().data()); 158 156 forEachContentFilterUntilBlocked([data, length](PlatformContentFilter& contentFilter) { 159 157 contentFilter.addData(data, length); … … 161 159 162 160 if (m_state == State::Allowed) 163 deliverResourceData(* resource);161 deliverResourceData(*m_mainResource); 164 162 return false; 165 163 } … … 168 166 } 169 167 170 bool ContentFilter::continueAfterNotifyFinished(CachedResource *resource)171 { 172 ASSERT (resource == m_mainResource);168 bool ContentFilter::continueAfterNotifyFinished(CachedResource& resource) 169 { 170 ASSERT_UNUSED(resource, &resource == m_mainResource); 173 171 Ref<DocumentLoader> protectedDocumentLoader { m_documentLoader }; 174 172 175 if ( resource->errorOccurred())173 if (m_mainResource->errorOccurred()) 176 174 return true; 177 175 178 176 if (m_state == State::Filtering) { 179 LOG(ContentFiltering, "ContentFilter will finish filtering main resource at <%s>.\n", resource->url().string().ascii().data());177 LOG(ContentFiltering, "ContentFilter will finish filtering main resource at <%s>.\n", m_mainResource->url().string().ascii().data()); 180 178 forEachContentFilterUntilBlocked([](PlatformContentFilter& contentFilter) { 181 179 contentFilter.finishedAddingData(); … … 184 182 if (m_state != State::Blocked) { 185 183 m_state = State::Allowed; 186 deliverResourceData(* resource);184 deliverResourceData(*m_mainResource); 187 185 } 188 186 … … 251 249 ASSERT(resource.dataBufferingPolicy() == BufferData); 252 250 if (auto* resourceBuffer = resource.resourceBuffer()) 253 m_documentLoader.dataReceived( &resource, resourceBuffer->data(), resourceBuffer->size());251 m_documentLoader.dataReceived(resource, resourceBuffer->data(), resourceBuffer->size()); 254 252 } 255 253 -
trunk/Source/WebCore/loader/ContentFilter.h
r203003 r206903 58 58 59 59 bool continueAfterWillSendRequest(ResourceRequest&, const ResourceResponse&); 60 bool continueAfterResponseReceived( CachedResource*,const ResourceResponse&);61 bool continueAfterDataReceived( CachedResource*,const char* data, int length);62 bool continueAfterNotifyFinished(CachedResource *);60 bool continueAfterResponseReceived(const ResourceResponse&); 61 bool continueAfterDataReceived(const char* data, int length); 62 bool continueAfterNotifyFinished(CachedResource&); 63 63 64 64 static bool continueAfterSubstituteDataRequest(const DocumentLoader& activeLoader, const SubstituteData&); -
trunk/Source/WebCore/loader/CrossOriginPreflightChecker.cpp
r206867 r206903 87 87 } 88 88 89 void CrossOriginPreflightChecker::notifyFinished(CachedResource *resource)89 void CrossOriginPreflightChecker::notifyFinished(CachedResource& resource) 90 90 { 91 ASSERT_UNUSED(resource, resource == m_resource);91 ASSERT_UNUSED(resource, &resource == m_resource); 92 92 if (m_resource->loadFailedOrCanceled()) { 93 93 ResourceError preflightError = m_resource->resourceError(); -
trunk/Source/WebCore/loader/CrossOriginPreflightChecker.h
r202336 r206903 54 54 55 55 private: 56 void notifyFinished(CachedResource *) final;56 void notifyFinished(CachedResource&) final; 57 57 58 58 static void handleLoadingFailure(DocumentThreadableLoader&, unsigned long, const ResourceError&); -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r206867 r206903 374 374 } 375 375 376 void DocumentLoader::notifyFinished(CachedResource *resource)376 void DocumentLoader::notifyFinished(CachedResource& resource) 377 377 { 378 378 #if ENABLE(CONTENT_FILTERING) … … 381 381 #endif 382 382 383 ASSERT_UNUSED(resource, m_mainResource == resource);383 ASSERT_UNUSED(resource, m_mainResource == &resource); 384 384 ASSERT(m_mainResource); 385 385 if (!m_mainResource->errorOccurred() && !m_mainResource->wasCanceled()) { … … 472 472 response = ResourceResponse(m_request.url(), m_substituteData.mimeType(), m_substituteData.content()->size(), m_substituteData.textEncoding()); 473 473 474 responseReceived( 0,response);474 responseReceived(response); 475 475 } 476 476 … … 493 493 } 494 494 495 void DocumentLoader::redirectReceived(CachedResource *resource, ResourceRequest& request, const ResourceResponse& redirectResponse)496 { 497 ASSERT_UNUSED(resource, resource == m_mainResource);495 void DocumentLoader::redirectReceived(CachedResource& resource, ResourceRequest& request, const ResourceResponse& redirectResponse) 496 { 497 ASSERT_UNUSED(resource, &resource == m_mainResource); 498 498 willSendRequest(request, redirectResponse); 499 499 } … … 633 633 } 634 634 635 void DocumentLoader::responseReceived(CachedResource* resource, const ResourceResponse& response) 635 void DocumentLoader::responseReceived(CachedResource& resource, const ResourceResponse& response) 636 { 637 ASSERT_UNUSED(resource, m_mainResource == &resource); 638 responseReceived(response); 639 } 640 641 void DocumentLoader::responseReceived(const ResourceResponse& response) 636 642 { 637 643 #if ENABLE(CONTENT_FILTERING) 638 if (m_contentFilter && !m_contentFilter->continueAfterResponseReceived(resource, response)) 639 return; 640 #endif 641 642 ASSERT_UNUSED(resource, m_mainResource == resource); 644 if (m_contentFilter && !m_contentFilter->continueAfterResponseReceived(response)) 645 return; 646 #endif 647 643 648 Ref<DocumentLoader> protectedThis(*this); 644 649 bool willLoadFallback = m_applicationCacheHost->maybeLoadFallbackForMainResponse(request(), response); … … 822 827 auto content = m_substituteData.content(); 823 828 if (content && content->size()) 824 dataReceived( nullptr,content->data(), content->size());829 dataReceived(content->data(), content->size()); 825 830 if (isLoadingMainResource()) 826 831 finishedLoading(0); … … 930 935 } 931 936 932 void DocumentLoader::dataReceived(CachedResource* resource, const char* data, int length) 937 void DocumentLoader::dataReceived(CachedResource& resource, const char* data, int length) 938 { 939 ASSERT_UNUSED(resource, &resource == m_mainResource); 940 dataReceived(data, length); 941 } 942 943 void DocumentLoader::dataReceived(const char* data, int length) 933 944 { 934 945 #if ENABLE(CONTENT_FILTERING) 935 if (m_contentFilter && !m_contentFilter->continueAfterDataReceived( resource,data, length))946 if (m_contentFilter && !m_contentFilter->continueAfterDataReceived(data, length)) 936 947 return; 937 948 #endif … … 939 950 ASSERT(data); 940 951 ASSERT(length); 941 ASSERT_UNUSED(resource, resource == m_mainResource);942 952 ASSERT(!m_response.isNull()); 943 953 -
trunk/Source/WebCore/loader/DocumentLoader.h
r206189 r206903 317 317 void finishedLoading(double finishTime); 318 318 void mainReceivedError(const ResourceError&); 319 WEBCORE_EXPORT void redirectReceived(CachedResource*, ResourceRequest&, const ResourceResponse&) override; 320 WEBCORE_EXPORT void responseReceived(CachedResource*, const ResourceResponse&) override; 321 WEBCORE_EXPORT void dataReceived(CachedResource*, const char* data, int length) override; 322 WEBCORE_EXPORT void notifyFinished(CachedResource*) override; 319 WEBCORE_EXPORT void redirectReceived(CachedResource&, ResourceRequest&, const ResourceResponse&) override; 320 WEBCORE_EXPORT void responseReceived(CachedResource&, const ResourceResponse&) override; 321 WEBCORE_EXPORT void dataReceived(CachedResource&, const char* data, int length) override; 322 WEBCORE_EXPORT void notifyFinished(CachedResource&) override; 323 324 void responseReceived(const ResourceResponse&); 325 void dataReceived(const char* data, int length); 323 326 324 327 bool maybeLoadEmpty(); -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r206867 r206903 222 222 } 223 223 224 void DocumentThreadableLoader::redirectReceived(CachedResource *resource, ResourceRequest& request, const ResourceResponse& redirectResponse)225 { 226 ASSERT(m_client); 227 ASSERT_UNUSED(resource, resource == m_resource);224 void DocumentThreadableLoader::redirectReceived(CachedResource& resource, ResourceRequest& request, const ResourceResponse& redirectResponse) 225 { 226 ASSERT(m_client); 227 ASSERT_UNUSED(resource, &resource == m_resource); 228 228 229 229 Ref<DocumentThreadableLoader> protectedThis(*this); … … 277 277 } 278 278 279 void DocumentThreadableLoader::dataSent(CachedResource *resource, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)280 { 281 ASSERT(m_client); 282 ASSERT_UNUSED(resource, resource == m_resource);279 void DocumentThreadableLoader::dataSent(CachedResource& resource, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) 280 { 281 ASSERT(m_client); 282 ASSERT_UNUSED(resource, &resource == m_resource); 283 283 m_client->didSendData(bytesSent, totalBytesToBeSent); 284 284 } 285 285 286 void DocumentThreadableLoader::responseReceived(CachedResource *resource, const ResourceResponse& response)287 { 288 ASSERT_UNUSED(resource, resource == m_resource);286 void DocumentThreadableLoader::responseReceived(CachedResource& resource, const ResourceResponse& response) 287 { 288 ASSERT_UNUSED(resource, &resource == m_resource); 289 289 didReceiveResponse(m_resource->identifier(), response, m_resource->responseTainting()); 290 290 } … … 308 308 } 309 309 310 void DocumentThreadableLoader::dataReceived(CachedResource *resource, const char* data, int dataLength)311 { 312 ASSERT_UNUSED(resource, resource == m_resource);310 void DocumentThreadableLoader::dataReceived(CachedResource& resource, const char* data, int dataLength) 311 { 312 ASSERT_UNUSED(resource, &resource == m_resource); 313 313 didReceiveData(m_resource->identifier(), data, dataLength); 314 314 } … … 321 321 } 322 322 323 void DocumentThreadableLoader::notifyFinished(CachedResource *resource)324 { 325 ASSERT(m_client); 326 ASSERT_UNUSED(resource, resource == m_resource);323 void DocumentThreadableLoader::notifyFinished(CachedResource& resource) 324 { 325 ASSERT(m_client); 326 ASSERT_UNUSED(resource, &resource == m_resource); 327 327 328 328 if (m_resource->errorOccurred()) -
trunk/Source/WebCore/loader/DocumentThreadableLoader.h
r206254 r206903 78 78 79 79 // CachedRawResourceClient 80 void dataSent(CachedResource *, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;81 void responseReceived(CachedResource *, const ResourceResponse&) override;82 void dataReceived(CachedResource *, const char* data, int dataLength) override;83 void redirectReceived(CachedResource *, ResourceRequest&, const ResourceResponse&) override;84 void notifyFinished(CachedResource *) override;80 void dataSent(CachedResource&, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override; 81 void responseReceived(CachedResource&, const ResourceResponse&) override; 82 void dataReceived(CachedResource&, const char* data, int dataLength) override; 83 void redirectReceived(CachedResource&, ResourceRequest&, const ResourceResponse&) override; 84 void notifyFinished(CachedResource&) override; 85 85 86 86 void didReceiveResponse(unsigned long identifier, const ResourceResponse&, ResourceResponse::Tainting); -
trunk/Source/WebCore/loader/ImageLoader.cpp
r206867 r206903 271 271 } 272 272 273 void ImageLoader::notifyFinished(CachedResource *resource)273 void ImageLoader::notifyFinished(CachedResource& resource) 274 274 { 275 275 ASSERT(m_failedLoadURL.isEmpty()); 276 ASSERT (resource == m_image.get());276 ASSERT_UNUSED(resource, &resource == m_image.get()); 277 277 278 278 m_imageComplete = true; … … 283 283 return; 284 284 285 if ( resource->resourceError().isAccessControl()) {285 if (m_image->resourceError().isAccessControl()) { 286 286 clearImageWithoutConsideringPendingLoadEvent(); 287 287 … … 300 300 } 301 301 302 if ( resource->wasCanceled()) {302 if (m_image->wasCanceled()) { 303 303 m_hasPendingLoadEvent = false; 304 304 // Only consider updating the protection ref-count of the Element immediately before returning -
trunk/Source/WebCore/loader/ImageLoader.h
r202278 r206903 21 21 */ 22 22 23 #ifndef ImageLoader_h 24 #define ImageLoader_h 23 #pragma once 25 24 26 25 #include "CachedImageClient.h" … … 74 73 protected: 75 74 explicit ImageLoader(Element&); 76 void notifyFinished(CachedResource *) override;75 void notifyFinished(CachedResource&) override; 77 76 78 77 private: … … 108 107 109 108 } 110 111 #endif -
trunk/Source/WebCore/loader/LinkLoader.cpp
r206900 r206903 66 66 } 67 67 68 void LinkLoader::triggerEvents(const CachedResource *resource)69 { 70 if (resource ->errorOccurred())68 void LinkLoader::triggerEvents(const CachedResource& resource) 69 { 70 if (resource.errorOccurred()) 71 71 m_client.linkLoadingErrored(); 72 72 else … … 74 74 } 75 75 76 void LinkLoader::notifyFinished(CachedResource *resource)77 { 78 ASSERT_UNUSED(resource, m_cachedLinkResource.get() == resource);79 80 triggerEvents( m_cachedLinkResource.get());76 void LinkLoader::notifyFinished(CachedResource& resource) 77 { 78 ASSERT_UNUSED(resource, m_cachedLinkResource.get() == &resource); 79 80 triggerEvents(*m_cachedLinkResource); 81 81 82 82 m_cachedLinkResource->removeClient(*this); -
trunk/Source/WebCore/loader/LinkLoader.h
r205269 r206903 30 30 */ 31 31 32 #ifndef LinkLoader_h 33 #define LinkLoader_h 32 #pragma once 34 33 35 34 #include "CachedResource.h" … … 57 56 58 57 WeakPtr<LinkLoader> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); } 59 void triggerEvents(const CachedResource *);58 void triggerEvents(const CachedResource&); 60 59 61 60 private: 62 void notifyFinished(CachedResource *) override;61 void notifyFinished(CachedResource&) override; 63 62 void preloadIfNeeded(const LinkRelAttribute&, const URL& href, Document&, const String& as, const String& crossOriginMode); 64 63 … … 68 67 WeakPtrFactory<LinkLoader> m_weakPtrFactory; 69 68 }; 70 69 71 70 } 72 73 #endif -
trunk/Source/WebCore/loader/LinkPreloadResourceClients.cpp
r205269 r206903 38 38 } 39 39 40 void LinkPreloadResourceClient::triggerEvents(const CachedResource *resource)40 void LinkPreloadResourceClient::triggerEvents(const CachedResource& resource) 41 41 { 42 42 if (m_loader) -
trunk/Source/WebCore/loader/LinkPreloadResourceClients.h
r206867 r206903 47 47 virtual ~LinkPreloadResourceClient() { } 48 48 49 void triggerEvents(const CachedResource *);49 void triggerEvents(const CachedResource&); 50 50 51 51 virtual void clear() = 0; … … 84 84 85 85 86 void notifyFinished(CachedResource* resource) override 87 { 88 ASSERT(ownedResource() == resource); 89 triggerEvents(resource); 90 } 86 void notifyFinished(CachedResource& resource) override { triggerEvents(resource); } 91 87 92 88 void clear() override { clearResource(*this); } … … 111 107 void setCSSStyleSheet(const String&, const URL&, const String&, const CachedCSSStyleSheet* resource) override 112 108 { 109 ASSERT(resource); 113 110 ASSERT(ownedResource() == resource); 114 triggerEvents( resource);111 triggerEvents(*resource); 115 112 } 116 113 … … 134 131 virtual ~LinkPreloadImageResourceClient() { } 135 132 136 void notifyFinished(CachedResource* resource) override 137 { 138 ASSERT(ownedResource() == resource); 139 triggerEvents(resource); 140 } 133 void notifyFinished(CachedResource& resource) override { triggerEvents(resource); } 141 134 142 135 void clear() override { clearResource(*this); } … … 162 155 { 163 156 ASSERT(ownedResource() == &resource); 164 triggerEvents( &resource);157 triggerEvents(resource); 165 158 } 166 159 … … 184 177 virtual ~LinkPreloadRawResourceClient() { } 185 178 186 void notifyFinished(CachedResource* resource) override 187 { 188 ASSERT(ownedResource() == resource); 189 triggerEvents(resource); 190 } 179 void notifyFinished(CachedResource& resource) override { triggerEvents(resource); } 191 180 192 181 void clear() override { clearResource(*this); } -
trunk/Source/WebCore/loader/MediaResourceLoader.cpp
r206867 r206903 130 130 } 131 131 132 void MediaResource::responseReceived(CachedResource *resource, const ResourceResponse& response)133 { 134 ASSERT_UNUSED(resource, resource == m_resource);132 void MediaResource::responseReceived(CachedResource& resource, const ResourceResponse& response) 133 { 134 ASSERT_UNUSED(resource, &resource == m_resource); 135 135 136 136 if (!m_loader->document()) … … 138 138 139 139 RefPtr<MediaResource> protectedThis(this); 140 if (!m_loader->crossOriginMode().isNull() && ! resource->passesSameOriginPolicyCheck(*m_loader->document()->securityOrigin())) {140 if (!m_loader->crossOriginMode().isNull() && !m_resource->passesSameOriginPolicyCheck(*m_loader->document()->securityOrigin())) { 141 141 static NeverDestroyed<const String> consoleMessage("Cross-origin media resource load denied by Cross-Origin Resource Sharing policy."); 142 142 m_loader->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, consoleMessage.get()); … … 153 153 } 154 154 155 bool MediaResource::shouldCacheResponse(CachedResource *resource, const ResourceResponse& response)156 { 157 ASSERT_UNUSED(resource, resource == m_resource);155 bool MediaResource::shouldCacheResponse(CachedResource& resource, const ResourceResponse& response) 156 { 157 ASSERT_UNUSED(resource, &resource == m_resource); 158 158 159 159 RefPtr<MediaResource> protectedThis(this); … … 163 163 } 164 164 165 void MediaResource::redirectReceived(CachedResource *resource, ResourceRequest& request, const ResourceResponse& response)166 { 167 ASSERT_UNUSED(resource, resource == m_resource);165 void MediaResource::redirectReceived(CachedResource& resource, ResourceRequest& request, const ResourceResponse& response) 166 { 167 ASSERT_UNUSED(resource, &resource == m_resource); 168 168 169 169 RefPtr<MediaResource> protectedThis(this); … … 172 172 } 173 173 174 void MediaResource::dataSent(CachedResource *resource, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)175 { 176 ASSERT_UNUSED(resource, resource == m_resource);174 void MediaResource::dataSent(CachedResource& resource, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) 175 { 176 ASSERT_UNUSED(resource, &resource == m_resource); 177 177 178 178 RefPtr<MediaResource> protectedThis(this); … … 181 181 } 182 182 183 void MediaResource::dataReceived(CachedResource *resource, const char* data, int dataLength)184 { 185 ASSERT_UNUSED(resource, resource == m_resource);183 void MediaResource::dataReceived(CachedResource& resource, const char* data, int dataLength) 184 { 185 ASSERT_UNUSED(resource, &resource == m_resource); 186 186 187 187 RefPtr<MediaResource> protectedThis(this); … … 190 190 } 191 191 192 void MediaResource::notifyFinished(CachedResource *resource)193 { 194 ASSERT (resource == m_resource);192 void MediaResource::notifyFinished(CachedResource& resource) 193 { 194 ASSERT_UNUSED(resource, &resource == m_resource); 195 195 196 196 RefPtr<MediaResource> protectedThis(this); 197 197 if (m_client) { 198 if ( resource->loadFailedOrCanceled())199 m_client->loadFailed(*this, resource->resourceError());198 if (m_resource->loadFailedOrCanceled()) 199 m_client->loadFailed(*this, m_resource->resourceError()); 200 200 else 201 201 m_client->loadFinished(*this); … … 205 205 206 206 #if USE(SOUP) 207 char* MediaResource::getOrCreateReadBuffer(CachedResource *resource, size_t requestedSize, size_t& actualSize)208 { 209 ASSERT_UNUSED(resource, resource == m_resource);207 char* MediaResource::getOrCreateReadBuffer(CachedResource& resource, size_t requestedSize, size_t& actualSize) 208 { 209 ASSERT_UNUSED(resource, &resource == m_resource); 210 210 return m_client ? m_client->getOrCreateReadBuffer(*this, requestedSize, actualSize) : nullptr; 211 211 } -
trunk/Source/WebCore/loader/MediaResourceLoader.h
r198549 r206903 71 71 bool didPassAccessControlCheck() const override { return m_didPassAccessControlCheck; } 72 72 73 // CachedR esourceClient74 void responseReceived(CachedResource *, const ResourceResponse&) override;75 void redirectReceived(CachedResource *, ResourceRequest&, const ResourceResponse&) override;76 bool shouldCacheResponse(CachedResource *, const ResourceResponse&) override;77 void dataSent(CachedResource *, unsigned long long, unsigned long long) override;78 void dataReceived(CachedResource *, const char*, int) override;79 void notifyFinished(CachedResource *) override;73 // CachedRawResourceClient 74 void responseReceived(CachedResource&, const ResourceResponse&) override; 75 void redirectReceived(CachedResource&, ResourceRequest&, const ResourceResponse&) override; 76 bool shouldCacheResponse(CachedResource&, const ResourceResponse&) override; 77 void dataSent(CachedResource&, unsigned long long, unsigned long long) override; 78 void dataReceived(CachedResource&, const char*, int) override; 79 void notifyFinished(CachedResource&) override; 80 80 #if USE(SOUP) 81 char* getOrCreateReadBuffer(CachedResource *, size_t /*requestedSize*/, size_t& /*actualSize*/) override;81 char* getOrCreateReadBuffer(CachedResource&, size_t /*requestedSize*/, size_t& /*actualSize*/) override; 82 82 #endif 83 83 -
trunk/Source/WebCore/loader/TextTrackLoader.cpp
r206867 r206903 79 79 } 80 80 81 void TextTrackLoader::processNewCueData(CachedResource *resource)82 { 83 ASSERT (m_resource ==resource);84 85 if (m_state == Failed || ! resource->resourceBuffer())86 return; 87 88 auto* buffer = resource->resourceBuffer();81 void TextTrackLoader::processNewCueData(CachedResource& resource) 82 { 83 ASSERT_UNUSED(resource, m_resource == &resource); 84 85 if (m_state == Failed || !m_resource->resourceBuffer()) 86 return; 87 88 auto* buffer = m_resource->resourceBuffer(); 89 89 if (m_parseOffset == buffer->size()) 90 90 return; … … 103 103 104 104 // FIXME: This is a very unusual pattern, no other CachedResourceClient does this. Refactor to use notifyFinished() instead. 105 void TextTrackLoader::deprecatedDidReceiveCachedResource(CachedResource *resource)106 { 107 ASSERT (m_resource ==resource);108 109 if (! resource->resourceBuffer())110 return; 111 112 processNewCueData( resource);105 void TextTrackLoader::deprecatedDidReceiveCachedResource(CachedResource& resource) 106 { 107 ASSERT_UNUSED(resource, m_resource == &resource); 108 109 if (!m_resource->resourceBuffer()) 110 return; 111 112 processNewCueData(*m_resource); 113 113 } 114 114 … … 121 121 } 122 122 123 void TextTrackLoader::notifyFinished(CachedResource *resource)124 { 125 ASSERT (m_resource ==resource);126 127 if ( resource->resourceError().isAccessControl())123 void TextTrackLoader::notifyFinished(CachedResource& resource) 124 { 125 ASSERT_UNUSED(resource, m_resource == &resource); 126 127 if (m_resource->resourceError().isAccessControl()) 128 128 corsPolicyPreventedLoad(); 129 129 130 130 if (m_state != Failed) { 131 processNewCueData( resource);131 processNewCueData(*m_resource); 132 132 if (m_cueParser) 133 133 m_cueParser->fileFinished(); 134 134 if (m_state != Failed) 135 m_state = resource->errorOccurred() ? Failed : Finished;135 m_state = m_resource->errorOccurred() ? Failed : Finished; 136 136 } 137 137 -
trunk/Source/WebCore/loader/TextTrackLoader.h
r205750 r206903 65 65 66 66 // CachedResourceClient 67 void notifyFinished(CachedResource *) override;68 void deprecatedDidReceiveCachedResource(CachedResource *) override;69 67 void notifyFinished(CachedResource&) override; 68 void deprecatedDidReceiveCachedResource(CachedResource&) override; 69 70 70 // WebVTTParserClient 71 71 void newCuesParsed() override; 72 72 void newRegionsParsed() override; 73 73 void fileFailedToParse() override; 74 75 void processNewCueData(CachedResource *);74 75 void processNewCueData(CachedResource&); 76 76 void cueLoadTimerFired(); 77 77 void corsPolicyPreventedLoad(); 78 78 79 79 enum State { Idle, Loading, Finished, Failed }; 80 80 81 81 TextTrackLoaderClient& m_client; 82 82 std::unique_ptr<WebVTTParser> m_cueParser; -
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
r206867 r206903 116 116 CachedResourceClientWalker<CachedRawResourceClient> w(m_clients); 117 117 while (CachedRawResourceClient* c = w.next()) 118 c->dataReceived( this, data, length);118 c->dataReceived(*this, data, length); 119 119 } 120 120 … … 132 132 RedirectPair redirect = m_redirectChain[i]; 133 133 ResourceRequest request(redirect.m_request); 134 client.redirectReceived( this, request, redirect.m_redirectResponse);134 client.redirectReceived(*this, request, redirect.m_redirectResponse); 135 135 if (!hasClient(c)) 136 136 return; … … 146 146 response.setSource(ResourceResponse::Source::MemoryCache); 147 147 } 148 client.responseReceived( this, response);148 client.responseReceived(*this, response); 149 149 } 150 150 if (!hasClient(c)) 151 151 return; 152 152 if (m_data) 153 client.dataReceived( this, m_data->data(), m_data->size());153 client.dataReceived(*this, m_data->data(), m_data->size()); 154 154 if (!hasClient(c)) 155 155 return; … … 169 169 CachedResourceClientWalker<CachedRawResourceClient> w(m_clients); 170 170 while (CachedRawResourceClient* c = w.next()) 171 c->redirectReceived( this, request, response);171 c->redirectReceived(*this, request, response); 172 172 m_redirectChain.append(RedirectPair(request, response)); 173 173 } … … 183 183 CachedResourceClientWalker<CachedRawResourceClient> w(m_clients); 184 184 while (CachedRawResourceClient* c = w.next()) 185 c->responseReceived( this, m_response);185 c->responseReceived(*this, m_response); 186 186 } 187 187 … … 190 190 CachedResourceClientWalker<CachedRawResourceClient> w(m_clients); 191 191 while (CachedRawResourceClient* c = w.next()) { 192 if (!c->shouldCacheResponse( this, response))192 if (!c->shouldCacheResponse(*this, response)) 193 193 return false; 194 194 } … … 200 200 CachedResourceClientWalker<CachedRawResourceClient> w(m_clients); 201 201 while (CachedRawResourceClient* c = w.next()) 202 c->dataSent( this, bytesSent, totalBytesToBeSent);202 c->dataSent(*this, bytesSent, totalBytesToBeSent); 203 203 } 204 204 -
trunk/Source/WebCore/loader/cache/CachedRawResourceClient.h
r201761 r206903 37 37 CachedResourceClientType resourceClientType() const override { return expectedType(); } 38 38 39 virtual void dataSent(CachedResource *, unsigned long long /* bytesSent */, unsigned long long /* totalBytesToBeSent */) { }40 virtual void responseReceived(CachedResource *, const ResourceResponse&) { }41 virtual bool shouldCacheResponse(CachedResource *, const ResourceResponse&) { return true; }42 virtual void dataReceived(CachedResource *, const char* /* data */, int /* length */) { }43 virtual void redirectReceived(CachedResource *, ResourceRequest&, const ResourceResponse&) { }39 virtual void dataSent(CachedResource&, unsigned long long /* bytesSent */, unsigned long long /* totalBytesToBeSent */) { } 40 virtual void responseReceived(CachedResource&, const ResourceResponse&) { } 41 virtual bool shouldCacheResponse(CachedResource&, const ResourceResponse&) { return true; } 42 virtual void dataReceived(CachedResource&, const char* /* data */, int /* length */) { } 43 virtual void redirectReceived(CachedResource&, ResourceRequest&, const ResourceResponse&) { } 44 44 #if USE(SOUP) 45 virtual char* getOrCreateReadBuffer(CachedResource *, size_t /* requestedSize */, size_t& /* actualSize */) { return nullptr; }45 virtual char* getOrCreateReadBuffer(CachedResource&, size_t /* requestedSize */, size_t& /* actualSize */) { return nullptr; } 46 46 #endif 47 47 }; -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r206902 r206903 374 374 CachedResourceClientWalker<CachedResourceClient> walker(m_clients); 375 375 while (CachedResourceClient* client = walker.next()) 376 client->notifyFinished( this);376 client->notifyFinished(*this); 377 377 } 378 378 … … 551 551 m_clients.add(&client); 552 552 if (!isLoading() && !stillNeedsLoad()) 553 client.notifyFinished( this);553 client.notifyFinished(*this); 554 554 } 555 555 -
trunk/Source/WebCore/loader/cache/CachedResourceClient.h
r181480 r206903 22 22 pages from the web. It has a memory cache for these objects. 23 23 */ 24 25 #ifndef CachedResourceClient_h 26 #define CachedResourceClient_h 24 #pragma once 27 25 28 26 namespace WebCore { … … 42 40 43 41 virtual ~CachedResourceClient() { } 44 virtual void notifyFinished(CachedResource *) { }45 virtual void deprecatedDidReceiveCachedResource(CachedResource *) { }42 virtual void notifyFinished(CachedResource&) { } 43 virtual void deprecatedDidReceiveCachedResource(CachedResource&) { } 46 44 virtual bool isXMLHttpRequest() const { return false; } 47 45 … … 54 52 55 53 } 56 57 #endif -
trunk/Source/WebCore/loader/cache/CachedTextTrack.cpp
r206016 r206903 51 51 CachedResourceClientWalker<CachedResourceClient> walker(m_clients); 52 52 while (CachedResourceClient* client = walker.next()) 53 client->deprecatedDidReceiveCachedResource( this);53 client->deprecatedDidReceiveCachedResource(*this); 54 54 } 55 55 -
trunk/Source/WebCore/loader/icon/IconLoader.cpp
r206867 r206903 80 80 } 81 81 82 void IconLoader::notifyFinished(CachedResource *resource)82 void IconLoader::notifyFinished(CachedResource& resource) 83 83 { 84 ASSERT (resource == m_resource);84 ASSERT_UNUSED(resource, &resource == m_resource); 85 85 86 86 // If we got a status code indicating an invalid response, then lets 87 87 // ignore the data and not try to decode the error page as an icon. 88 auto* data = resource->resourceBuffer();89 int status = resource->response().httpStatusCode();88 auto* data = m_resource->resourceBuffer(); 89 int status = m_resource->response().httpStatusCode(); 90 90 if (status && (status < 200 || status > 299)) 91 91 data = nullptr; … … 94 94 static unsigned pdfMagicNumberLength = sizeof(pdfMagicNumber) - 1; 95 95 if (data && data->size() >= pdfMagicNumberLength && !memcmp(data->data(), pdfMagicNumber, pdfMagicNumberLength)) { 96 LOG(IconDatabase, "IconLoader::finishLoading() - Ignoring icon at %s because it appears to be a PDF", resource->url().string().ascii().data());96 LOG(IconDatabase, "IconLoader::finishLoading() - Ignoring icon at %s because it appears to be a PDF", m_resource->url().string().ascii().data()); 97 97 data = nullptr; 98 98 } 99 99 100 LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", resource->url().string().ascii().data());101 m_frame.loader().icon().commitToDatabase( resource->url());100 LOG(IconDatabase, "IconLoader::finishLoading() - Committing iconURL %s to database", m_resource->url().string().ascii().data()); 101 m_frame.loader().icon().commitToDatabase(m_resource->url()); 102 102 // Setting the icon data only after committing to the database ensures that the data is 103 103 // kept in memory (so it does not have to be read from the database asynchronously), since 104 104 // there is a page URL referencing it. 105 iconDatabase().setIconDataForIconURL(data, resource->url().string());105 iconDatabase().setIconDataForIconURL(data, m_resource->url().string()); 106 106 m_frame.loader().client().dispatchDidReceiveIcon(); 107 107 stopLoading(); -
trunk/Source/WebCore/loader/icon/IconLoader.h
r204466 r206903 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #ifndef IconLoader_h 27 #define IconLoader_h 26 #pragma once 28 27 29 28 #include "CachedRawResourceClient.h" … … 47 46 48 47 private: 49 void notifyFinished(CachedResource *) override;48 void notifyFinished(CachedResource&) final; 50 49 51 50 Frame& m_frame; … … 54 53 55 54 } // namespace WebCore 56 57 #endif -
trunk/Source/WebCore/loader/soup/CachedRawResourceSoup.cpp
r191369 r206903 32 32 CachedResourceClientWalker<CachedRawResourceClient> w(m_clients); 33 33 while (CachedRawResourceClient* c = w.next()) { 34 if (char* bufferPtr = c->getOrCreateReadBuffer( this, requestedSize, actualSize))34 if (char* bufferPtr = c->getOrCreateReadBuffer(*this, requestedSize, actualSize)) 35 35 return bufferPtr; 36 36 } -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp
r206867 r206903 110 110 } 111 111 112 void WebCoreAVCFResourceLoader::responseReceived(CachedResource *resource, const ResourceResponse& response)112 void WebCoreAVCFResourceLoader::responseReceived(CachedResource& resource, const ResourceResponse& response) 113 113 { 114 ASSERT(resource == m_resource); 115 UNUSED_PARAM(resource); 114 ASSERT_UNUSED(resource, &resource == m_resource); 116 115 117 116 int status = response.httpStatusCode(); … … 125 124 } 126 125 127 void WebCoreAVCFResourceLoader::dataReceived(CachedResource *resource, const char*, int)126 void WebCoreAVCFResourceLoader::dataReceived(CachedResource& resource, const char*, int) 128 127 { 129 128 fulfillRequestWithResource(resource); 130 129 } 131 130 132 void WebCoreAVCFResourceLoader::notifyFinished(CachedResource *resource)131 void WebCoreAVCFResourceLoader::notifyFinished(CachedResource& resource) 133 132 { 134 if (resource ->loadFailedOrCanceled()) {133 if (resource.loadFailedOrCanceled()) { 135 134 // <rdar://problem/13987417> Set the contentType of the contentInformationRequest to an empty 136 135 // string to trigger AVAsset's playable value to complete loading. … … 149 148 } 150 149 151 void WebCoreAVCFResourceLoader::fulfillRequestWithResource(CachedResource *resource)150 void WebCoreAVCFResourceLoader::fulfillRequestWithResource(CachedResource& resource) 152 151 { 153 ASSERT (resource == m_resource);152 ASSERT_UNUSED(resource, &resource == m_resource); 154 153 notImplemented(); 155 154 } -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h
r197563 r206903 24 24 */ 25 25 26 #ifndef WebCoreAVCFResourceLoader_h 27 #define WebCoreAVCFResourceLoader_h 26 #pragma once 28 27 29 28 #if ENABLE(VIDEO) && USE(AVFOUNDATION) && HAVE(AVFOUNDATION_LOADER_DELEGATE) … … 57 56 58 57 private: 59 // CachedR esourceClient60 void responseReceived(CachedResource *, const ResourceResponse&) override;61 void dataReceived(CachedResource *, const char*, int) override;62 void notifyFinished(CachedResource *) override;58 // CachedRawResourceClient 59 void responseReceived(CachedResource&, const ResourceResponse&) override; 60 void dataReceived(CachedResource&, const char*, int) override; 61 void notifyFinished(CachedResource&) override; 63 62 64 void fulfillRequestWithResource(CachedResource *);63 void fulfillRequestWithResource(CachedResource&); 65 64 66 65 WebCoreAVCFResourceLoader(MediaPlayerPrivateAVFoundationCF* parent, AVCFAssetResourceLoadingRequestRef); … … 72 71 } 73 72 74 #endif // ENABLE(VIDEO) && USE(AVFOUNDATION) 75 76 #endif // WebCoreAVFResourceLoader_h 73 #endif // ENABLE(VIDEO) && USE(AVFOUNDATION) -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h
r197563 r206903 24 24 */ 25 25 26 #ifndef WebCoreAVFResourceLoader_h 27 #define WebCoreAVFResourceLoader_h 26 #pragma once 28 27 29 28 #if ENABLE(VIDEO) && USE(AVFOUNDATION) && HAVE(AVFOUNDATION_LOADER_DELEGATE) … … 58 57 private: 59 58 // CachedResourceClient 60 void responseReceived(CachedResource *, const ResourceResponse&) override;61 void dataReceived(CachedResource *, const char*, int) override;62 void notifyFinished(CachedResource *) override;59 void responseReceived(CachedResource&, const ResourceResponse&) override; 60 void dataReceived(CachedResource&, const char*, int) override; 61 void notifyFinished(CachedResource&) override; 63 62 64 void fulfillRequestWithResource(CachedResource *);63 void fulfillRequestWithResource(CachedResource&); 65 64 66 65 WebCoreAVFResourceLoader(MediaPlayerPrivateAVFoundationObjC* parent, AVAssetResourceLoadingRequest *); … … 72 71 } 73 72 74 #endif // ENABLE(VIDEO) && USE(AVFOUNDATION) 75 76 #endif // WebCoreAVFResourceLoader_h 73 #endif // ENABLE(VIDEO) && USE(AVFOUNDATION) -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm
r206867 r206903 107 107 } 108 108 109 void WebCoreAVFResourceLoader::responseReceived(CachedResource* resource, const ResourceResponse& response) 110 { 111 ASSERT(resource); 112 ASSERT(resource == m_resource); 109 void WebCoreAVFResourceLoader::responseReceived(CachedResource& resource, const ResourceResponse& response) 110 { 111 ASSERT_UNUSED(resource, &resource == m_resource); 113 112 114 113 int status = response.httpStatusCode(); … … 123 122 [contentInfo setContentType:uti]; 124 123 125 ParsedContentRange& contentRange = resource->response().contentRange();124 ParsedContentRange& contentRange = m_resource->response().contentRange(); 126 125 [contentInfo setContentLength:contentRange.isValid() ? contentRange.instanceLength() : response.expectedContentLength()]; 127 126 [contentInfo setByteRangeAccessSupported:YES]; … … 134 133 } 135 134 136 void WebCoreAVFResourceLoader::dataReceived(CachedResource *resource, const char*, int)135 void WebCoreAVFResourceLoader::dataReceived(CachedResource& resource, const char*, int) 137 136 { 138 137 fulfillRequestWithResource(resource); 139 138 } 140 139 141 void WebCoreAVFResourceLoader::notifyFinished(CachedResource *resource)142 { 143 if (resource ->loadFailedOrCanceled()) {140 void WebCoreAVFResourceLoader::notifyFinished(CachedResource& resource) 141 { 142 if (resource.loadFailedOrCanceled()) { 144 143 // <rdar://problem/13987417> Set the contentType of the contentInformationRequest to an empty 145 144 // string to trigger AVAsset's playable value to complete loading. … … 147 146 [[m_avRequest.get() contentInformationRequest] setContentType:@""]; 148 147 149 NSError* error = resource ->errorOccurred() ? resource->resourceError().nsError() : nil;148 NSError* error = resource.errorOccurred() ? resource.resourceError().nsError() : nil; 150 149 [m_avRequest.get() finishLoadingWithError:error]; 151 150 } else { … … 156 155 } 157 156 158 void WebCoreAVFResourceLoader::fulfillRequestWithResource(CachedResource* resource) 159 { 160 ASSERT(resource); 161 ASSERT(resource == m_resource); 157 void WebCoreAVFResourceLoader::fulfillRequestWithResource(CachedResource& resource) 158 { 159 ASSERT_UNUSED(resource, &resource == m_resource); 162 160 AVAssetResourceLoadingDataRequest* dataRequest = [m_avRequest dataRequest]; 163 161 if (!dataRequest) 164 162 return; 165 163 166 SharedBuffer* data = resource->resourceBuffer();164 SharedBuffer* data = m_resource->resourceBuffer(); 167 165 if (!data) 168 166 return; 169 167 170 168 NSUInteger responseOffset = 0; 171 ParsedContentRange contentRange = resource->response().contentRange();169 ParsedContentRange contentRange = m_resource->response().contentRange(); 172 170 if (contentRange.isValid()) 173 171 responseOffset = static_cast<NSUInteger>(contentRange.firstBytePosition()); -
trunk/Source/WebCore/rendering/RenderImage.cpp
r205818 r206903 339 339 } 340 340 341 void RenderImage::notifyFinished(CachedResource *newImage)341 void RenderImage::notifyFinished(CachedResource& newImage) 342 342 { 343 343 if (documentBeingDestroyed()) … … 346 346 invalidateBackgroundObscurationStatus(); 347 347 348 if ( newImage == imageResource().cachedImage()) {348 if (&newImage == imageResource().cachedImage()) { 349 349 // tell any potential compositing layers 350 350 // that the image is done and they can reference it directly. -
trunk/Source/WebCore/rendering/RenderImage.h
r205701 r206903 23 23 */ 24 24 25 #ifndef RenderImage_h 26 #define RenderImage_h 25 #pragma once 27 26 28 27 #include "RenderImageResource.h" … … 106 105 LayoutUnit minimumReplacedHeight() const override; 107 106 108 void notifyFinished(CachedResource *) final;107 void notifyFinished(CachedResource&) final; 109 108 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) final; 110 109 … … 138 137 139 138 SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderImage, isRenderImage()) 140 141 #endif // RenderImage_h -
trunk/Source/WebCore/rendering/RenderLayerFilterInfo.cpp
r206867 r206903 84 84 85 85 void RenderLayer::FilterInfo::setRenderer(RefPtr<FilterEffectRenderer>&& renderer) 86 { 87 m_renderer = renderer; 86 { 87 m_renderer = renderer; 88 88 } 89 89 90 void RenderLayer::FilterInfo::notifyFinished(CachedResource *)90 void RenderLayer::FilterInfo::notifyFinished(CachedResource&) 91 91 { 92 92 m_layer.filterNeedsRepaint(); -
trunk/Source/WebCore/rendering/RenderLayerFilterInfo.h
r197563 r206903 29 29 */ 30 30 31 #ifndef RenderLayerFilterInfo_h 32 #define RenderLayerFilterInfo_h 31 #pragma once 33 32 34 33 #include "CachedResourceHandle.h" … … 56 55 void expandDirtySourceRect(const LayoutRect& rect) { m_dirtySourceRect.unite(rect); } 57 56 void resetDirtySourceRect() { m_dirtySourceRect = LayoutRect(); } 58 57 59 58 FilterEffectRenderer* renderer() const { return m_renderer.get(); } 60 59 void setRenderer(RefPtr<FilterEffectRenderer>&&); 61 60 62 61 void updateReferenceFilterClients(const FilterOperations&); 63 62 void removeReferenceFilterClients(); 64 63 65 64 private: 66 void notifyFinished(CachedResource *) override;65 void notifyFinished(CachedResource&) final; 67 66 68 67 static HashMap<const RenderLayer*, std::unique_ptr<FilterInfo>>& map(); … … 78 77 79 78 } // namespace WebCore 80 81 #endif // RenderLayerFilterInfo_h -
trunk/Source/WebCore/svg/SVGFEImageElement.cpp
r206867 r206903 170 170 } 171 171 172 void SVGFEImageElement::notifyFinished(CachedResource *)172 void SVGFEImageElement::notifyFinished(CachedResource&) 173 173 { 174 174 if (!inDocument()) -
trunk/Source/WebCore/svg/SVGFEImageElement.h
r197563 r206903 19 19 */ 20 20 21 #ifndef SVGFEImageElement_h 22 #define SVGFEImageElement_h 21 #pragma once 23 22 24 23 #include "CachedImageClient.h" … … 52 51 void parseAttribute(const QualifiedName&, const AtomicString&) override; 53 52 void svgAttributeChanged(const QualifiedName&) override; 54 void notifyFinished(CachedResource *) override;53 void notifyFinished(CachedResource&) final; 55 54 56 55 void addSubresourceAttributeURLs(ListHashSet<URL>&) const override; … … 74 73 75 74 } // namespace WebCore 76 77 #endif -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r206867 r206903 536 536 } 537 537 538 void SVGUseElement::notifyFinished(CachedResource *resource)538 void SVGUseElement::notifyFinished(CachedResource& resource) 539 539 { 540 540 invalidateShadowTree(); 541 if (resource ->errorOccurred())541 if (resource.errorOccurred()) 542 542 dispatchEvent(Event::create(eventNames().errorEvent, false, false)); 543 else if (!resource ->wasCanceled())543 else if (!resource.wasCanceled()) 544 544 SVGExternalResourcesRequired::dispatchLoadEvent(this); 545 545 } -
trunk/Source/WebCore/svg/SVGUseElement.h
r200041 r206903 20 20 */ 21 21 22 #ifndef SVGUseElement_h 23 #define SVGUseElement_h 22 #pragma once 24 23 25 24 #include "CachedResourceHandle.h" … … 73 72 bool haveFiredLoadEvent() const override; 74 73 Timer* svgLoadEventTimer() override; 75 void notifyFinished(CachedResource *) override;74 void notifyFinished(CachedResource&) final; 76 75 77 76 Document* externalDocument() const; … … 99 98 100 99 } 101 102 #endif -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp
r206867 r206903 229 229 } 230 230 231 void XMLDocumentParser::notifyFinished(CachedResource *unusedResource)232 { 233 ASSERT_UNUSED(unusedResource, unusedResource == m_pendingScript);231 void XMLDocumentParser::notifyFinished(CachedResource& unusedResource) 232 { 233 ASSERT_UNUSED(unusedResource, &unusedResource == m_pendingScript); 234 234 ASSERT(m_pendingScript->accessCount() > 0); 235 235 -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.h
r197563 r206903 109 109 110 110 // from CachedResourceClient 111 void notifyFinished(CachedResource *) override;111 void notifyFinished(CachedResource&) final; 112 112 113 113 void end();
Note: See TracChangeset
for help on using the changeset viewer.