Synchronous XMLHttpRequest should get access to AppCache resources stored as flat...
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 08:18:10 +0000 (08:18 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Apr 2015 08:18:10 +0000 (08:18 +0000)
commit3315e412a5d94364f266a5ee591d1e18801cd926
tree3874be39dd6ff6161432e244806a5280580e5676
parent026d8113a31e80beac8c4e14c21979d17423419c
Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
https://bugs.webkit.org/show_bug.cgi?id=143711

Reviewed by Darin Adler.

Source/WebCore:

This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.

Test: http/tests/appcache/simple-video-sync.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/FrameLoader.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::createFileURL):
(WebCore::ApplicationCacheHost::maybeLoadSynchronously):
(WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
* loader/appcache/ApplicationCacheHost.h:
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::openFunc):

LayoutTests:

* http/tests/appcache/resources/fake-video.mp4: Added.
* http/tests/appcache/resources/simple-video-sync.manifest: Added.
* http/tests/appcache/simple-video-sync-expected.txt: Added.
* http/tests/appcache/simple-video-sync.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/appcache/resources/fake-video.mp4 [new file with mode: 0644]
LayoutTests/http/tests/appcache/resources/simple-video-sync.manifest [new file with mode: 0644]
LayoutTests/http/tests/appcache/simple-video-sync-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/appcache/simple-video-sync.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.h
Source/WebCore/xml/XSLTProcessorLibxslt.cpp
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp