Skip to content
  • jianli@chromium.org's avatar
    Handle blob resource. · 4c6124fe
    jianli@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=43941
    
    Reviewed by Darin Fisher.
    
    JavaScriptCore:
    
    * JavaScriptCore.exp: Add an export that is neede by BlobResourceHandle.
    
    WebCore:
    
    To provide lower level blob reosurce handling for all possible ports,
    BlobResourceHandle derived from ResourceHandle is implemented. It provides
    both synchronous and asynchronous resource loading for blob URL.
    
    BlobResourceHandle needs to create a FileStreamProxy instance in order to
    asynchronous file stream operation. To achive this, a hook createAsyncFileStream
    is added to ResourceHandleClient interface. When ResourceLoader implements
    ths hook, it creates and returns FileStreamProxy.
    
    BlobResourceHandle.* is not added to chromium port since it will implement
    its own blob resource handling.
    
    * Android.mk:
    * CMakeLists.txt:
    * GNUmakefile.am:
    * WebCore.pro:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * loader/ResourceLoader.cpp:
    (WebCore::ResourceLoader::createAsyncFileStream): Create and return FileStreamProxy.
    * loader/ResourceLoader.h:
    * page/SecurityOrigin.cpp: Add the support to get and validate the origin of blob URL.
    (WebCore::SecurityOrigin::create):
    (WebCore::SecurityOrigin::canLoad):
    * platform/network/BlobRegistryImpl.cpp:
    (WebCore::BlobRegistryImpl::appendStorageItems): Fix a bug that the length is not subtracted.
    * platform/network/BlobResourceHandle.cpp: Added.
    * platform/network/BlobResourceHandle.h: Added.
    * platform/network/HTTPParsers.cpp:
    (WebCore::parseRange):
    * platform/network/HTTPParsers.h:
    * platform/network/ResourceHandle.cpp: Hook up with asynchronous blob resource handling.
    (WebCore::ResourceHandle::create):
    * platform/network/ResourceHandle.h:
    * platform/network/ResourceHandleClient.h:
    (WebCore::ResourceHandleClient::createAsyncFileStream): Add a hook.
    * platform/network/mac/ResourceHandleMac.mm:
    (WebCore::ResourceHandle::loadResourceSynchronously): Hook up with synchronous blob resource handling.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    4c6124fe