WebCore:
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jan 2007 19:33:24 +0000 (19:33 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jan 2007 19:33:24 +0000 (19:33 +0000)
commitc321375cef59f28a9628a21491bf34057a2e5281
treeee69cdf5ef0cf35572dbe96b3de02c4b35b65929
parent9bc9cc09f7b507f974648693dd9a5e9ae49ce364
WebCore:

        Reviewed by Maciej.

        Add a shared buffer class which is backed by either a vector or an NSData object. This object can also
        be held in a custom NSData subclass. Use this in the loader wherever NSData was used.

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * loader/CachedResource.h:
        (WebCore::CachedResource::allData):
        * loader/DocumentLoader.h:
        * loader/FrameLoader.h:
        * loader/ResourceLoader.h:
        * loader/SubresourceLoaderClient.h:
        (WebCore::SubresourceLoaderClient::didFail):
        * loader/loader.cpp:
        (WebCore::Loader::didFinishLoading):
        * loader/loader.h:
        * loader/mac/DocumentLoaderMac.mm:
        (WebCore::DocumentLoader::setMainResourceData):
        (WebCore::DocumentLoader::mainResourceData):
        (WebCore::DocumentLoader::setupForReplaceByMIMEType):
        * loader/mac/FrameLoaderMac.mm:
        (WebCore::FrameLoader::mainResourceData):
        * loader/mac/ImageDocumentMac.mm:
        (WebCore::finishImageLoad):
        * loader/mac/LoaderFunctionsMac.mm:
        (WebCore::CheckCacheObjectStatus):
        (WebCore::CachedResource::setAllData):
        * loader/mac/NetscapePlugInStreamLoaderMac.mm:
        (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
        * loader/mac/ResourceLoaderMac.mm:
        (WebCore::ResourceLoader::addData):
        (WebCore::ResourceLoader::resourceData):
        (WebCore::ResourceLoader::clearResourceData):
        (WebCore::ResourceLoader::didReceiveData):
        (WebCore::ResourceLoader::willStopBufferingData):
        * loader/mac/SubresourceLoaderMac.mm:
        (WebCore::SubresourceLoader::didReceiveResponse):
        (WebCore::SubresourceLoader::didFinishLoading):
        * page/mac/WebCoreFrameBridge.mm:
        (-[WebCoreFrameBridge getData:andResponse:forURL:]):
        (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
        * platform/KURL.h:
        * platform/SharedBuffer.cpp: Added.
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::size):
        (WebCore::SharedBuffer::data):
        (WebCore::SharedBuffer::append):
        (WebCore::SharedBuffer::clear):
        (WebCore::SharedBuffer::clearPlatformData):
        (WebCore::SharedBuffer::maybeTransferPlatformData):
        (WebCore::SharedBuffer::hasPlatformData):
        (WebCore::SharedBuffer::platformData):
        * platform/SharedBuffer.h: Added.
        * platform/mac/SharedBufferMac.mm: Added.
        (-[SharedBufferData dealloc]):
        (-[SharedBufferData finalize]):
        (-[SharedBufferData initWithSharedBuffer:WebCore::]):
        (-[SharedBufferData length]):
        (-[SharedBufferData bytes]):
        (WebCore::SharedBuffer::wrapNSData):
        (WebCore::SharedBuffer::SharedBuffer):
        (WebCore::SharedBuffer::createNSData):
        (WebCore::SharedBuffer::hasPlatformData):
        (WebCore::SharedBuffer::platformData):
        (WebCore::SharedBuffer::platformDataSize):
        (WebCore::SharedBuffer::maybeTransferPlatformData):
        (WebCore::SharedBuffer::clearPlatformData):
        * platform/network/ResourceHandle.h:
        * platform/network/ResourceHandleClient.h:
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::bufferedData):

WebKit:

        Reviewed by Maciej.

        The data returned is now a SharedBuffer so wrap it in an NSData object.

        * WebView/WebDataSource.mm:
        (-[WebDataSource data]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/loader/CachedResource.h
WebCore/loader/DocumentLoader.h
WebCore/loader/FrameLoader.h
WebCore/loader/ResourceLoader.h
WebCore/loader/SubresourceLoaderClient.h
WebCore/loader/loader.cpp
WebCore/loader/loader.h
WebCore/loader/mac/DocumentLoaderMac.mm
WebCore/loader/mac/FrameLoaderMac.mm
WebCore/loader/mac/ImageDocumentMac.mm
WebCore/loader/mac/LoaderFunctionsMac.mm
WebCore/loader/mac/NetscapePlugInStreamLoaderMac.mm
WebCore/loader/mac/ResourceLoaderMac.mm
WebCore/loader/mac/SubresourceLoaderMac.mm
WebCore/page/mac/WebCoreFrameBridge.mm
WebCore/platform/KURL.h
WebCore/platform/SharedBuffer.cpp [new file with mode: 0644]
WebCore/platform/SharedBuffer.h [new file with mode: 0644]
WebCore/platform/mac/SharedBufferMac.mm [new file with mode: 0644]
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/ResourceHandleClient.h
WebCore/platform/network/mac/ResourceHandleMac.mm
WebKit/ChangeLog
WebKit/WebView/WebDataSource.mm