ResourceLoader::resourceData() should not return a PassRefPtr
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 16:36:59 +0000 (16:36 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Jun 2013 16:36:59 +0000 (16:36 +0000)
commitcb7f56bc702e1aa5e945110a7dc1e64a6855d980
tree3451a540d1023c50bf57ce013023961ee521018a
parentbc9e6e473b72b2343f5c67b9c41d5e464df7d46a
ResourceLoader::resourceData() should not return a PassRefPtr
https://bugs.webkit.org/show_bug.cgi?id=117288

Reviewed by Darin Adler.

Change ResourceLoader::resourceData() to return a raw pointer
instead of a PassRefPtr since we don't want to transfer the
ownership of the resource data. Also pass a raw pointer to
CachedResource::data() so that the cached resource can decide
whether to take a reference of the data or not, for example,
CachedRawResource only takes a reference when buffering policy is
BufferData.

* html/ImageDocument.cpp:
(WebCore::ImageDocumentParser::appendBytes):
(WebCore::ImageDocumentParser::finish):
* loader/ResourceLoader.cpp:
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::resourceData):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::sendDataToResource):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::data):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::data):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::data):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::data):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::data):
* loader/cache/CachedResource.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::data):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::data):
* loader/cache/CachedScript.h:
* loader/cache/CachedShader.cpp:
(WebCore::CachedShader::data):
* loader/cache/CachedShader.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::data):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::data):
* loader/cache/CachedXSLStyleSheet.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
Source/WebCore/loader/cache/CachedCSSStyleSheet.h
Source/WebCore/loader/cache/CachedFont.cpp
Source/WebCore/loader/cache/CachedFont.h
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/loader/cache/CachedRawResource.cpp
Source/WebCore/loader/cache/CachedRawResource.h
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/CachedSVGDocument.cpp
Source/WebCore/loader/cache/CachedSVGDocument.h
Source/WebCore/loader/cache/CachedScript.cpp
Source/WebCore/loader/cache/CachedScript.h
Source/WebCore/loader/cache/CachedShader.cpp
Source/WebCore/loader/cache/CachedShader.h
Source/WebCore/loader/cache/CachedTextTrack.cpp
Source/WebCore/loader/cache/CachedTextTrack.h
Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp
Source/WebCore/loader/cache/CachedXSLStyleSheet.h