[Cache API] Implement Worker connection to the Cache storage engine
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Aug 2017 22:09:34 +0000 (22:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Aug 2017 22:09:34 +0000 (22:09 +0000)
commit7cb3210200db9af2236a98e6942befd2a7af7a49
tree34fe1778455be61d5d0ee59bb1014e4d3bc7ffb1
parent6c82c931ad5caf1d2c2bcf1d2020fdf2a3c75f42
[Cache API] Implement Worker connection to the Cache storage engine
https://bugs.webkit.org/show_bug.cgi?id=175599

Patch by Youenn Fablet <youenn@apple.com> on 2017-08-16
Reviewed by Chris Dumez.

Covered by existing tests.

Adding a WorkerCacheStorageConnection to connect workers Cache/CacheStorage
to the cache storage engine.
WorkerCacheStorageConnection does this by hopping to the main thread to call the document cache storage connection to do the actual job.
Doing some CacheStorageConnection refactoring to share code with WK2 implementation of the cache storage connection.

* Modules/cache/CacheQueryOptions.h:
(WebCore::CacheQueryOptions::isolatedCopy const):
* Modules/cache/CacheStorageConnection.cpp:
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::remove):
(WebCore::CacheStorageConnection::retrieveCaches):
(WebCore::CacheStorageConnection::retrieveRecords):
(WebCore::CacheStorageConnection::batchDeleteOperation):
(WebCore::CacheStorageConnection::batchPutOperation):
(WebCore::CacheStorageConnection::openOrRemoveCompleted):
(WebCore::CacheStorageConnection::updateCaches):
(WebCore::CacheStorageConnection::updateRecords):
(WebCore::CacheStorageConnection::removeRecordsCompleted):
(WebCore::CacheStorageConnection::putRecordsCompleted):
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::openCompleted):
(WebCore::CacheStorageConnection::removeCompleted):
(WebCore::CacheStorageConnection::doOpen):
(WebCore::CacheStorageConnection::doRemove):
(WebCore::CacheStorageConnection::doRetrieveCaches):
(WebCore::CacheStorageConnection::doRetrieveRecords):
(WebCore::CacheStorageConnection::doBatchDeleteOperation):
(WebCore::CacheStorageConnection::doBatchPutOperation):
* Modules/cache/WorkerCacheStorageConnection.cpp: Added.
(WebCore::toCrossThreadRecordData):
(WebCore::fromCrossThreadRecordData):
(WebCore::WorkerCacheStorageConnection::create):
(WebCore::WorkerCacheStorageConnection::WorkerCacheStorageConnection):
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRemove):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
(WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
(WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
(WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
* Modules/cache/WorkerCacheStorageConnection.h: Added.
* Modules/cache/WorkerGlobalScopeCaches.cpp:
(WebCore::WorkerGlobalScopeCaches::caches const):
* WebCore.xcodeproj/project.pbxproj:
* loader/FetchOptions.h:
(WebCore::FetchOptions::isolatedCopy const):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::cacheStorageConnection):
* workers/WorkerGlobalScope.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/cache/CacheQueryOptions.h
Source/WebCore/Modules/cache/CacheStorageConnection.cpp
Source/WebCore/Modules/cache/CacheStorageConnection.h
Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp [new file with mode: 0644]
Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h [new file with mode: 0644]
Source/WebCore/Modules/cache/WorkerGlobalScopeCaches.cpp
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/loader/FetchOptions.h
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h