[Win] Compile error, 'Cache' is not declared.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 15:08:01 +0000 (15:08 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 15:08:01 +0000 (15:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176062

Reviewed by Youenn Fablet.

Rename DOMCache to DOMCacheEngine.

Source/WebCore:

No new tests, covered by existing tests.

* Modules/cache/Cache.cpp:
(WebCore::Cache::addAll):
(WebCore::Cache::put):
(WebCore::queryCacheMatch):
(WebCore::Cache::batchDeleteOperation):
(WebCore::toConnectionRecord):
(WebCore::Cache::batchPutOperation):
* Modules/cache/Cache.h:
* Modules/cache/CacheStorage.cpp:
(WebCore::CacheStorage::open):
(WebCore::CacheStorage::remove):
* Modules/cache/CacheStorageConnection.cpp:
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::clearMemoryRepresentation):
(WebCore::CacheStorageConnection::openCompleted):
(WebCore::CacheStorageConnection::removeCompleted):
(WebCore::CacheStorageConnection::doOpen):
(WebCore::CacheStorageConnection::doRemove):
(WebCore::CacheStorageConnection::doBatchDeleteOperation):
(WebCore::CacheStorageConnection::doBatchPutOperation):
* Modules/cache/DOMCache.cpp: Removed.
* Modules/cache/DOMCache.h: Removed.
* Modules/cache/DOMCacheEngine.cpp: Copied from Source/WebCore/Modules/cache/DOMCache.cpp.
(WebCore::DOMCacheEngine::isolatedResponseBody):
(WebCore::DOMCacheEngine::copyResponseBody):
(WebCore::DOMCache::errorToException): Deleted.
(WebCore::DOMCache::queryCacheMatch): Deleted.
(WebCore::DOMCache::isolatedResponseBody): Deleted.
(WebCore::DOMCache::copyResponseBody): Deleted.
(WebCore::DOMCache::Record::copy const): Deleted.
* Modules/cache/DOMCacheEngine.h: Copied from Source/WebCore/Modules/cache/DOMCache.h.
* Modules/cache/WorkerCacheStorageConnection.cpp:
* Modules/cache/WorkerCacheStorageConnection.h:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::queryCache):
(WebKit::CacheStorage::Engine::writeFile):
* NetworkProcess/cache/CacheStorageEngine.h:
* NetworkProcess/cache/CacheStorageEngineCache.h:
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
* NetworkProcess/cache/CacheStorageEngineCaches.h:
* NetworkProcess/cache/CacheStorageEngineConnection.cpp:
* NetworkProcess/cache/CacheStorageEngineConnection.h:
* NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::encode):
(IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
(IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
(IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
(IPC::ArgumentCoder<DOMCache::CacheInfo>::encode): Deleted.
(IPC::ArgumentCoder<DOMCache::CacheInfo>::decode): Deleted.
(IPC::ArgumentCoder<DOMCache::Record>::encode): Deleted.
(IPC::ArgumentCoder<DOMCache::Record>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
* WebProcess/Cache/WebCacheStorageConnection.h:
* WebProcess/Cache/WebCacheStorageConnection.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221478 268f45cc-cd09-0410-ab3c-d52691b4dbfc

28 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/cache/Cache.cpp
Source/WebCore/Modules/cache/Cache.h
Source/WebCore/Modules/cache/CacheStorage.cpp
Source/WebCore/Modules/cache/CacheStorageConnection.cpp
Source/WebCore/Modules/cache/CacheStorageConnection.h
Source/WebCore/Modules/cache/DOMCacheEngine.cpp [moved from Source/WebCore/Modules/cache/DOMCache.cpp with 94% similarity]
Source/WebCore/Modules/cache/DOMCacheEngine.h [moved from Source/WebCore/Modules/cache/DOMCache.h with 90% similarity]
Source/WebCore/Modules/cache/WorkerCacheStorageConnection.cpp
Source/WebCore/Modules/cache/WorkerCacheStorageConnection.h
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.cpp
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCache.h
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.h
Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.cpp
Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.h
Source/WebKit/NetworkProcess/cache/CacheStorageEngineConnection.messages.in
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp
Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.h
Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.messages.in

index 532afa8..d247863 100644 (file)
@@ -914,7 +914,7 @@ set(WebCore_SOURCES
     Modules/cache/Cache.cpp
     Modules/cache/CacheStorage.cpp
     Modules/cache/CacheStorageConnection.cpp
-    Modules/cache/DOMCache.cpp
+    Modules/cache/DOMCacheEngine.cpp
     Modules/cache/DOMWindowCaches.cpp
     Modules/cache/WorkerCacheStorageConnection.cpp
     Modules/cache/WorkerGlobalScopeCaches.cpp
index 2cf614f..d03f1fd 100644 (file)
@@ -1,3 +1,51 @@
+2017-09-01  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Compile error, 'Cache' is not declared.
+        https://bugs.webkit.org/show_bug.cgi?id=176062
+
+        Reviewed by Youenn Fablet.
+
+        Rename DOMCache to DOMCacheEngine.
+
+        No new tests, covered by existing tests. 
+
+        * Modules/cache/Cache.cpp:
+        (WebCore::Cache::addAll):
+        (WebCore::Cache::put):
+        (WebCore::queryCacheMatch):
+        (WebCore::Cache::batchDeleteOperation):
+        (WebCore::toConnectionRecord):
+        (WebCore::Cache::batchPutOperation):
+        * Modules/cache/Cache.h:
+        * Modules/cache/CacheStorage.cpp:
+        (WebCore::CacheStorage::open):
+        (WebCore::CacheStorage::remove):
+        * Modules/cache/CacheStorageConnection.cpp:
+        * Modules/cache/CacheStorageConnection.h:
+        (WebCore::CacheStorageConnection::clearMemoryRepresentation):
+        (WebCore::CacheStorageConnection::openCompleted):
+        (WebCore::CacheStorageConnection::removeCompleted):
+        (WebCore::CacheStorageConnection::doOpen):
+        (WebCore::CacheStorageConnection::doRemove):
+        (WebCore::CacheStorageConnection::doBatchDeleteOperation):
+        (WebCore::CacheStorageConnection::doBatchPutOperation):
+        * Modules/cache/DOMCache.cpp: Removed.
+        * Modules/cache/DOMCache.h: Removed.
+        * Modules/cache/DOMCacheEngine.cpp: Copied from Source/WebCore/Modules/cache/DOMCache.cpp.
+        (WebCore::DOMCacheEngine::isolatedResponseBody):
+        (WebCore::DOMCacheEngine::copyResponseBody):
+        (WebCore::DOMCache::errorToException): Deleted.
+        (WebCore::DOMCache::queryCacheMatch): Deleted.
+        (WebCore::DOMCache::isolatedResponseBody): Deleted.
+        (WebCore::DOMCache::copyResponseBody): Deleted.
+        (WebCore::DOMCache::Record::copy const): Deleted.
+        * Modules/cache/DOMCacheEngine.h: Copied from Source/WebCore/Modules/cache/DOMCache.h.
+        * Modules/cache/WorkerCacheStorageConnection.cpp:
+        * Modules/cache/WorkerCacheStorageConnection.h:
+        * WebCore.xcodeproj/project.pbxproj:
+        * testing/Internals.cpp:
+        (WebCore::Internals::clearCacheStorageMemoryRepresentation):
+
 2017-08-31  Andy Estes  <aestes@apple.com>
 
         [Mac] Upstream AppKit-related WebKitSystemInterface functions
index 32a0f11..a60c6be 100644 (file)
@@ -34,7 +34,7 @@
 #include "ScriptExecutionContext.h"
 #include "URL.h"
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 
 namespace WebCore {
 
@@ -250,7 +250,7 @@ void Cache::addAll(Vector<RequestInfo>&& infos, DOMPromiseDeferred<void>&& promi
 
             CacheQueryOptions options;
             for (const auto& record : taskHandler->records()) {
-                if (DOMCache::queryCacheMatch(request->resourceRequest(), record.request, record.response, options)) {
+                if (DOMCacheEngine::queryCacheMatch(request->resourceRequest(), record.request, record.response, options)) {
                     taskHandler->error(Exception { InvalidStateError, ASCIILiteral("addAll cannot store several matching requests")});
                     return;
                 }
@@ -312,7 +312,7 @@ void Cache::put(RequestInfo&& info, Ref<FetchResponse>&& response, DOMPromiseDef
             if (result.hasException())
                 promise.reject(result.releaseException());
             else {
-                DOMCache::ResponseBody body;
+                DOMCacheEngine::ResponseBody body;
                 if (auto buffer = result.releaseReturnValue())
                     body = buffer.releaseNonNull();
                 batchPutOperation(request.get(), response.get(), WTFMove(body), [promise = WTFMove(promise)](ExceptionOr<void>&& result) mutable {
@@ -405,7 +405,7 @@ void Cache::queryCache(Ref<FetchRequest>&& request, CacheQueryOptions&& options,
 static inline bool queryCacheMatch(const FetchRequest& request, const FetchRequest& cachedRequest, const ResourceResponse& cachedResponse, const CacheQueryOptions& options)
 {
     // We need to pass the resource request with all correct headers hence why we call resourceRequest().
-    return DOMCache::queryCacheMatch(request.resourceRequest(), cachedRequest.resourceRequest(), cachedResponse, options);
+    return DOMCacheEngine::queryCacheMatch(request.resourceRequest(), cachedRequest.resourceRequest(), cachedResponse, options);
 }
 
 Vector<CacheStorageRecord> Cache::queryCacheWithTargetStorage(const FetchRequest& request, const CacheQueryOptions& options, const Vector<CacheStorageRecord>& targetStorage)
@@ -427,7 +427,7 @@ void Cache::batchDeleteOperation(const FetchRequest& request, CacheQueryOptions&
     m_connection->batchDeleteOperation(m_identifier, request.internalRequest(), WTFMove(options), [this, callback = WTFMove(callback)](RecordIdentifiersOrError&& result) {
         if (!m_isStopped) {
             if (!result.hasValue())
-                callback(DOMCache::errorToException(result.error()));
+                callback(DOMCacheEngine::errorToException(result.error()));
             else
                 callback(!result.value().isEmpty());
         }
@@ -435,7 +435,7 @@ void Cache::batchDeleteOperation(const FetchRequest& request, CacheQueryOptions&
     });
 }
 
-Record toConnectionRecord(const FetchRequest& request, FetchResponse& response, DOMCache::ResponseBody&& responseBody)
+Record toConnectionRecord(const FetchRequest& request, FetchResponse& response, DOMCacheEngine::ResponseBody&& responseBody)
 {
     // FIXME: Add a setHTTPHeaderFields on ResourceResponseBase.
     ResourceResponse cachedResponse = response.resourceResponse();
@@ -454,7 +454,7 @@ Record toConnectionRecord(const FetchRequest& request, FetchResponse& response,
     };
 }
 
-void Cache::batchPutOperation(const FetchRequest& request, FetchResponse& response, DOMCache::ResponseBody&& responseBody, WTF::Function<void(ExceptionOr<void>&&)>&& callback)
+void Cache::batchPutOperation(const FetchRequest& request, FetchResponse& response, DOMCacheEngine::ResponseBody&& responseBody, WTF::Function<void(ExceptionOr<void>&&)>&& callback)
 {
     Vector<Record> records;
     records.append(toConnectionRecord(request, response, WTFMove(responseBody)));
@@ -468,7 +468,7 @@ void Cache::batchPutOperation(Vector<Record>&& records, WTF::Function<void(Excep
     m_connection->batchPutOperation(m_identifier, WTFMove(records), [this, callback = WTFMove(callback)](RecordIdentifiersOrError&& result) {
         if (!m_isStopped) {
             if (!result.hasValue())
-                callback(DOMCache::errorToException(result.error()));
+                callback(DOMCacheEngine::errorToException(result.error()));
             else
                 callback({ });
         }
index 27c55c2..596225c 100644 (file)
@@ -73,10 +73,10 @@ private:
     Vector<CacheStorageRecord> queryCacheWithTargetStorage(const FetchRequest&, const CacheQueryOptions&, const Vector<CacheStorageRecord>&);
     void queryCache(Ref<FetchRequest>&&, CacheQueryOptions&&, WTF::Function<void(const Vector<CacheStorageRecord>&)>&&);
     void batchDeleteOperation(const FetchRequest&, CacheQueryOptions&&, WTF::Function<void(ExceptionOr<bool>&&)>&&);
-    void batchPutOperation(const FetchRequest&, FetchResponse&, DOMCache::ResponseBody&&, WTF::Function<void(ExceptionOr<void>&&)>&&);
-    void batchPutOperation(Vector<DOMCache::Record>&&, WTF::Function<void(ExceptionOr<void>&&)>&&);
+    void batchPutOperation(const FetchRequest&, FetchResponse&, DOMCacheEngine::ResponseBody&&, WTF::Function<void(ExceptionOr<void>&&)>&&);
+    void batchPutOperation(Vector<DOMCacheEngine::Record>&&, WTF::Function<void(ExceptionOr<void>&&)>&&);
 
-    void updateRecords(Vector<DOMCache::Record>&&);
+    void updateRecords(Vector<DOMCacheEngine::Record>&&);
 
     String m_name;
     uint64_t m_identifier;
index 3447ac9..9db4a5a 100644 (file)
@@ -31,7 +31,7 @@
 #include "JSFetchResponse.h"
 #include "ScriptExecutionContext.h"
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 
 namespace WebCore {
 
@@ -168,7 +168,7 @@ void CacheStorage::open(const String& name, DOMPromiseDeferred<IDLInterface<Cach
             if (!m_isStopped) {
 
                 if (!result.hasValue())
-                    promise.reject(DOMCache::errorToException(result.error()));
+                    promise.reject(DOMCacheEngine::errorToException(result.error()));
                 else {
                     auto cache = Cache::create(*scriptExecutionContext(), String { name }, result.value(), m_connection.copyRef());
                     promise.resolve(cache);
@@ -196,7 +196,7 @@ void CacheStorage::remove(const String& name, DOMPromiseDeferred<IDLBoolean>&& p
         m_connection->remove(m_caches[position]->identifier(), [this, name, promise = WTFMove(promise)](const CacheIdentifierOrError& result) mutable {
             if (!m_isStopped) {
                 if (!result.hasValue())
-                    promise.reject(DOMCache::errorToException(result.error()));
+                    promise.reject(DOMCacheEngine::errorToException(result.error()));
                 else
                     promise.resolve(true);
             }
index f6ead6e..73e62f4 100644 (file)
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "CacheStorageConnection.h"
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 
 namespace WebCore {
 
index 0d44c95..8717b90 100644 (file)
@@ -26,7 +26,7 @@
 
 #pragma once
 
-#include "DOMCache.h"
+#include "DOMCacheEngine.h"
 #include <wtf/HashMap.h>
 #include <wtf/ThreadSafeRefCounted.h>
 
@@ -37,43 +37,43 @@ public:
     static Ref<CacheStorageConnection> create() { return adoptRef(*new CacheStorageConnection()); }
     virtual ~CacheStorageConnection() = default;
 
-    void open(const String& origin, const String& cacheName, DOMCache::CacheIdentifierCallback&&);
-    void remove(uint64_t cacheIdentifier, DOMCache::CacheIdentifierCallback&&);
-    void retrieveCaches(const String& origin, uint64_t updateCounter, DOMCache::CacheInfosCallback&&);
+    void open(const String& origin, const String& cacheName, DOMCacheEngine::CacheIdentifierCallback&&);
+    void remove(uint64_t cacheIdentifier, DOMCacheEngine::CacheIdentifierCallback&&);
+    void retrieveCaches(const String& origin, uint64_t updateCounter, DOMCacheEngine::CacheInfosCallback&&);
 
-    void retrieveRecords(uint64_t cacheIdentifier, DOMCache::RecordsCallback&&);
-    void batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest&, CacheQueryOptions&&, DOMCache::RecordIdentifiersCallback&&);
-    void batchPutOperation(uint64_t cacheIdentifier, Vector<DOMCache::Record>&&, DOMCache::RecordIdentifiersCallback&&);
+    void retrieveRecords(uint64_t cacheIdentifier, DOMCacheEngine::RecordsCallback&&);
+    void batchDeleteOperation(uint64_t cacheIdentifier, const ResourceRequest&, CacheQueryOptions&&, DOMCacheEngine::RecordIdentifiersCallback&&);
+    void batchPutOperation(uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&, DOMCacheEngine::RecordIdentifiersCallback&&);
 
     // Used only for testing purposes.
-    virtual void clearMemoryRepresentation(const String& /* origin */, DOMCache::CompletionCallback&& callback) { callback(DOMCache::Error::NotImplemented); }
+    virtual void clearMemoryRepresentation(const String& /* origin */, DOMCacheEngine::CompletionCallback&& callback) { callback(DOMCacheEngine::Error::NotImplemented); }
 
 protected:
     CacheStorageConnection() =  default;
 
-    void openCompleted(uint64_t identifier, const DOMCache::CacheIdentifierOrError& result) { openOrRemoveCompleted(identifier, result); }
-    void removeCompleted(uint64_t identifier, const DOMCache::CacheIdentifierOrError& result) { openOrRemoveCompleted(identifier, result); }
-    WEBCORE_EXPORT void updateCaches(uint64_t requestIdentifier, DOMCache::CacheInfosOrError&&);
+    void openCompleted(uint64_t identifier, const DOMCacheEngine::CacheIdentifierOrError& result) { openOrRemoveCompleted(identifier, result); }
+    void removeCompleted(uint64_t identifier, const DOMCacheEngine::CacheIdentifierOrError& result) { openOrRemoveCompleted(identifier, result); }
+    WEBCORE_EXPORT void updateCaches(uint64_t requestIdentifier, DOMCacheEngine::CacheInfosOrError&&);
 
-    WEBCORE_EXPORT void updateRecords(uint64_t requestIdentifier, DOMCache::RecordsOrError&&);
-    WEBCORE_EXPORT void deleteRecordsCompleted(uint64_t requestIdentifier, DOMCache::RecordIdentifiersOrError&&);
-    WEBCORE_EXPORT void putRecordsCompleted(uint64_t requestIdentifier, DOMCache::RecordIdentifiersOrError&&);
+    WEBCORE_EXPORT void updateRecords(uint64_t requestIdentifier, DOMCacheEngine::RecordsOrError&&);
+    WEBCORE_EXPORT void deleteRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordIdentifiersOrError&&);
+    WEBCORE_EXPORT void putRecordsCompleted(uint64_t requestIdentifier, DOMCacheEngine::RecordIdentifiersOrError&&);
 
 private:
-    virtual void doOpen(uint64_t requestIdentifier, const String& /* origin */, const String& /* cacheName */) { openCompleted(requestIdentifier, makeUnexpected(DOMCache::Error::NotImplemented)); }
-    virtual void doRemove(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */) { removeCompleted(requestIdentifier, makeUnexpected(DOMCache::Error::NotImplemented)); }
+    virtual void doOpen(uint64_t requestIdentifier, const String& /* origin */, const String& /* cacheName */) { openCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
+    virtual void doRemove(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */) { removeCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
     virtual void doRetrieveCaches(uint64_t requestIdentifier, const String& /* origin */, uint64_t /* updateCounter */) { updateCaches(requestIdentifier, { }); }
 
     virtual void doRetrieveRecords(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */) { updateRecords(requestIdentifier, { }); }
-    virtual void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, const ResourceRequest&, CacheQueryOptions&&) { deleteRecordsCompleted(requestIdentifier, makeUnexpected(DOMCache::Error::NotImplemented)); }
-    virtual void doBatchPutOperation(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, Vector<DOMCache::Record>&&) { putRecordsCompleted(requestIdentifier, makeUnexpected(DOMCache::Error::NotImplemented)); }
+    virtual void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, const ResourceRequest&, CacheQueryOptions&&) { deleteRecordsCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
+    virtual void doBatchPutOperation(uint64_t requestIdentifier, uint64_t /* cacheIdentifier */, Vector<DOMCacheEngine::Record>&&) { putRecordsCompleted(requestIdentifier, makeUnexpected(DOMCacheEngine::Error::NotImplemented)); }
 
-    WEBCORE_EXPORT void openOrRemoveCompleted(uint64_t requestIdentifier, const DOMCache::CacheIdentifierOrError&);
+    WEBCORE_EXPORT void openOrRemoveCompleted(uint64_t requestIdentifier, const DOMCacheEngine::CacheIdentifierOrError&);
 
-    HashMap<uint64_t, DOMCache::CacheIdentifierCallback> m_openAndRemoveCachePendingRequests;
-    HashMap<uint64_t, DOMCache::CacheInfosCallback> m_retrieveCachesPendingRequests;
-    HashMap<uint64_t, DOMCache::RecordsCallback> m_retrieveRecordsPendingRequests;
-    HashMap<uint64_t, DOMCache::RecordIdentifiersCallback> m_batchDeleteAndPutPendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::CacheIdentifierCallback> m_openAndRemoveCachePendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::CacheInfosCallback> m_retrieveCachesPendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::RecordsCallback> m_retrieveRecordsPendingRequests;
+    HashMap<uint64_t, DOMCacheEngine::RecordIdentifiersCallback> m_batchDeleteAndPutPendingRequests;
 
     uint64_t m_lastRequestIdentifier { 0 };
 };
similarity index 94%
rename from Source/WebCore/Modules/cache/DOMCache.cpp
rename to Source/WebCore/Modules/cache/DOMCacheEngine.cpp
index 0838819..a8b13f6 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#include "DOMCache.h"
+#include "DOMCacheEngine.h"
 
 #include "CacheQueryOptions.h"
 #include "Exception.h"
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-namespace DOMCache {
+namespace DOMCacheEngine {
 
 Exception errorToException(Error error)
 {
@@ -89,18 +89,18 @@ ResponseBody isolatedResponseBody(const ResponseBody& body)
     }, [](const Ref<SharedBuffer>& buffer) {
         return buffer->copy();
     }, [](const std::nullptr_t&) {
-        return DOMCache::ResponseBody { };
+        return DOMCacheEngine::ResponseBody { };
     });
 }
 
-static inline ResponseBody copyResponseBody(const DOMCache::ResponseBody& body)
+static inline ResponseBody copyResponseBody(const DOMCacheEngine::ResponseBody& body)
 {
     return WTF::switchOn(body, [](const Ref<FormData>& formData) {
         return formData.copyRef();
     }, [](const Ref<SharedBuffer>& buffer) {
         return buffer.copyRef();
     }, [](const std::nullptr_t&) {
-        return DOMCache::ResponseBody { };
+        return DOMCacheEngine::ResponseBody { };
     });
 }
 
@@ -118,7 +118,7 @@ CacheInfos CacheInfos::isolatedCopy()
     return { WTFMove(isolatedCaches), updateCounter };
 }
 
-} // namespace DOMCache
+} // namespace DOMCacheEngine
 
 } // namespace WebCore
 
similarity index 90%
rename from Source/WebCore/Modules/cache/DOMCache.h
rename to Source/WebCore/Modules/cache/DOMCacheEngine.h
index 1c3778d..497e97d 100644 (file)
@@ -36,7 +36,7 @@ namespace WebCore {
 
 struct CacheQueryOptions;
 
-namespace DOMCache {
+namespace DOMCacheEngine {
 
 enum class Error {
     NotImplemented,
@@ -111,18 +111,18 @@ template<class Decoder> inline bool CacheInfos::decode(Decoder& decoder, CacheIn
     return decoder.decode(cacheInfos.updateCounter);
 }
 
-} // namespace DOMCache
+} // namespace DOMCacheEngine
 
 } // namespace WebCore
 
 namespace WTF {
-template<> struct EnumTraits<WebCore::DOMCache::Error> {
+template<> struct EnumTraits<WebCore::DOMCacheEngine::Error> {
     using values = EnumValues<
-        WebCore::DOMCache::Error,
-        WebCore::DOMCache::Error::NotImplemented,
-        WebCore::DOMCache::Error::ReadDisk,
-        WebCore::DOMCache::Error::WriteDisk,
-        WebCore::DOMCache::Error::Internal
+        WebCore::DOMCacheEngine::Error,
+        WebCore::DOMCacheEngine::Error::NotImplemented,
+        WebCore::DOMCacheEngine::Error::ReadDisk,
+        WebCore::DOMCacheEngine::Error::WriteDisk,
+        WebCore::DOMCacheEngine::Error::Internal
     >;
 };
 }
index 9924cad..ed04909 100644 (file)
@@ -36,7 +36,7 @@
 #include "WorkerRunLoop.h"
 #include "WorkerThread.h"
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 
 namespace WebCore {
 
index 326171e..8c5b410 100644 (file)
@@ -48,7 +48,7 @@ private:
 
     void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier) final;
     void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&) final;
-    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<DOMCache::Record>&&) final;
+    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<DOMCacheEngine::Record>&&) final;
 
     WorkerGlobalScope& m_scope;
     WorkerLoaderProxy& m_proxy;
index 2fbe845..4db7424 100644 (file)
                41F54F8E1C50C50C00338488 /* FetchRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F54F871C50C4F600338488 /* FetchRequest.cpp */; };
                41FA303E1316C29C00C0BFC5 /* RenderMediaControls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FA303C1316C29C00C0BFC5 /* RenderMediaControls.cpp */; };
                41FA303F1316C29C00C0BFC5 /* RenderMediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FA303D1316C29C00C0BFC5 /* RenderMediaControls.h */; };
-               41FABD2D1F4DFE4A006A6C97 /* DOMCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FABD2B1F4DFE42006A6C97 /* DOMCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               41FABD2F1F4E02CB006A6C97 /* DOMCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FABD2E1F4E0251006A6C97 /* DOMCache.cpp */; };
+               41FABD2D1F4DFE4A006A6C97 /* DOMCacheEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 41FABD2B1F4DFE42006A6C97 /* DOMCacheEngine.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               41FABD2F1F4E02CB006A6C97 /* DOMCacheEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FABD2E1F4E0251006A6C97 /* DOMCacheEngine.cpp */; };
                41FB279C1F34DB8A00795487 /* DOMWindowCaches.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FB278E1F34C28200795487 /* DOMWindowCaches.cpp */; };
                41FB279D1F34DB8E00795487 /* WorkerGlobalScopeCaches.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41FB278F1F34C28200795487 /* WorkerGlobalScopeCaches.cpp */; };
                43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */; };
                41F54F891C50C4F600338488 /* FetchRequest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FetchRequest.idl; sourceTree = "<group>"; };
                41FA303C1316C29C00C0BFC5 /* RenderMediaControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMediaControls.cpp; sourceTree = "<group>"; };
                41FA303D1316C29C00C0BFC5 /* RenderMediaControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMediaControls.h; sourceTree = "<group>"; };
-               41FABD2B1F4DFE42006A6C97 /* DOMCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCache.h; sourceTree = "<group>"; };
-               41FABD2E1F4E0251006A6C97 /* DOMCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCache.cpp; sourceTree = "<group>"; };
+               41FABD2B1F4DFE42006A6C97 /* DOMCacheEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCacheEngine.h; sourceTree = "<group>"; };
+               41FABD2E1F4E0251006A6C97 /* DOMCacheEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCacheEngine.cpp; sourceTree = "<group>"; };
                41FB278C1F34C28200795487 /* DOMWindowCaches.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMWindowCaches.h; sourceTree = "<group>"; };
                41FB278D1F34C28200795487 /* WorkerGlobalScopeCaches.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WorkerGlobalScopeCaches.h; sourceTree = "<group>"; };
                41FB278E1F34C28200795487 /* DOMWindowCaches.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowCaches.cpp; sourceTree = "<group>"; };
                                41D129C91F3D0EE300D15E47 /* CacheStorageConnection.cpp */,
                                41D129CC1F3D0EE300D15E47 /* CacheStorageConnection.h */,
                                41D129CA1F3D0EE300D15E47 /* CacheStorageRecord.h */,
-                               41FABD2E1F4E0251006A6C97 /* DOMCache.cpp */,
-                               41FABD2B1F4DFE42006A6C97 /* DOMCache.h */,
+                               41FABD2E1F4E0251006A6C97 /* DOMCacheEngine.cpp */,
+                               41FABD2B1F4DFE42006A6C97 /* DOMCacheEngine.h */,
                                41FB278E1F34C28200795487 /* DOMWindowCaches.cpp */,
                                41FB278C1F34C28200795487 /* DOMWindowCaches.h */,
                                41380C2B1F343E2F00155FDA /* DOMWindowCaches.idl */,
                                1A8A64561D19FCFC00D0E00F /* ApplePayPaymentMethodSelectedEvent.h in Headers */,
                                7C6522F51E00A51700677F22 /* ApplePayPaymentPass.h in Headers */,
                                7C6579E01E0079F900E3A27A /* ApplePayPaymentRequest.h in Headers */,
-                               517A535A1F5889EF00DCDC0A /* FetchLoader.h in Headers */,
                                1A8A64591D19FCFC00D0E00F /* ApplePaySession.h in Headers */,
                                1A58E8651D19D4EB00C0EA73 /* ApplePaySessionPaymentRequest.h in Headers */,
                                1A8A645C1D19FCFC00D0E00F /* ApplePayShippingContactSelectedEvent.h in Headers */,
                                267725FF1A5B3AD9003C24DD /* DFANode.h in Headers */,
                                CD19A2681A13E700008D650E /* DiagnosticLoggingClient.h in Headers */,
                                46FCB6181A70820E00C5A21E /* DiagnosticLoggingKeys.h in Headers */,
-                               7CBBBCCA1F5617C5005EFAAC /* JSDOMMatrix2DInit.h in Headers */,
                                8372DB311A6780A800C697C5 /* DiagnosticLoggingResultType.h in Headers */,
                                CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */,
                                CECADFC9153778FF00E37068 /* DictationCommand.h in Headers */,
                                A8185F3909765766005826D9 /* DocumentType.h in Headers */,
                                973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */,
                                1A8F6BC30DB55CDC001DB794 /* DOMApplicationCache.h in Headers */,
-                               41FABD2D1F4DFE4A006A6C97 /* DOMCache.h in Headers */,
+                               41FABD2D1F4DFE4A006A6C97 /* DOMCacheEngine.h in Headers */,
                                FC9A0F75164094CF003D6B8D /* DOMCSSNamespace.h in Headers */,
                                9B3A8872145632F9003AE8F5 /* DOMDOMSettableTokenList.h in Headers */,
                                7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */,
                                E3A776681DC85D2800B690D8 /* DOMJITIDLType.h in Headers */,
                                E35802B61DC8435D00A9773C /* DOMJITIDLTypeFilter.h in Headers */,
                                836ACECA1ECA9569004BD012 /* DOMMatrix.h in Headers */,
+                               7CBBBCC71F560581005EFAAC /* DOMMatrix2DInit.h in Headers */,
                                836ACECB1ECA956D004BD012 /* DOMMatrixInit.h in Headers */,
                                836ACEC31ECA62C8004BD012 /* DOMMatrixReadOnly.h in Headers */,
                                A9C6E4E40D745E05006442E9 /* DOMMimeType.h in Headers */,
                                84730D851248F0B300D3A9C9 /* FEMorphology.h in Headers */,
                                84730D871248F0B300D3A9C9 /* FEOffset.h in Headers */,
                                84730D891248F0B300D3A9C9 /* FESpecularLighting.h in Headers */,
+                               517A535B1F588A4C00DCDC0A /* FetchBodyConsumer.h in Headers */,
                                41D129DB1F3D143800D15E47 /* FetchHeaders.h in Headers */,
                                416E6FE81BBD12DF000A6023 /* FetchInternalsBuiltins.h in Headers */,
+                               517A535A1F5889EF00DCDC0A /* FetchLoader.h in Headers */,
+                               517A53581F5889E800DCDC0A /* FetchLoaderClient.h in Headers */,
                                41AD753A1CEF6BD100A31486 /* FetchOptions.h in Headers */,
                                7CE1914D1F2A9AFB00272F78 /* FetchReferrerPolicy.h in Headers */,
                                7CE1915A1F2A9B3400272F78 /* FetchRequestCache.h in Headers */,
                                93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */,
                                977B3867122883E900B81FF8 /* HTMLDocumentParser.h in Headers */,
                                93F198E608245E59001E9ABC /* HTMLElement.h in Headers */,
-                               517A53581F5889E800DCDC0A /* FetchLoaderClient.h in Headers */,
                                A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */,
                                977B37241228721700B81FF8 /* HTMLElementStack.h in Headers */,
                                B562DB6017D3CD630010AF96 /* HTMLElementTypeHelpers.h in Headers */,
                                4138F8581D253F0E001CB61E /* JSDOMIterator.h in Headers */,
                                41DEFCB61E56C1BD000D9E5F /* JSDOMMapLike.h in Headers */,
                                836ACED31ECAAB19004BD012 /* JSDOMMatrix.h in Headers */,
+                               7CBBBCCA1F5617C5005EFAAC /* JSDOMMatrix2DInit.h in Headers */,
                                836ACED41ECAAB19004BD012 /* JSDOMMatrixInit.h in Headers */,
                                836ACED61ECAAB19004BD012 /* JSDOMMatrixReadOnly.h in Headers */,
                                A9D248070D757E7D00FDF959 /* JSDOMMimeType.h in Headers */,
                                FA654A6C1108ABED002626F1 /* MathMLUnderOverElement.h in Headers */,
                                37C738EF1EDBD71B003F2B0B /* MathMLUnknownElement.h in Headers */,
                                439046EA12DA25E812AF80AC /* MathOperator.h in Headers */,
-                               517A535B1F588A4C00DCDC0A /* FetchBodyConsumer.h in Headers */,
                                49D5DC2C0F423A73008F20FD /* Matrix3DTransformOperation.h in Headers */,
                                49E911C70EF86D47009D0CAF /* MatrixTransformOperation.h in Headers */,
                                5CBC8DAD1AAA302200E1C803 /* MediaAccessibilitySoftLink.h in Headers */,
                                656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */,
                                A19D934B1AA11B1E00B46C24 /* NetworkExtensionContentFilter.h in Headers */,
                                628D214C12131ED10055DCFC /* NetworkingContext.h in Headers */,
-                               517A535D1F5899FE00DCDC0A /* ServiceWorkerFetchResult.h in Headers */,
                                8A81BF8511DCFD9000DA2B98 /* NetworkLoadMetrics.h in Headers */,
                                59C27F07138D28CF0079B7E2 /* NetworkResourcesData.h in Headers */,
                                1A7FA6190DDA3B3A0028F8A5 /* NetworkStateNotifier.h in Headers */,
                                2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
                                51F1755D1F3EBC8300C74950 /* ServiceWorker.h in Headers */,
                                51F1755F1F3EBC8300C74950 /* ServiceWorkerContainer.h in Headers */,
+                               517A535D1F5899FE00DCDC0A /* ServiceWorkerFetchResult.h in Headers */,
                                51F175611F3EBC8300C74950 /* ServiceWorkerGlobalScope.h in Headers */,
                                51F175631F3EBC8300C74950 /* ServiceWorkerJob.h in Headers */,
                                51F175641F3EBC8300C74950 /* ServiceWorkerJobClient.h in Headers */,
                                2E4346530F546A8200B0F1BA /* WorkerRunLoop.h in Headers */,
                                A57FD71C1DB9423E006AE24B /* WorkerRuntimeAgent.h in Headers */,
                                E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */,
-                               7CBBBCC71F560581005EFAAC /* DOMMatrix2DInit.h in Headers */,
                                A54A0C661DB805360017A90B /* WorkerScriptDebugServer.h in Headers */,
                                A7D6B3490F61104500B79FD1 /* WorkerScriptLoader.h in Headers */,
                                2EA768040FE7126400AB9C8A /* WorkerScriptLoaderClient.h in Headers */,
                                49484FCD102CF23C00187DD3 /* CanvasStyle.cpp in Sources */,
                                072CA86116CB4DC3008AE131 /* CaptionUserPreferences.cpp in Sources */,
                                079D086C162F21F900DB8658 /* CaptionUserPreferencesMediaAF.cpp in Sources */,
-                               7CBBBCCB1F56180D005EFAAC /* JSDOMMatrix2DInit.cpp in Sources */,
                                07B7116E1D899E63009F0FFB /* CaptureDeviceManager.cpp in Sources */,
                                CDC734141977896C0046BFC5 /* CARingBuffer.cpp in Sources */,
                                6550B69D099DF0270090D781 /* CDATASection.cpp in Sources */,
                                A8185F3A09765766005826D9 /* DocumentType.cpp in Sources */,
                                973889A0116EA9DC00ADF313 /* DocumentWriter.cpp in Sources */,
                                1A8F6BC20DB55CDC001DB794 /* DOMApplicationCache.cpp in Sources */,
-                               41FABD2F1F4E02CB006A6C97 /* DOMCache.cpp in Sources */,
+                               41FABD2F1F4E02CB006A6C97 /* DOMCacheEngine.cpp in Sources */,
                                FD677738195CAF3D0072E0D3 /* DOMCSSNamespace.cpp in Sources */,
                                7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */,
                                BC1BDF24156C1883001C1243 /* DOMError.cpp in Sources */,
                                4138F8571D253F08001CB61E /* JSDOMIterator.cpp in Sources */,
                                41DEFCB51E56C1BD000D9E5F /* JSDOMMapLike.cpp in Sources */,
                                836ACED21ECAAB19004BD012 /* JSDOMMatrix.cpp in Sources */,
+                               7CBBBCCB1F56180D005EFAAC /* JSDOMMatrix2DInit.cpp in Sources */,
                                835657C71ECAB10700CDE72D /* JSDOMMatrixInit.cpp in Sources */,
                                836ACED51ECAAB19004BD012 /* JSDOMMatrixReadOnly.cpp in Sources */,
                                A9D248060D757E7D00FDF959 /* JSDOMMimeType.cpp in Sources */,
index 2f9af02..9f8c24a 100644 (file)
@@ -4150,7 +4150,7 @@ void Internals::clearCacheStorageMemoryRepresentation()
         if (!m_cacheStorageConnection)
             return;
     }
-    m_cacheStorageConnection->clearMemoryRepresentation(document->securityOrigin().toString(), [](std::optional<DOMCache::Error>&&) { });
+    m_cacheStorageConnection->clearMemoryRepresentation(document->securityOrigin().toString(), [](std::optional<DOMCacheEngine::Error>&&) { });
 }
 
 } // namespace WebCore
index b62b7ee..e5c56fe 100644 (file)
@@ -1,3 +1,37 @@
+2017-09-01  Per Arne Vollan  <pvollan@apple.com>
+
+        [Win] Compile error, 'Cache' is not declared.
+        https://bugs.webkit.org/show_bug.cgi?id=176062
+
+        Reviewed by Youenn Fablet.
+
+        Rename DOMCache to DOMCacheEngine.
+
+        * NetworkProcess/cache/CacheStorageEngine.cpp:
+        (WebKit::CacheStorage::Engine::queryCache):
+        (WebKit::CacheStorage::Engine::writeFile):
+        * NetworkProcess/cache/CacheStorageEngine.h:
+        * NetworkProcess/cache/CacheStorageEngineCache.h:
+        * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
+        (WebKit::CacheStorage::Caches::initialize):
+        * NetworkProcess/cache/CacheStorageEngineCaches.h:
+        * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
+        * NetworkProcess/cache/CacheStorageEngineConnection.h:
+        * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::encode):
+        (IPC::ArgumentCoder<DOMCacheEngine::CacheInfo>::decode):
+        (IPC::ArgumentCoder<DOMCacheEngine::Record>::encode):
+        (IPC::ArgumentCoder<DOMCacheEngine::Record>::decode):
+        (IPC::ArgumentCoder<DOMCache::CacheInfo>::encode): Deleted.
+        (IPC::ArgumentCoder<DOMCache::CacheInfo>::decode): Deleted.
+        (IPC::ArgumentCoder<DOMCache::Record>::encode): Deleted.
+        (IPC::ArgumentCoder<DOMCache::Record>::decode): Deleted.
+        * Shared/WebCoreArgumentCoders.h:
+        * WebProcess/Cache/WebCacheStorageConnection.cpp:
+        * WebProcess/Cache/WebCacheStorageConnection.h:
+        * WebProcess/Cache/WebCacheStorageConnection.messages.in:
+
 2017-08-31  Andy Estes  <aestes@apple.com>
 
         [Mac] Upstream AppKit-related WebKitSystemInterface functions
index 9e9f344..cbbcafb 100644 (file)
@@ -34,7 +34,7 @@
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/StringHash.h>
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 using namespace WebKit::NetworkCache;
 
 namespace WebKit {
@@ -253,7 +253,7 @@ Cache* Engine::cache(uint64_t cacheIdentifier)
     return result;
 }
 
-void Engine::writeFile(const String& filename, NetworkCache::Data&& data, WebCore::DOMCache::CompletionCallback&& callback)
+void Engine::writeFile(const String& filename, NetworkCache::Data&& data, WebCore::DOMCacheEngine::CompletionCallback&& callback)
 {
     if (!shouldPersist()) {
         callback(std::nullopt);
index b61f528..22e92f7 100644 (file)
@@ -53,15 +53,15 @@ public:
 
     bool shouldPersist() const { return !!m_ioQueue;}
 
-    void open(const String& origin, const String& cacheName, WebCore::DOMCache::CacheIdentifierCallback&&);
-    void remove(uint64_t cacheIdentifier, WebCore::DOMCache::CacheIdentifierCallback&&);
-    void retrieveCaches(const String& origin, uint64_t updateCounter, WebCore::DOMCache::CacheInfosCallback&&);
+    void open(const String& origin, const String& cacheName, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    void remove(uint64_t cacheIdentifier, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    void retrieveCaches(const String& origin, uint64_t updateCounter, WebCore::DOMCacheEngine::CacheInfosCallback&&);
 
-    void retrieveRecords(uint64_t cacheIdentifier, WebCore::DOMCache::RecordsCallback&&);
-    void putRecords(uint64_t cacheIdentifier, Vector<WebCore::DOMCache::Record>&&, WebCore::DOMCache::RecordIdentifiersCallback&&);
-    void deleteMatchingRecords(uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCache::RecordIdentifiersCallback&&);
+    void retrieveRecords(uint64_t cacheIdentifier, WebCore::DOMCacheEngine::RecordsCallback&&);
+    void putRecords(uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
+    void deleteMatchingRecords(uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
 
-    void writeFile(const String& filename, NetworkCache::Data&&, WebCore::DOMCache::CompletionCallback&&);
+    void writeFile(const String& filename, NetworkCache::Data&&, WebCore::DOMCacheEngine::CompletionCallback&&);
     void readFile(const String& filename, WTF::Function<void(const NetworkCache::Data&, int error)>&&);
     void removeFile(const String& filename);
 
@@ -75,13 +75,13 @@ private:
     static Engine& defaultEngine();
     explicit Engine(String&& rootPath);
 
-    void initialize(Function<void(std::optional<WebCore::DOMCache::Error>&&)>&&);
+    void initialize(Function<void(std::optional<WebCore::DOMCacheEngine::Error>&&)>&&);
 
-    using CachesOrError = Expected<std::reference_wrapper<Caches>, WebCore::DOMCache::Error>;
+    using CachesOrError = Expected<std::reference_wrapper<Caches>, WebCore::DOMCacheEngine::Error>;
     using CachesCallback = WTF::Function<void(CachesOrError&&)>;
     void readCachesFromDisk(const String& origin, CachesCallback&&);
 
-    using CacheOrError = Expected<std::reference_wrapper<Cache>, WebCore::DOMCache::Error>;
+    using CacheOrError = Expected<std::reference_wrapper<Cache>, WebCore::DOMCacheEngine::Error>;
     using CacheCallback = WTF::Function<void(CacheOrError&&)>;
     void readCache(uint64_t cacheIdentifier, CacheCallback&&);
 
index 99e12d9..7b0677f 100644 (file)
@@ -42,7 +42,7 @@
 
 
 using namespace WebCore;
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 using namespace WebKit::NetworkCache;
 
 namespace WebKit {
@@ -142,7 +142,7 @@ Vector<uint64_t> Cache::queryCache(const ResourceRequest& request, const CacheQu
 
     Vector<uint64_t> results;
     for (const auto& record : m_records) {
-        if (WebCore::DOMCache::queryCacheMatch(request, record.request, record.response, options))
+        if (WebCore::DOMCacheEngine::queryCacheMatch(request, record.request, record.response, options))
             results.append(record.identifier);
     }
     return results;
index e33a967..def86f5 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include <WebCore/DOMCache.h>
+#include <WebCore/DOMCacheEngine.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
@@ -40,22 +40,22 @@ public:
     uint64_t identifier() const { return m_identifier; }
     const String& name() const { return m_name; }
 
-    Vector<WebCore::DOMCache::Record> records() const;
-    WebCore::DOMCache::CacheInfo info() const { return { m_identifier, m_name }; }
+    Vector<WebCore::DOMCacheEngine::Record> records() const;
+    WebCore::DOMCacheEngine::CacheInfo info() const { return { m_identifier, m_name }; }
 
-    void put(Vector<WebCore::DOMCache::Record>&&, WebCore::DOMCache::RecordIdentifiersCallback&&);
-    void remove(WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCache::RecordIdentifiersCallback&&);
+    void put(Vector<WebCore::DOMCacheEngine::Record>&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
+    void remove(WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&, WebCore::DOMCacheEngine::RecordIdentifiersCallback&&);
 
 private:
     Vector<uint64_t> queryCache(const WebCore::ResourceRequest&, const WebCore::CacheQueryOptions&);
 
-    void writeRecordsList(WebCore::DOMCache::CompletionCallback&&);
-    void writeRecordToDisk(WebCore::DOMCache::Record&);
-    void removeRecordFromDisk(WebCore::DOMCache::Record&);
+    void writeRecordsList(WebCore::DOMCacheEngine::CompletionCallback&&);
+    void writeRecordToDisk(WebCore::DOMCacheEngine::Record&);
+    void removeRecordFromDisk(WebCore::DOMCacheEngine::Record&);
 
     uint64_t m_identifier { 0 };
     String m_name;
-    Vector<WebCore::DOMCache::Record> m_records;
+    Vector<WebCore::DOMCacheEngine::Record> m_records;
     uint64_t m_nextRecordIdentifier { 0 };
 };
 
index f56ef23..5b3f7f4 100644 (file)
@@ -29,7 +29,7 @@
 #include "NetworkCacheCoders.h"
 #include <wtf/text/StringBuilder.h>
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 using namespace WebKit::NetworkCache;
 
 namespace WebKit {
@@ -56,7 +56,7 @@ Caches::Caches(Engine& engine, const String& origin)
 {
 }
 
-void Caches::initialize(WebCore::DOMCache::CompletionCallback&& callback)
+void Caches::initialize(WebCore::DOMCacheEngine::CompletionCallback&& callback)
 {
     if (m_isInitialized || m_rootPath.isNull()) {
         callback(std::nullopt);
index c48a6f9..3630d6a 100644 (file)
@@ -38,15 +38,15 @@ class Caches : public RefCounted<Caches> {
 public:
     static Ref<Caches> create(Engine& engine, const String& origin) { return adoptRef(*new Caches { engine, origin }); }
 
-    void initialize(WebCore::DOMCache::CompletionCallback&&);
-    void open(String&& name, WebCore::DOMCache::CacheIdentifierCallback&&);
-    void remove(uint64_t identifier, WebCore::DOMCache::CompletionCallback&&);
+    void initialize(WebCore::DOMCacheEngine::CompletionCallback&&);
+    void open(String&& name, WebCore::DOMCacheEngine::CacheIdentifierCallback&&);
+    void remove(uint64_t identifier, WebCore::DOMCacheEngine::CompletionCallback&&);
     void clearMemoryRepresentation();
 
     void detach();
 
     bool isInitialized() const { return m_isInitialized; }
-    WebCore::DOMCache::CacheInfos cacheInfos(uint64_t updateCounter) const;
+    WebCore::DOMCacheEngine::CacheInfos cacheInfos(uint64_t updateCounter) const;
 
     const Cache* find(const String& name) const;
     Cache* find(uint64_t identifier);
@@ -54,8 +54,8 @@ public:
 private:
     Caches(Engine&, const String& rootPath);
 
-    void readCachesFromDisk(WTF::Function<void(Expected<Vector<Cache>, WebCore::DOMCache::Error>&&)>&&);
-    void writeCachesToDisk(WebCore::DOMCache::CompletionCallback&&);
+    void readCachesFromDisk(WTF::Function<void(Expected<Vector<Cache>, WebCore::DOMCacheEngine::Error>&&)>&&);
+    void writeCachesToDisk(WebCore::DOMCacheEngine::CompletionCallback&&);
 
     bool shouldPersist() const { return !m_rootPath.isNull(); }
 
@@ -69,7 +69,7 @@ private:
     Vector<Cache> m_caches;
     Vector<Cache> m_removedCaches;
     RefPtr<NetworkCache::Storage> m_storage;
-    Vector<WebCore::DOMCache::CompletionCallback> m_pendingInitializationCallbacks;
+    Vector<WebCore::DOMCacheEngine::CompletionCallback> m_pendingInitializationCallbacks;
 };
 
 } // namespace CacheStorage
index ee93b88..b73b155 100644 (file)
@@ -32,7 +32,7 @@
 #include "WebCoreArgumentCoders.h"
 #include <WebCore/CacheQueryOptions.h>
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 using namespace WebKit::CacheStorage;
 
 namespace WebKit {
index 4e48a8e..a33e147 100644 (file)
@@ -58,7 +58,7 @@ private:
 
     void records(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier);
     void deleteMatchingRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest&&, WebCore::CacheQueryOptions&&);
-    void putRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCache::Record>&&);
+    void putRecords(PAL::SessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&);
 
     NetworkConnectionToWebProcess& m_connection;
 };
index 950fae2..077d93b 100644 (file)
@@ -29,5 +29,5 @@ messages -> CacheStorageEngineConnection {
 
     Records(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier);
     DeleteMatchingRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, WebCore::ResourceRequest request, struct WebCore::CacheQueryOptions options);
-    PutRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCache::Record> record);
+    PutRecords(PAL::SessionID sessionID, uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record> record);
 }
index f33a450..3194e60 100644 (file)
@@ -214,13 +214,13 @@ bool ArgumentCoder<CacheQueryOptions>::decode(Decoder& decoder, CacheQueryOption
     return true;
 }
 
-void ArgumentCoder<DOMCache::CacheInfo>::encode(Encoder& encoder, const DOMCache::CacheInfo& info)
+void ArgumentCoder<DOMCacheEngine::CacheInfo>::encode(Encoder& encoder, const DOMCacheEngine::CacheInfo& info)
 {
     encoder << info.identifier;
     encoder << info.name;
 }
 
-bool ArgumentCoder<DOMCache::CacheInfo>::decode(Decoder& decoder, DOMCache::CacheInfo& record)
+bool ArgumentCoder<DOMCacheEngine::CacheInfo>::decode(Decoder& decoder, DOMCacheEngine::CacheInfo& record)
 {
     uint64_t identifier;
     if (!decoder.decode(identifier))
@@ -236,7 +236,7 @@ bool ArgumentCoder<DOMCache::CacheInfo>::decode(Decoder& decoder, DOMCache::Cach
     return true;
 }
 
-void ArgumentCoder<DOMCache::Record>::encode(Encoder& encoder, const DOMCache::Record& record)
+void ArgumentCoder<DOMCacheEngine::Record>::encode(Encoder& encoder, const DOMCacheEngine::Record& record)
 {
     encoder << record.identifier;
 
@@ -262,7 +262,7 @@ void ArgumentCoder<DOMCache::Record>::encode(Encoder& encoder, const DOMCache::R
     });
 }
 
-bool ArgumentCoder<DOMCache::Record>::decode(Decoder& decoder, DOMCache::Record& record)
+bool ArgumentCoder<DOMCacheEngine::Record>::decode(Decoder& decoder, DOMCacheEngine::Record& record)
 {
     uint64_t identifier;
     if (!decoder.decode(identifier))
@@ -296,7 +296,7 @@ bool ArgumentCoder<DOMCache::Record>::decode(Decoder& decoder, DOMCache::Record&
     if (!decoder.decode(updateResponseCounter))
         return false;
 
-    WebCore::DOMCache::ResponseBody responseBody;
+    WebCore::DOMCacheEngine::ResponseBody responseBody;
     bool hasSharedBufferBody;
     if (!decoder.decode(hasSharedBufferBody))
         return false;
index e6dbcd6..6f25a35 100644 (file)
@@ -200,14 +200,14 @@ template<> struct ArgumentCoder<WebCore::CacheQueryOptions> {
     static bool decode(Decoder&, WebCore::CacheQueryOptions&);
 };
 
-template<> struct ArgumentCoder<WebCore::DOMCache::CacheInfo> {
-    static void encode(Encoder&, const WebCore::DOMCache::CacheInfo&);
-    static bool decode(Decoder&, WebCore::DOMCache::CacheInfo&);
+template<> struct ArgumentCoder<WebCore::DOMCacheEngine::CacheInfo> {
+    static void encode(Encoder&, const WebCore::DOMCacheEngine::CacheInfo&);
+    static bool decode(Decoder&, WebCore::DOMCacheEngine::CacheInfo&);
 };
 
-template<> struct ArgumentCoder<WebCore::DOMCache::Record> {
-    static void encode(Encoder&, const WebCore::DOMCache::Record&);
-    static bool decode(Decoder&, WebCore::DOMCache::Record&);
+template<> struct ArgumentCoder<WebCore::DOMCacheEngine::Record> {
+    static void encode(Encoder&, const WebCore::DOMCacheEngine::Record&);
+    static bool decode(Decoder&, WebCore::DOMCacheEngine::Record&);
 };
 
 template<> struct ArgumentCoder<WebCore::EventTrackingRegions> {
index 1f18208..461210d 100644 (file)
@@ -35,7 +35,7 @@
 #include "WebProcess.h"
 #include <wtf/MainThread.h>
 
-using namespace WebCore::DOMCache;
+using namespace WebCore::DOMCacheEngine;
 using namespace WebKit::CacheStorage;
 
 namespace WebKit {
index 4598a62..6e937df 100644 (file)
@@ -58,17 +58,17 @@ private:
 
     void doRetrieveRecords(uint64_t requestIdentifier, uint64_t cacheIdentifier) final;
     void doBatchDeleteOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, const WebCore::ResourceRequest&, WebCore::CacheQueryOptions&&) final;
-    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCache::Record>&&) final;
+    void doBatchPutOperation(uint64_t requestIdentifier, uint64_t cacheIdentifier, Vector<WebCore::DOMCacheEngine::Record>&&) final;
 
-    void clearMemoryRepresentation(const String& origin, WebCore::DOMCache::CompletionCallback&&) final;
+    void clearMemoryRepresentation(const String& origin, WebCore::DOMCacheEngine::CompletionCallback&&) final;
 
-    void openCompleted(uint64_t requestIdentifier, const WebCore::DOMCache::CacheIdentifierOrError&);
-    void removeCompleted(uint64_t requestIdentifier, const WebCore::DOMCache::CacheIdentifierOrError&);
-    void updateCaches(uint64_t requestIdentifier, WebCore::DOMCache::CacheInfosOrError&&);
+    void openCompleted(uint64_t requestIdentifier, const WebCore::DOMCacheEngine::CacheIdentifierOrError&);
+    void removeCompleted(uint64_t requestIdentifier, const WebCore::DOMCacheEngine::CacheIdentifierOrError&);
+    void updateCaches(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheInfosOrError&&);
 
-    void updateRecords(uint64_t requestIdentifier, WebCore::DOMCache::RecordsOrError&&);
-    void deleteRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCache::RecordIdentifiersOrError&&);
-    void putRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCache::RecordIdentifiersOrError&&);
+    void updateRecords(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordsOrError&&);
+    void deleteRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError&&);
+    void putRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError&&);
 
     WebCacheStorageProvider& m_provider;
     PAL::SessionID m_sessionID;
index a9e3324..5e67ec9 100644 (file)
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 messages -> WebCacheStorageConnection {
-    OpenCompleted(uint64_t requestIdentifier, WebCore::DOMCache::CacheIdentifierOrError result);
-    RemoveCompleted(uint64_t requestIdentifier, WebCore::DOMCache::CacheIdentifierOrError result);
-    UpdateCaches(uint64_t requestIdentifier, WebCore::DOMCache::CacheInfosOrError result);
+    OpenCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheIdentifierOrError result);
+    RemoveCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheIdentifierOrError result);
+    UpdateCaches(uint64_t requestIdentifier, WebCore::DOMCacheEngine::CacheInfosOrError result);
 
-    UpdateRecords(uint64_t requestIdentifier, WebCore::DOMCache::RecordsOrError result);
-    DeleteRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCache::RecordIdentifiersOrError result);
-    PutRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCache::RecordIdentifiersOrError result);
+    UpdateRecords(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordsOrError result);
+    DeleteRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError result);
+    PutRecordsCompleted(uint64_t requestIdentifier, WebCore::DOMCacheEngine::RecordIdentifiersOrError result);
 }