Changeset 283271 in webkit
- Timestamp:
- Sep 29, 2021, 3:45:23 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 30 edited
- 4 moved
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Headers.cmake (modified) (1 diff)
-
WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.cpp (modified) (6 diffs)
-
WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.h (modified) (2 diffs)
-
WebCore/Modules/filesystemaccess/FileSystemFileHandle.cpp (modified) (2 diffs)
-
WebCore/Modules/filesystemaccess/FileSystemFileHandle.h (modified) (1 diff)
-
WebCore/Modules/filesystemaccess/FileSystemHandle.cpp (modified) (3 diffs)
-
WebCore/Modules/filesystemaccess/FileSystemHandle.h (modified) (3 diffs)
-
WebCore/Modules/filesystemaccess/FileSystemHandleIdentifier.h (moved) (moved from trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandleIdentifier.h ) (1 diff)
-
WebCore/Modules/filesystemaccess/FileSystemStorageConnection.h (moved) (moved from trunk/Source/WebCore/Modules/filesystemaccess/FileSystemHandleImpl.h ) (2 diffs)
-
WebCore/Modules/storage/DummyStorageProvider.h (modified) (1 diff)
-
WebCore/Modules/storage/StorageConnection.h (modified) (3 diffs)
-
WebCore/Modules/storage/StorageManager.cpp (modified) (2 diffs)
-
WebCore/Modules/storage/WorkerStorageConnection.cpp (modified) (1 diff)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp (modified) (5 diffs)
-
WebKit/NetworkProcess/storage/FileSystemStorageHandle.h (modified) (2 diffs)
-
WebKit/NetworkProcess/storage/FileSystemStorageHandleRegistry.cpp (modified) (3 diffs)
-
WebKit/NetworkProcess/storage/FileSystemStorageHandleRegistry.h (modified) (2 diffs)
-
WebKit/NetworkProcess/storage/FileSystemStorageManager.cpp (modified) (4 diffs)
-
WebKit/NetworkProcess/storage/FileSystemStorageManager.h (modified) (2 diffs)
-
WebKit/NetworkProcess/storage/NetworkStorageManager.cpp (modified) (6 diffs)
-
WebKit/NetworkProcess/storage/NetworkStorageManager.h (modified) (2 diffs)
-
WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in (modified) (1 diff)
-
WebKit/NetworkProcess/storage/OriginStorageManager.h (modified) (1 diff)
-
WebKit/Scripts/webkit/messages.py (modified) (2 diffs)
-
WebKit/Sources.txt (modified) (2 diffs)
-
WebKit/WebKit.xcodeproj/project.pbxproj (modified) (7 diffs)
-
WebKit/WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp (moved) (moved from trunk/Source/WebKit/WebProcess/WebCoreSupport/FileSystemStorageHandleProxy.cpp ) (4 diffs)
-
WebKit/WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h (moved) (moved from trunk/Source/WebKit/WebProcess/WebCoreSupport/FileSystemStorageHandleProxy.h ) (2 diffs)
-
WebKit/WebProcess/WebCoreSupport/WebStorageConnection.cpp (modified) (2 diffs)
-
WebKit/WebProcess/WebProcess.cpp (modified) (2 diffs)
-
WebKit/WebProcess/WebProcess.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r283269 r283271 1 2021-09-29 Sihui Liu <sihui_liu@apple.com> 2 3 Replace FileSystemHandleImpl with FileSystemStorageConnection 4 https://bugs.webkit.org/show_bug.cgi?id=230861 5 <rdar://problem/83606465> 6 7 Reviewed by Youenn Fablet. 8 9 Introduce WorkerStorageConnection class, which dispatches StorageManager task to main-thread StorageConnection 10 and dispatches result back to worker thread. 11 12 Rebaselined existing test. 13 14 * Headers.cmake: 15 * Modules/filesystemaccess/FileSystemDirectoryHandle.cpp: 16 (WebCore::FileSystemDirectoryHandle::create): 17 (WebCore::FileSystemDirectoryHandle::FileSystemDirectoryHandle): 18 (WebCore::FileSystemDirectoryHandle::getFileHandle): 19 (WebCore::FileSystemDirectoryHandle::getDirectoryHandle): 20 (WebCore::FileSystemDirectoryHandle::removeEntry): 21 (WebCore::FileSystemDirectoryHandle::resolve): 22 * Modules/filesystemaccess/FileSystemDirectoryHandle.h: 23 * Modules/filesystemaccess/FileSystemFileHandle.cpp: 24 (WebCore::FileSystemFileHandle::create): 25 (WebCore::FileSystemFileHandle::FileSystemFileHandle): 26 * Modules/filesystemaccess/FileSystemFileHandle.h: 27 * Modules/filesystemaccess/FileSystemHandle.cpp: 28 (WebCore::FileSystemHandle::FileSystemHandle): 29 (WebCore::FileSystemHandle::isSameEntry const): 30 * Modules/filesystemaccess/FileSystemHandle.h: 31 (WebCore::FileSystemHandle::identifier const): 32 (WebCore::FileSystemHandle::connection): 33 (WebCore::FileSystemHandle::impl const): Deleted. 34 * Modules/filesystemaccess/FileSystemHandleIdentifier.h: Renamed from Source/WebKit/NetworkProcess/storage/FileSystemStorageHandleIdentifier.h. 35 * Modules/filesystemaccess/FileSystemStorageConnection.h: Renamed from Source/WebCore/Modules/filesystemaccess/FileSystemHandleImpl.h. 36 (WebCore::FileSystemStorageConnection::~FileSystemStorageConnection): 37 * Modules/storage/DummyStorageProvider.h: 38 * Modules/storage/StorageConnection.h: 39 * Modules/storage/StorageManager.cpp: 40 (WebCore::StorageManager::fileSystemAccessGetDirectory): 41 * Modules/storage/WorkerStorageConnection.cpp: 42 * WebCore.xcodeproj/project.pbxproj: 43 1 44 2021-09-29 Aditya Keerthi <akeerthi@apple.com> 2 45 -
trunk/Source/WebCore/Headers.cmake
r283237 r283271 41 41 Modules/filesystemaccess/FileSystemFileHandle.h 42 42 Modules/filesystemaccess/FileSystemHandle.h 43 Modules/filesystemaccess/FileSystemHandleImpl.h 43 Modules/filesystemaccess/FileSystemHandleIdentifier.h 44 Modules/filesystemaccess/FileSystemStorageConnection.h 44 45 Modules/filesystemaccess/StorageManagerFileSystemAccess.h 45 46 -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.cpp
r283029 r283271 27 27 #include "FileSystemDirectoryHandle.h" 28 28 29 #include "FileSystem HandleImpl.h"29 #include "FileSystemStorageConnection.h" 30 30 #include "JSDOMPromiseDeferred.h" 31 31 #include "JSFileSystemDirectoryHandle.h" … … 37 37 WTF_MAKE_ISO_ALLOCATED_IMPL(FileSystemDirectoryHandle); 38 38 39 Ref<FileSystemDirectoryHandle> FileSystemDirectoryHandle::create(String&& name, Ref<FileSystemHandleImpl>&& impl)39 Ref<FileSystemDirectoryHandle> FileSystemDirectoryHandle::create(String&& name, FileSystemHandleIdentifier identifier, Ref<FileSystemStorageConnection>&& connection) 40 40 { 41 return adoptRef(*new FileSystemDirectoryHandle(WTFMove(name), WTFMove(impl)));41 return adoptRef(*new FileSystemDirectoryHandle(WTFMove(name), identifier, WTFMove(connection))); 42 42 } 43 43 44 FileSystemDirectoryHandle::FileSystemDirectoryHandle(String&& name, Ref<FileSystemHandleImpl>&& impl)45 : FileSystemHandle(FileSystemHandle::Kind::Directory, WTFMove(name), WTFMove(impl))44 FileSystemDirectoryHandle::FileSystemDirectoryHandle(String&& name, FileSystemHandleIdentifier identifier, Ref<FileSystemStorageConnection>&& connection) 45 : FileSystemHandle(FileSystemHandle::Kind::Directory, WTFMove(name), identifier, WTFMove(connection)) 46 46 { 47 47 } … … 50 50 { 51 51 bool createIfNecessary = options ? options->create : false; 52 impl().getFileHandle(name, createIfNecessary, [name, promise = WTFMove(promise)](auto result) mutable {52 connection().getFileHandle(identifier(), name, createIfNecessary, [connection = Ref { connection() }, name, promise = WTFMove(promise)](auto result) mutable { 53 53 if (result.hasException()) 54 54 return promise.reject(result.releaseException()); 55 55 56 promise. resolve(FileSystemFileHandle::create(String { name }, result.releaseReturnValue()));56 promise.settle(FileSystemFileHandle::create(String { name }, result.returnValue(), WTFMove(connection))); 57 57 }); 58 58 } … … 61 61 { 62 62 bool createIfNecessary = options ? options->create : false; 63 impl().getDirectoryHandle(name, createIfNecessary, [name, promise = WTFMove(promise)](auto result) mutable {63 connection().getDirectoryHandle(identifier(), name, createIfNecessary, [connection = Ref { connection() }, name, promise = WTFMove(promise)](auto result) mutable { 64 64 if (result.hasException()) 65 65 return promise.reject(result.releaseException()); 66 66 67 promise. resolve(FileSystemDirectoryHandle::create(String { name }, result.releaseReturnValue()));67 promise.settle(FileSystemDirectoryHandle::create(String { name }, result.returnValue(), WTFMove(connection))); 68 68 }); 69 69 } … … 72 72 { 73 73 bool deleteRecursively = options ? options->recursive : false; 74 impl().removeEntry(name, deleteRecursively, [promise = WTFMove(promise)](auto result) mutable {74 connection().removeEntry(identifier(), name, deleteRecursively, [promise = WTFMove(promise)](auto result) mutable { 75 75 promise.settle(WTFMove(result)); 76 76 }); … … 79 79 void FileSystemDirectoryHandle::resolve(const FileSystemHandle& handle, DOMPromiseDeferred<IDLSequence<IDLUSVString>>&& promise) 80 80 { 81 impl().resolve(handle.impl(), [promise = WTFMove(promise)](auto result) mutable {81 connection().resolve(identifier(), handle.identifier(), [promise = WTFMove(promise)](auto result) mutable { 82 82 if (result.hasException()) 83 83 return promise.reject(result.releaseException()); -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemDirectoryHandle.h
r283029 r283271 47 47 }; 48 48 49 WEBCORE_EXPORT static Ref<FileSystemDirectoryHandle> create(String&&, Ref<FileSystemHandleImpl>&&);49 WEBCORE_EXPORT static Ref<FileSystemDirectoryHandle> create(String&&, FileSystemHandleIdentifier, Ref<FileSystemStorageConnection>&&); 50 50 void getFileHandle(const String& name, std::optional<GetFileOptions>, DOMPromiseDeferred<IDLInterface<FileSystemFileHandle>>&&); 51 51 void getDirectoryHandle(const String& name, std::optional<GetDirectoryOptions>, DOMPromiseDeferred<IDLInterface<FileSystemDirectoryHandle>>&&); … … 54 54 55 55 private: 56 FileSystemDirectoryHandle(String&&, Ref<FileSystemHandleImpl>&&);56 FileSystemDirectoryHandle(String&&, FileSystemHandleIdentifier, Ref<FileSystemStorageConnection>&&); 57 57 }; 58 58 -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemFileHandle.cpp
r283029 r283271 27 27 #include "FileSystemFileHandle.h" 28 28 29 #include "FileSystem HandleImpl.h"29 #include "FileSystemStorageConnection.h" 30 30 #include "JSDOMPromiseDeferred.h" 31 31 #include <wtf/IsoMallocInlines.h> … … 35 35 WTF_MAKE_ISO_ALLOCATED_IMPL(FileSystemFileHandle); 36 36 37 Ref<FileSystemFileHandle> FileSystemFileHandle::create(String&& name, Ref<FileSystemHandleImpl>&& impl)37 Ref<FileSystemFileHandle> FileSystemFileHandle::create(String&& name, FileSystemHandleIdentifier identifier, Ref<FileSystemStorageConnection>&& connection) 38 38 { 39 return adoptRef(*new FileSystemFileHandle(WTFMove(name), WTFMove(impl)));39 return adoptRef(*new FileSystemFileHandle(WTFMove(name), identifier, WTFMove(connection))); 40 40 } 41 41 42 FileSystemFileHandle::FileSystemFileHandle(String&& name, Ref<FileSystemHandleImpl>&& impl)43 : FileSystemHandle(FileSystemHandle::Kind::File, WTFMove(name), WTFMove(impl))42 FileSystemFileHandle::FileSystemFileHandle(String&& name, FileSystemHandleIdentifier identifier, Ref<FileSystemStorageConnection>&& connection) 43 : FileSystemHandle(FileSystemHandle::Kind::File, WTFMove(name), identifier, WTFMove(connection)) 44 44 { 45 45 } -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemFileHandle.h
r283029 r283271 35 35 WTF_MAKE_ISO_ALLOCATED(FileSystemFileHandle); 36 36 public: 37 WEBCORE_EXPORT static Ref<FileSystemFileHandle> create(String&&, Ref<FileSystemHandleImpl>&&);37 WEBCORE_EXPORT static Ref<FileSystemFileHandle> create(String&&, FileSystemHandleIdentifier, Ref<FileSystemStorageConnection>&&); 38 38 void getFile(DOMPromiseDeferred<IDLInterface<File>>&&); 39 39 40 40 private: 41 FileSystemFileHandle(String&&, Ref<FileSystemHandleImpl>&&);41 FileSystemFileHandle(String&&, FileSystemHandleIdentifier, Ref<FileSystemStorageConnection>&&); 42 42 }; 43 43 -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemHandle.cpp
r283069 r283271 27 27 #include "FileSystemHandle.h" 28 28 29 #include "FileSystemHandleImpl.h"30 29 #include "JSDOMPromiseDeferred.h" 31 30 #include <wtf/IsoMallocInlines.h> … … 35 34 WTF_MAKE_ISO_ALLOCATED_IMPL(FileSystemHandle); 36 35 37 FileSystemHandle::FileSystemHandle(FileSystemHandle::Kind kind, String&& name, Ref<FileSystemHandleImpl>&& impl)36 FileSystemHandle::FileSystemHandle(FileSystemHandle::Kind kind, String&& name, FileSystemHandleIdentifier identifier, Ref<FileSystemStorageConnection>&& connection) 38 37 : m_kind(kind) 39 38 , m_name(WTFMove(name)) 40 , m_impl(WTFMove(impl)) 39 , m_identifier(identifier) 40 , m_connection(WTFMove(connection)) 41 41 { 42 42 } … … 49 49 return promise.resolve(false); 50 50 51 m_ impl->isSameEntry(handle.impl(), [promise = WTFMove(promise)](auto result) mutable {51 m_connection->isSameEntry(m_identifier, handle.identifier(), [promise = WTFMove(promise)](auto result) mutable { 52 52 promise.settle(WTFMove(result)); 53 53 }); -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemHandle.h
r283029 r283271 26 26 #pragma once 27 27 28 #include "FileSystemHandleIdentifier.h" 28 29 #include "IDLTypes.h" 29 30 #include <wtf/IsoMalloc.h> … … 33 34 template<typename> class DOMPromiseDeferred; 34 35 35 class FileSystem HandleImpl;36 class FileSystemStorageConnection; 36 37 enum class PermissionState : uint8_t; 37 38 … … 47 48 Kind kind() const { return m_kind; } 48 49 const String& name() const { return m_name; } 49 FileSystemHandleI mpl& impl() const { return m_impl.get(); }50 FileSystemHandleIdentifier identifier() const { return m_identifier; } 50 51 51 52 void isSameEntry(FileSystemHandle&, DOMPromiseDeferred<IDLBoolean>&&) const; 52 53 53 54 protected: 54 FileSystemHandle(Kind, String&& name, Ref<FileSystemHandleImpl>&&); 55 FileSystemHandle(Kind, String&& name, FileSystemHandleIdentifier, Ref<FileSystemStorageConnection>&&); 56 FileSystemStorageConnection& connection() { return m_connection.get(); } 55 57 56 58 private: 57 59 Kind m_kind { Kind::File }; 58 60 String m_name; 59 Ref<FileSystemHandleImpl> m_impl; 61 FileSystemHandleIdentifier m_identifier; 62 Ref<FileSystemStorageConnection> m_connection; 60 63 }; 61 64 -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemHandleIdentifier.h
r283270 r283271 28 28 #include <wtf/ObjectIdentifier.h> 29 29 30 namespace Web Kit{30 namespace WebCore { 31 31 32 enum FileSystem StorageHandleIdentifierType { };33 using FileSystem StorageHandleIdentifier = ObjectIdentifier<FileSystemStorageHandleIdentifierType>;32 enum FileSystemHandleIdentifierType { }; 33 using FileSystemHandleIdentifier = ObjectIdentifier<FileSystemHandleIdentifierType>; 34 34 35 } // namespace Web Kit35 } // namespace WebCore -
trunk/Source/WebCore/Modules/filesystemaccess/FileSystemStorageConnection.h
r283270 r283271 26 26 #pragma once 27 27 28 #include "FileSystemHandleIdentifier.h" 28 29 #include <wtf/CompletionHandler.h> 30 #include <wtf/ThreadSafeRefCounted.h> 29 31 30 32 namespace WebCore { … … 34 36 template<typename> class ExceptionOr; 35 37 36 class FileSystem HandleImpl : public RefCounted<FileSystemHandleImpl> {38 class FileSystemStorageConnection : public ThreadSafeRefCounted<FileSystemStorageConnection> { 37 39 public: 38 virtual ~FileSystemHandleImpl() { } 39 virtual std::optional<uint64_t> storageHandleIdentifier() = 0; 40 virtual void isSameEntry(FileSystemHandleImpl&, CompletionHandler<void(ExceptionOr<bool>&&)>&&) = 0; 41 virtual void getFileHandle(const String& name, bool createIfNecessary, CompletionHandler<void(ExceptionOr<Ref<FileSystemHandleImpl>>&&)>&&) = 0; 42 virtual void getDirectoryHandle(const String& name, bool createIfNecessary, CompletionHandler<void(ExceptionOr<Ref<FileSystemHandleImpl>>&&)>&&) = 0; 43 virtual void removeEntry(const String& name, bool recursive, CompletionHandler<void(ExceptionOr<void>&&)>&&) = 0; 44 virtual void resolve(FileSystemHandleImpl&, CompletionHandler<void(ExceptionOr<Vector<String>>&&)>&&) = 0; 40 virtual ~FileSystemStorageConnection() { } 41 using SameEntryCallback = CompletionHandler<void(ExceptionOr<bool>&&)>; 42 using GetHandleCallback = CompletionHandler<void(ExceptionOr<FileSystemHandleIdentifier>&&)>; 43 using RemoveEntryCallback = CompletionHandler<void(ExceptionOr<void>&&)>; 44 using ResolveCallback = CompletionHandler<void(ExceptionOr<Vector<String>>&&)>; 45 virtual void isSameEntry(FileSystemHandleIdentifier, FileSystemHandleIdentifier, SameEntryCallback&&) = 0; 46 virtual void getFileHandle(FileSystemHandleIdentifier, const String& name, bool createIfNecessary, GetHandleCallback&&) = 0; 47 virtual void getDirectoryHandle(FileSystemHandleIdentifier, const String& name, bool createIfNecessary, GetHandleCallback&&) = 0; 48 virtual void removeEntry(FileSystemHandleIdentifier, const String& name, bool deleteRecursively, RemoveEntryCallback&&) = 0; 49 virtual void resolve(FileSystemHandleIdentifier, FileSystemHandleIdentifier, ResolveCallback&&) = 0; 45 50 }; 46 51 -
trunk/Source/WebCore/Modules/storage/DummyStorageProvider.h
r283184 r283271 26 26 #pragma once 27 27 28 #include "FileSystem HandleImpl.h"28 #include "FileSystemStorageConnection.h" 29 29 #include "StorageProvider.h" 30 30 -
trunk/Source/WebCore/Modules/storage/StorageConnection.h
r283184 r283271 26 26 #pragma once 27 27 28 #include "FileSystemHandleIdentifier.h" 28 29 #include <wtf/CompletionHandler.h> 29 30 #include <wtf/ThreadSafeRefCounted.h> … … 31 32 namespace WebCore { 32 33 33 class FileSystem HandleImpl;34 class FileSystemStorageConnection; 34 35 template<typename> class ExceptionOr; 35 36 struct ClientOrigin; … … 41 42 virtual void getPersisted(const ClientOrigin&, PersistCallback&&) = 0; 42 43 virtual void persist(const ClientOrigin&, PersistCallback&& completionHandler) { completionHandler(false); } 43 using GetDirectoryCallback = CompletionHandler<void(ExceptionOr< Ref<FileSystemHandleImpl>>&&)>;44 using GetDirectoryCallback = CompletionHandler<void(ExceptionOr<std::pair<FileSystemHandleIdentifier, RefPtr<FileSystemStorageConnection>>>)>; 44 45 virtual void fileSystemGetDirectory(const ClientOrigin&, GetDirectoryCallback&&) = 0; 45 46 }; -
trunk/Source/WebCore/Modules/storage/StorageManager.cpp
r283184 r283271 31 31 #include "ExceptionOr.h" 32 32 #include "FileSystemDirectoryHandle.h" 33 #include "FileSystem HandleImpl.h"33 #include "FileSystemStorageConnection.h" 34 34 #include "JSDOMPromiseDeferred.h" 35 35 #include "JSFileSystemDirectoryHandle.h" … … 120 120 return promise.reject(result.releaseException()); 121 121 122 promise.resolve(FileSystemDirectoryHandle::create({ }, result.releaseReturnValue())); 122 auto identifierConnectionPair = result.releaseReturnValue(); 123 promise.resolve(FileSystemDirectoryHandle::create({ }, identifierConnectionPair.first, Ref { * identifierConnectionPair.second })); 123 124 }); 124 125 } -
trunk/Source/WebCore/Modules/storage/WorkerStorageConnection.cpp
r283184 r283271 28 28 29 29 #include "ClientOrigin.h" 30 #include "FileSystemHandleImpl.h"31 30 #include "WorkerGlobalScope.h" 32 31 #include "WorkerLoaderProxy.h" -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r283237 r283271 2808 2808 930AAC9F250ED4090013DA9F /* JSCSSConditionRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 930AAC9D250ED4090013DA9F /* JSCSSConditionRule.h */; }; 2809 2809 930AACA2250ED4110013DA9F /* JSCSSGroupingRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 930AACA0250ED4110013DA9F /* JSCSSGroupingRule.h */; }; 2810 9312BAD926F3AC9A00FDDF5F /* FileSystemHandleImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 931A075826F1B44F004474CD /* FileSystemHandleImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };2811 2810 93153BDA14181F7A00FCF5BE /* missingImage@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BD914181F7A00FCF5BE /* missingImage@2x.png */; }; 2812 2811 93153BDC141959BC00FCF5BE /* textAreaResizeCorner.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BDB141959BB00FCF5BE /* textAreaResizeCorner.png */; }; … … 2878 2877 93500F3213FDE3BE0099EC24 /* NSScrollerImpDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2879 2878 935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2879 9354242F2703CA51005CA72C /* FileSystemHandleIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 935424272703BC88005CA72C /* FileSystemHandleIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2880 935424302703CB86005CA72C /* FileSystemStorageConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 935424292703BCAD005CA72C /* FileSystemStorageConnection.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2880 2881 9355EF51253A4279006FF4A4 /* JSAbstractRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 9355EF4F253A4278006FF4A4 /* JSAbstractRange.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2881 2882 935C476309AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476209AC4CE600A6AAB4 /* MouseEventWithHitTestResults.h */; }; … … 11678 11679 9316DDFA240C64B3009340AA /* SimpleRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleRange.cpp; sourceTree = "<group>"; }; 11679 11680 9316DDFE240C64F8009340AA /* BoundaryPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BoundaryPoint.h; sourceTree = "<group>"; }; 11680 931A075826F1B44F004474CD /* FileSystemHandleImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemHandleImpl.h; sourceTree = "<group>"; };11681 11681 931A1BDD26F7ED090081A7E5 /* JSFileSystemHandleCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileSystemHandleCustom.cpp; sourceTree = "<group>"; }; 11682 11682 931AE3B81FB80EAE00F5EFB2 /* JSValueInWrappedObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSValueInWrappedObject.h; sourceTree = "<group>"; }; … … 11824 11824 935207BD09BD410A00F2038D /* LocalizedStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedStrings.h; sourceTree = "<group>"; }; 11825 11825 9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollViewMac.mm; sourceTree = "<group>"; }; 11826 935424272703BC88005CA72C /* FileSystemHandleIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemHandleIdentifier.h; sourceTree = "<group>"; }; 11827 935424292703BCAD005CA72C /* FileSystemStorageConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemStorageConnection.h; sourceTree = "<group>"; }; 11826 11828 9355EF4F253A4278006FF4A4 /* JSAbstractRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAbstractRange.h; sourceTree = "<group>"; }; 11827 11829 9355EF50253A4279006FF4A4 /* JSAbstractRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAbstractRange.cpp; sourceTree = "<group>"; }; … … 23381 23383 932C9BDA26DD62610053B3DB /* FileSystemHandle.h */, 23382 23384 932C9BD926DD62600053B3DB /* FileSystemHandle.idl */, 23383 931A075826F1B44F004474CD /* FileSystemHandleImpl.h */, 23385 935424272703BC88005CA72C /* FileSystemHandleIdentifier.h */, 23386 935424292703BCAD005CA72C /* FileSystemStorageConnection.h */, 23384 23387 93443E7B26E8A6BC0058538F /* StorageManager+FileSystemAccess.idl */, 23385 23388 93443E7D26E8A6BC0058538F /* StorageManagerFileSystemAccess.h */, … … 32487 32490 93443E8726E995C00058538F /* FileSystemFileHandle.h in Headers */, 32488 32491 93443E8826E995C40058538F /* FileSystemHandle.h in Headers */, 32489 9312BAD926F3AC9A00FDDF5F /* FileSystemHandleImpl.h in Headers */, 32492 9354242F2703CA51005CA72C /* FileSystemHandleIdentifier.h in Headers */, 32493 935424302703CB86005CA72C /* FileSystemStorageConnection.h in Headers */, 32490 32494 BC5EB69F0E81DAEB00B25965 /* FillLayer.h in Headers */, 32491 32495 712BE4831FE865DD002031CC /* FillMode.h in Headers */, -
trunk/Source/WebKit/ChangeLog
r283253 r283271 1 2021-09-29 Sihui Liu <sihui_liu@apple.com> 2 3 Replace FileSystemHandleImpl with FileSystemStorageConnection 4 https://bugs.webkit.org/show_bug.cgi?id=230861 5 <rdar://problem/83606465> 6 7 Reviewed by Youenn Fablet. 8 9 Replace FileSystemStorageHandleProxy with WebFileSystemStorageConnection. 10 11 * NetworkProcess/storage/FileSystemStorageHandle.cpp: 12 (WebKit::FileSystemStorageHandle::FileSystemStorageHandle): 13 (WebKit::FileSystemStorageHandle::isSameEntry): 14 (WebKit::FileSystemStorageHandle::requestCreateHandle): 15 (WebKit::FileSystemStorageHandle::getFileHandle): 16 (WebKit::FileSystemStorageHandle::getDirectoryHandle): 17 (WebKit::FileSystemStorageHandle::resolve): 18 * NetworkProcess/storage/FileSystemStorageHandle.h: 19 (WebKit::FileSystemStorageHandle::identifier const): 20 * NetworkProcess/storage/FileSystemStorageHandleRegistry.cpp: 21 (WebKit::FileSystemStorageHandleRegistry::registerHandle): 22 (WebKit::FileSystemStorageHandleRegistry::unregisterHandle): 23 (WebKit::FileSystemStorageHandleRegistry::getHandle): 24 * NetworkProcess/storage/FileSystemStorageHandleRegistry.h: 25 * NetworkProcess/storage/FileSystemStorageManager.cpp: 26 (WebKit::FileSystemStorageManager::createHandle): 27 (WebKit::FileSystemStorageManager::getPath): 28 (WebKit::FileSystemStorageManager::getDirectory): 29 * NetworkProcess/storage/FileSystemStorageManager.h: 30 * NetworkProcess/storage/NetworkStorageManager.cpp: 31 (WebKit::NetworkStorageManager::fileSystemGetDirectory): 32 (WebKit::NetworkStorageManager::isSameEntry): 33 (WebKit::NetworkStorageManager::getFileHandle): 34 (WebKit::NetworkStorageManager::getDirectoryHandle): 35 (WebKit::NetworkStorageManager::removeEntry): 36 (WebKit::NetworkStorageManager::resolve): 37 * NetworkProcess/storage/NetworkStorageManager.h: 38 * NetworkProcess/storage/NetworkStorageManager.messages.in: 39 * NetworkProcess/storage/OriginStorageManager.h: 40 * Scripts/webkit/messages.py: 41 (types_that_cannot_be_forward_declared): 42 * Sources.txt: 43 * WebKit.xcodeproj/project.pbxproj: 44 * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp: Renamed from Source/WebKit/WebProcess/WebCoreSupport/FileSystemStorageHandleProxy.cpp. 45 (WebKit::WebFileSystemStorageConnection::create): 46 (WebKit::WebFileSystemStorageConnection::WebFileSystemStorageConnection): 47 (WebKit::WebFileSystemStorageConnection::connectionClosed): 48 (WebKit::WebFileSystemStorageConnection::isSameEntry): 49 (WebKit::WebFileSystemStorageConnection::getFileHandle): 50 (WebKit::WebFileSystemStorageConnection::getDirectoryHandle): 51 (WebKit::WebFileSystemStorageConnection::removeEntry): 52 (WebKit::WebFileSystemStorageConnection::resolve): 53 * WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h: Renamed from Source/WebKit/WebProcess/WebCoreSupport/FileSystemStorageHandleProxy.h. 54 * WebProcess/WebCoreSupport/WebStorageConnection.cpp: 55 (WebKit::WebStorageConnection::persist): 56 (WebKit::WebStorageConnection::fileSystemGetDirectory): 57 * WebProcess/WebProcess.cpp: 58 (WebKit::WebProcess::networkProcessConnectionClosed): 59 (WebKit::WebProcess::fileSystemStorageConnection): 60 * WebProcess/WebProcess.h: 61 1 62 2021-09-29 Per Arne <pvollan@apple.com> 2 63 -
trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.cpp
r283029 r283271 39 39 40 40 FileSystemStorageHandle::FileSystemStorageHandle(FileSystemStorageManager& manager, Type type, String&& path, String&& name) 41 : m_identifier( FileSystemStorageHandleIdentifier::generateThreadSafe())41 : m_identifier(WebCore::FileSystemHandleIdentifier::generateThreadSafe()) 42 42 , m_manager(makeWeakPtr(manager)) 43 43 , m_type(type) … … 59 59 } 60 60 61 bool FileSystemStorageHandle::isSameEntry( FileSystemStorageHandleIdentifier identifier)61 bool FileSystemStorageHandle::isSameEntry(WebCore::FileSystemHandleIdentifier identifier) 62 62 { 63 63 auto path = m_manager->getPath(identifier); … … 68 68 } 69 69 70 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::requestCreateHandle(IPC::Connection::UniqueID connection, Type type, String&& name, bool createIfNecessary)70 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::requestCreateHandle(IPC::Connection::UniqueID connection, Type type, String&& name, bool createIfNecessary) 71 71 { 72 72 if (m_type != FileSystemStorageHandle::Type::Directory) … … 84 84 } 85 85 86 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::getFileHandle(IPC::Connection::UniqueID connection, String&& name, bool createIfNecessary)86 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::getFileHandle(IPC::Connection::UniqueID connection, String&& name, bool createIfNecessary) 87 87 { 88 88 return requestCreateHandle(connection, FileSystemStorageHandle::Type::File, WTFMove(name), createIfNecessary); 89 89 } 90 90 91 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::getDirectoryHandle(IPC::Connection::UniqueID connection, String&& name, bool createIfNecessary)91 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> FileSystemStorageHandle::getDirectoryHandle(IPC::Connection::UniqueID connection, String&& name, bool createIfNecessary) 92 92 { 93 93 return requestCreateHandle(connection, FileSystemStorageHandle::Type::Directory, WTFMove(name), createIfNecessary); … … 124 124 } 125 125 126 Expected<Vector<String>, FileSystemStorageError> FileSystemStorageHandle::resolve( FileSystemStorageHandleIdentifier identifier)126 Expected<Vector<String>, FileSystemStorageError> FileSystemStorageHandle::resolve(WebCore::FileSystemHandleIdentifier identifier) 127 127 { 128 128 if (!m_manager) -
trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandle.h
r283029 r283271 27 27 28 28 #include "Connection.h" 29 #include "FileSystemStorageHandleIdentifier.h" 30 29 #include <WebCore/FileSystemHandleIdentifier.h> 31 30 #include <wtf/WeakPtr.h> 32 31 … … 42 41 FileSystemStorageHandle(FileSystemStorageManager&, Type, String&& path, String&& name); 43 42 44 FileSystemStorageHandleIdentifier identifier() const { return m_identifier; }43 WebCore::FileSystemHandleIdentifier identifier() const { return m_identifier; } 45 44 const String& path() const { return m_path; } 46 45 47 bool isSameEntry( FileSystemStorageHandleIdentifier);48 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> getFileHandle(IPC::Connection::UniqueID, String&& name, bool createIfNecessary);49 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> getDirectoryHandle(IPC::Connection::UniqueID, String&& name, bool createIfNecessary);46 bool isSameEntry(WebCore::FileSystemHandleIdentifier); 47 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> getFileHandle(IPC::Connection::UniqueID, String&& name, bool createIfNecessary); 48 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> getDirectoryHandle(IPC::Connection::UniqueID, String&& name, bool createIfNecessary); 50 49 std::optional<FileSystemStorageError> removeEntry(const String& name, bool deleteRecursively); 51 Expected<Vector<String>, FileSystemStorageError> resolve( FileSystemStorageHandleIdentifier);50 Expected<Vector<String>, FileSystemStorageError> resolve(WebCore::FileSystemHandleIdentifier); 52 51 53 52 private: 54 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> requestCreateHandle(IPC::Connection::UniqueID, Type, String&& name, bool createIfNecessary);53 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> requestCreateHandle(IPC::Connection::UniqueID, Type, String&& name, bool createIfNecessary); 55 54 56 FileSystemStorageHandleIdentifier m_identifier;55 WebCore::FileSystemHandleIdentifier m_identifier; 57 56 WeakPtr<FileSystemStorageManager> m_manager; 58 57 Type m_type; -
trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandleRegistry.cpp
r283069 r283271 33 33 FileSystemStorageHandleRegistry::FileSystemStorageHandleRegistry() = default; 34 34 35 void FileSystemStorageHandleRegistry::registerHandle( FileSystemStorageHandleIdentifier identifier, FileSystemStorageHandle& handle)35 void FileSystemStorageHandleRegistry::registerHandle(WebCore::FileSystemHandleIdentifier identifier, FileSystemStorageHandle& handle) 36 36 { 37 37 ASSERT(!m_handles.contains(identifier)); … … 40 40 } 41 41 42 void FileSystemStorageHandleRegistry::unregisterHandle( FileSystemStorageHandleIdentifier identifier)42 void FileSystemStorageHandleRegistry::unregisterHandle(WebCore::FileSystemHandleIdentifier identifier) 43 43 { 44 44 ASSERT(m_handles.contains(identifier)); … … 47 47 } 48 48 49 FileSystemStorageHandle* FileSystemStorageHandleRegistry::getHandle( FileSystemStorageHandleIdentifier identifier)49 FileSystemStorageHandle* FileSystemStorageHandleRegistry::getHandle(WebCore::FileSystemHandleIdentifier identifier) 50 50 { 51 51 if (auto handle = m_handles.get(identifier)) -
trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageHandleRegistry.h
r283029 r283271 27 27 28 28 #include "Connection.h" 29 #include "FileSystemStorageHandleIdentifier.h"29 #include <WebCore/FileSystemHandleIdentifier.h> 30 30 #include <wtf/WeakPtr.h> 31 31 … … 38 38 public: 39 39 FileSystemStorageHandleRegistry(); 40 void registerHandle( FileSystemStorageHandleIdentifier, FileSystemStorageHandle&);41 void unregisterHandle( FileSystemStorageHandleIdentifier);42 FileSystemStorageHandle* getHandle( FileSystemStorageHandleIdentifier);40 void registerHandle(WebCore::FileSystemHandleIdentifier, FileSystemStorageHandle&); 41 void unregisterHandle(WebCore::FileSystemHandleIdentifier); 42 FileSystemStorageHandle* getHandle(WebCore::FileSystemHandleIdentifier); 43 43 44 44 private: 45 HashMap< FileSystemStorageHandleIdentifier, WeakPtr<FileSystemStorageHandle>> m_handles;45 HashMap<WebCore::FileSystemHandleIdentifier, WeakPtr<FileSystemStorageHandle>> m_handles; 46 46 }; 47 47 -
trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageManager.cpp
r283069 r283271 47 47 } 48 48 49 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> FileSystemStorageManager::createHandle(IPC::Connection::UniqueID connection, FileSystemStorageHandle::Type type, String&& path, String&& name, bool createIfNecessary)49 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> FileSystemStorageManager::createHandle(IPC::Connection::UniqueID connection, FileSystemStorageHandle::Type type, String&& path, String&& name, bool createIfNecessary) 50 50 { 51 51 ASSERT(!RunLoop::isMain()); … … 71 71 auto newHandleIdentifier = newHandle->identifier(); 72 72 m_handlesByConnection.ensure(connection, [&] { 73 return HashSet< FileSystemStorageHandleIdentifier> { };73 return HashSet<WebCore::FileSystemHandleIdentifier> { }; 74 74 }).iterator->value.add(newHandleIdentifier); 75 75 m_registry.registerHandle(newHandleIdentifier, *newHandle); … … 78 78 } 79 79 80 const String& FileSystemStorageManager::getPath( FileSystemStorageHandleIdentifier identifier)80 const String& FileSystemStorageManager::getPath(WebCore::FileSystemHandleIdentifier identifier) 81 81 { 82 82 auto handle = m_handles.find(identifier); … … 99 99 } 100 100 101 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> FileSystemStorageManager::getDirectory(IPC::Connection::UniqueID connection)101 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> FileSystemStorageManager::getDirectory(IPC::Connection::UniqueID connection) 102 102 { 103 103 ASSERT(!RunLoop::isMain()); -
trunk/Source/WebKit/NetworkProcess/storage/FileSystemStorageManager.h
r283029 r283271 27 27 28 28 #include "FileSystemStorageHandle.h" 29 #include "FileSystemStorageHandleIdentifier.h"29 #include <WebCore/FileSystemHandleIdentifier.h> 30 30 31 31 namespace WebKit { … … 40 40 ~FileSystemStorageManager(); 41 41 42 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> createHandle(IPC::Connection::UniqueID, FileSystemStorageHandle::Type, String&& path, String&& name, bool createIfNecessary);43 const String& getPath( FileSystemStorageHandleIdentifier);42 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> createHandle(IPC::Connection::UniqueID, FileSystemStorageHandle::Type, String&& path, String&& name, bool createIfNecessary); 43 const String& getPath(WebCore::FileSystemHandleIdentifier); 44 44 void connectionClosed(IPC::Connection::UniqueID); 45 Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError> getDirectory(IPC::Connection::UniqueID);45 Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError> getDirectory(IPC::Connection::UniqueID); 46 46 47 47 private: 48 48 String m_path; 49 49 FileSystemStorageHandleRegistry& m_registry; 50 HashMap<IPC::Connection::UniqueID, HashSet< FileSystemStorageHandleIdentifier>> m_handlesByConnection;51 HashMap< FileSystemStorageHandleIdentifier, std::unique_ptr<FileSystemStorageHandle>> m_handles;50 HashMap<IPC::Connection::UniqueID, HashSet<WebCore::FileSystemHandleIdentifier>> m_handlesByConnection; 51 HashMap<WebCore::FileSystemHandleIdentifier, std::unique_ptr<FileSystemStorageHandle>> m_handles; 52 52 }; 53 53 -
trunk/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.cpp
r283029 r283271 165 165 } 166 166 167 void NetworkStorageManager::fileSystemGetDirectory(IPC::Connection& connection, const WebCore::ClientOrigin& origin, CompletionHandler<void(Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError>)>&& completionHandler)167 void NetworkStorageManager::fileSystemGetDirectory(IPC::Connection& connection, const WebCore::ClientOrigin& origin, CompletionHandler<void(Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError>)>&& completionHandler) 168 168 { 169 169 ASSERT(!RunLoop::isMain()); … … 172 172 } 173 173 174 void NetworkStorageManager::isSameEntry( FileSystemStorageHandleIdentifier identifier, FileSystemStorageHandleIdentifier targetIdentifier, CompletionHandler<void(bool)>&& completionHandler)174 void NetworkStorageManager::isSameEntry(WebCore::FileSystemHandleIdentifier identifier, WebCore::FileSystemHandleIdentifier targetIdentifier, CompletionHandler<void(bool)>&& completionHandler) 175 175 { 176 176 ASSERT(!RunLoop::isMain()); … … 183 183 } 184 184 185 void NetworkStorageManager::getFileHandle(IPC::Connection& connection, FileSystemStorageHandleIdentifier identifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<FileSystemStorageHandleIdentifier, FileSystemStorageError>)>&& completionHandler)185 void NetworkStorageManager::getFileHandle(IPC::Connection& connection, WebCore::FileSystemHandleIdentifier identifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError>)>&& completionHandler) 186 186 { 187 187 ASSERT(!RunLoop::isMain()); … … 194 194 } 195 195 196 void NetworkStorageManager::getDirectoryHandle(IPC::Connection& connection, FileSystemStorageHandleIdentifier identifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<FileSystemStorageHandleIdentifier, FileSystemStorageError>)>&& completionHandler)196 void NetworkStorageManager::getDirectoryHandle(IPC::Connection& connection, WebCore::FileSystemHandleIdentifier identifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError>)>&& completionHandler) 197 197 { 198 198 ASSERT(!RunLoop::isMain()); … … 205 205 } 206 206 207 void NetworkStorageManager::removeEntry( FileSystemStorageHandleIdentifier identifier, const String& name, bool deleteRecursively, CompletionHandler<void(std::optional<FileSystemStorageError>)>&& completionHandler)207 void NetworkStorageManager::removeEntry(WebCore::FileSystemHandleIdentifier identifier, const String& name, bool deleteRecursively, CompletionHandler<void(std::optional<FileSystemStorageError>)>&& completionHandler) 208 208 { 209 209 ASSERT(!RunLoop::isMain()); … … 216 216 } 217 217 218 void NetworkStorageManager::resolve( FileSystemStorageHandleIdentifier identifier, FileSystemStorageHandleIdentifier targetIdentifier, CompletionHandler<void(Expected<Vector<String>, FileSystemStorageError>)>&& completionHandler)218 void NetworkStorageManager::resolve(WebCore::FileSystemHandleIdentifier identifier, WebCore::FileSystemHandleIdentifier targetIdentifier, CompletionHandler<void(Expected<Vector<String>, FileSystemStorageError>)>&& completionHandler) 219 219 { 220 220 ASSERT(!RunLoop::isMain()); -
trunk/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.h
r283029 r283271 28 28 #include "Connection.h" 29 29 #include "FileSystemStorageError.h" 30 #include "FileSystemStorageHandleIdentifier.h"31 30 #include "OriginStorageManager.h" 32 31 #include <WebCore/ClientOrigin.h> 32 #include <WebCore/FileSystemHandleIdentifier.h> 33 33 #include <pal/SessionID.h> 34 34 … … 64 64 void persisted(const WebCore::ClientOrigin&, CompletionHandler<void(bool)>&&); 65 65 void persist(const WebCore::ClientOrigin&, CompletionHandler<void(bool)>&&); 66 void fileSystemGetDirectory(IPC::Connection&, const WebCore::ClientOrigin&, CompletionHandler<void(Expected< FileSystemStorageHandleIdentifier, FileSystemStorageError>)>&&);67 void isSameEntry( FileSystemStorageHandleIdentifier, FileSystemStorageHandleIdentifier, CompletionHandler<void(bool)>&&);68 void getFileHandle(IPC::Connection&, FileSystemStorageHandleIdentifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<FileSystemStorageHandleIdentifier, FileSystemStorageError>)>&&);69 void getDirectoryHandle(IPC::Connection&, FileSystemStorageHandleIdentifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<FileSystemStorageHandleIdentifier, FileSystemStorageError>)>&&);70 void removeEntry( FileSystemStorageHandleIdentifier, const String& name, bool deleteRecursively, CompletionHandler<void(std::optional<FileSystemStorageError>)>&&);71 void resolve( FileSystemStorageHandleIdentifier, FileSystemStorageHandleIdentifier, CompletionHandler<void(Expected<Vector<String>, FileSystemStorageError>)>&&);66 void fileSystemGetDirectory(IPC::Connection&, const WebCore::ClientOrigin&, CompletionHandler<void(Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError>)>&&); 67 void isSameEntry(WebCore::FileSystemHandleIdentifier, WebCore::FileSystemHandleIdentifier, CompletionHandler<void(bool)>&&); 68 void getFileHandle(IPC::Connection&, WebCore::FileSystemHandleIdentifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError>)>&&); 69 void getDirectoryHandle(IPC::Connection&, WebCore::FileSystemHandleIdentifier, String&& name, bool createIfNecessary, CompletionHandler<void(Expected<WebCore::FileSystemHandleIdentifier, FileSystemStorageError>)>&&); 70 void removeEntry(WebCore::FileSystemHandleIdentifier, const String& name, bool deleteRecursively, CompletionHandler<void(std::optional<FileSystemStorageError>)>&&); 71 void resolve(WebCore::FileSystemHandleIdentifier, WebCore::FileSystemHandleIdentifier, CompletionHandler<void(Expected<Vector<String>, FileSystemStorageError>)>&&); 72 72 73 73 PAL::SessionID m_sessionID; -
trunk/Source/WebKit/NetworkProcess/storage/NetworkStorageManager.messages.in
r283029 r283271 27 27 Persisted(struct WebCore::ClientOrigin origin) -> (bool persisted) Async 28 28 Persist(struct WebCore::ClientOrigin origin) -> (bool persisted) Async 29 FileSystemGetDirectory(struct WebCore::ClientOrigin origin) -> (Expected<Web Kit::FileSystemStorageHandleIdentifier, WebKit::FileSystemStorageError> result) Async WantsConnection30 IsSameEntry(Web Kit::FileSystemStorageHandleIdentifier identifier, WebKit::FileSystemStorageHandleIdentifier targetIdentifier) -> (bool result) Async31 GetFileHandle(Web Kit::FileSystemStorageHandleIdentifier identifier, String name, bool createIfNecessary) -> (Expected<WebKit::FileSystemStorageHandleIdentifier, WebKit::FileSystemStorageError> result) Async WantsConnection32 GetDirectoryHandle(Web Kit::FileSystemStorageHandleIdentifier identifier, String name, bool createIfNecessary) -> (Expected<WebKit::FileSystemStorageHandleIdentifier, WebKit::FileSystemStorageError> result) Async WantsConnection33 RemoveEntry(Web Kit::FileSystemStorageHandleIdentifier identifier, String name, bool deleteRecursively) -> (std::optional<WebKit::FileSystemStorageError> result) Async34 Resolve(Web Kit::FileSystemStorageHandleIdentifier identifier, WebKit::FileSystemStorageHandleIdentifier targetIdentifier) -> (Expected<Vector<String>, WebKit::FileSystemStorageError> result) Async29 FileSystemGetDirectory(struct WebCore::ClientOrigin origin) -> (Expected<WebCore::FileSystemHandleIdentifier, WebKit::FileSystemStorageError> result) Async WantsConnection 30 IsSameEntry(WebCore::FileSystemHandleIdentifier identifier, WebCore::FileSystemHandleIdentifier targetIdentifier) -> (bool result) Async 31 GetFileHandle(WebCore::FileSystemHandleIdentifier identifier, String name, bool createIfNecessary) -> (Expected<WebCore::FileSystemHandleIdentifier, WebKit::FileSystemStorageError> result) Async WantsConnection 32 GetDirectoryHandle(WebCore::FileSystemHandleIdentifier identifier, String name, bool createIfNecessary) -> (Expected<WebCore::FileSystemHandleIdentifier, WebKit::FileSystemStorageError> result) Async WantsConnection 33 RemoveEntry(WebCore::FileSystemHandleIdentifier identifier, String name, bool deleteRecursively) -> (std::optional<WebKit::FileSystemStorageError> result) Async 34 Resolve(WebCore::FileSystemHandleIdentifier identifier, WebCore::FileSystemHandleIdentifier targetIdentifier) -> (Expected<Vector<String>, WebKit::FileSystemStorageError> result) Async 35 35 } -
trunk/Source/WebKit/NetworkProcess/storage/OriginStorageManager.h
r283069 r283271 27 27 28 28 #include "Connection.h" 29 #include "FileSystemStorageHandleIdentifier.h"30 29 #include <wtf/text/WTFString.h> 31 30 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r283179 r283271 282 282 'WebCore::DragApplicationFlags', 283 283 'WebCore::FetchIdentifier', 284 'WebCore::FileSystemHandleIdentifier', 284 285 'WebCore::FrameIdentifier', 285 286 'WebCore::GraphicsContextGLAttributes', … … 318 319 'WebKit::DownloadID', 319 320 'WebKit::FileSystemStorageError', 320 'WebKit::FileSystemStorageHandleIdentifier',321 321 'WebKit::FormSubmitListenerIdentifier', 322 322 'WebKit::GeolocationIdentifier', -
trunk/Source/WebKit/Sources.txt
r283029 r283271 696 696 WebProcess/WebAuthentication/WebAuthnProcessConnection.cpp 697 697 698 WebProcess/WebCoreSupport/FileSystemStorageHandleProxy.cpp699 698 WebProcess/WebCoreSupport/SessionStateConversion.cpp 700 699 WebProcess/WebCoreSupport/ShareableBitmapUtilities.cpp … … 708 707 WebProcess/WebCoreSupport/WebDragClient.cpp 709 708 WebProcess/WebCoreSupport/WebEditorClient.cpp 709 WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp 710 710 WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 711 711 WebProcess/WebCoreSupport/WebGeolocationClient.cpp -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r283119 r283271 1486 1486 9342589A255B535A0059EEDD /* MediaPermissionUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 93425898255B534B0059EEDD /* MediaPermissionUtilities.h */; }; 1487 1487 934B724419F5B9BE00AE96D6 /* WKActionMenuItemTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 934B724319F5B9BE00AE96D6 /* WKActionMenuItemTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1488 9354242C2703BDCB005CA72C /* WebFileSystemStorageConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9354242A2703BDCB005CA72C /* WebFileSystemStorageConnection.h */; }; 1488 1489 9356F2DC2152B6B500E6D5DF /* WebSWClientConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A53021F4793B200DCDC0A /* WebSWClientConnection.h */; }; 1489 1490 9356F2DD2152B6F600E6D5DF /* WebSWServerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 93BA04E02151ADF4007F455F /* WebSWServerConnection.h */; }; … … 4943 4944 931A075226F06AB4004474CD /* FileSystemStorageHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemStorageHandle.cpp; sourceTree = "<group>"; }; 4944 4945 931A075326F06AB4004474CD /* FileSystemStorageHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemStorageHandle.h; sourceTree = "<group>"; }; 4945 931A075726F125A3004474CD /* FileSystemStorageHandleIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemStorageHandleIdentifier.h; sourceTree = "<group>"; };4946 931A075926F1B967004474CD /* FileSystemStorageHandleProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemStorageHandleProxy.cpp; sourceTree = "<group>"; };4947 931A075A26F1B968004474CD /* FileSystemStorageHandleProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemStorageHandleProxy.h; sourceTree = "<group>"; };4948 4946 931A1BE026F85C320081A7E5 /* FileSystemStorageError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemStorageError.h; sourceTree = "<group>"; }; 4949 4947 9321D5851A38EE3C008052BE /* WKImmediateActionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKImmediateActionController.h; sourceTree = "<group>"; }; … … 4961 4959 93425898255B534B0059EEDD /* MediaPermissionUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPermissionUtilities.h; sourceTree = "<group>"; }; 4962 4960 934B724319F5B9BE00AE96D6 /* WKActionMenuItemTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKActionMenuItemTypes.h; sourceTree = "<group>"; }; 4961 9354242A2703BDCB005CA72C /* WebFileSystemStorageConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFileSystemStorageConnection.h; sourceTree = "<group>"; }; 4962 9354242B2703BDCB005CA72C /* WebFileSystemStorageConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFileSystemStorageConnection.cpp; sourceTree = "<group>"; }; 4963 4963 935B579826F51270008B48AC /* FileSystemStorageHandleRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileSystemStorageHandleRegistry.h; sourceTree = "<group>"; }; 4964 4964 935B579926F5192F008B48AC /* FileSystemStorageHandleRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemStorageHandleRegistry.cpp; sourceTree = "<group>"; }; … … 9755 9755 931A075226F06AB4004474CD /* FileSystemStorageHandle.cpp */, 9756 9756 931A075326F06AB4004474CD /* FileSystemStorageHandle.h */, 9757 931A075726F125A3004474CD /* FileSystemStorageHandleIdentifier.h */,9758 9757 935B579926F5192F008B48AC /* FileSystemStorageHandleRegistry.cpp */, 9759 9758 935B579826F51270008B48AC /* FileSystemStorageHandleRegistry.h */, … … 10075 10074 2D28F3DF1885CCB4004B9EAE /* ios */, 10076 10075 BC111ADE112F5B9A00337BAB /* mac */, 10077 931A075926F1B967004474CD /* FileSystemStorageHandleProxy.cpp */,10078 931A075A26F1B968004474CD /* FileSystemStorageHandleProxy.h */,10079 10076 1A7284441959ED100007BCE5 /* SessionStateConversion.cpp */, 10080 10077 1A7284451959ED100007BCE5 /* SessionStateConversion.h */, … … 10102 10099 BC111A57112F4FBB00337BAB /* WebEditorClient.cpp */, 10103 10100 BC032D6810F4378D0058C15A /* WebEditorClient.h */, 10101 9354242B2703BDCB005CA72C /* WebFileSystemStorageConnection.cpp */, 10102 9354242A2703BDCB005CA72C /* WebFileSystemStorageConnection.h */, 10104 10103 BC111A58112F4FBB00337BAB /* WebFrameLoaderClient.cpp */, 10105 10104 BC032D6A10F4378D0058C15A /* WebFrameLoaderClient.h */, … … 12785 12784 BC032DBB10F4380F0058C15A /* WebEventConversion.h in Headers */, 12786 12785 BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */, 12786 9354242C2703BDCB005CA72C /* WebFileSystemStorageConnection.h in Headers */, 12787 12787 1A90C1EE1264FD50003E44D4 /* WebFindOptions.h in Headers */, 12788 12788 BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */, -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFileSystemStorageConnection.cpp
r283270 r283271 25 25 26 26 #include "config.h" 27 #include " FileSystemStorageHandleProxy.h"27 #include "WebFileSystemStorageConnection.h" 28 28 29 29 #include "FileSystemStorageError.h" … … 35 35 namespace WebKit { 36 36 37 Ref< FileSystemStorageHandleProxy> FileSystemStorageHandleProxy::create(FileSystemStorageHandleIdentifier identifier,IPC::Connection& connection)37 Ref<WebFileSystemStorageConnection> WebFileSystemStorageConnection::create(IPC::Connection& connection) 38 38 { 39 return adoptRef(*new FileSystemStorageHandleProxy(identifier,connection));39 return adoptRef(*new WebFileSystemStorageConnection(connection)); 40 40 } 41 41 42 FileSystemStorageHandleProxy::FileSystemStorageHandleProxy(FileSystemStorageHandleIdentifier identifier, IPC::Connection& connection) 43 : m_identifier(identifier) 44 , m_connection(&connection) 42 WebFileSystemStorageConnection::WebFileSystemStorageConnection(IPC::Connection& connection) 43 : m_connection(&connection) 45 44 { 46 45 } 47 46 48 void FileSystemStorageHandleProxy::connectionClosed()47 void WebFileSystemStorageConnection::connectionClosed() 49 48 { 50 49 m_connection = nullptr; 51 50 } 52 51 53 void FileSystemStorageHandleProxy::isSameEntry(FileSystemHandleImpl& handle, CompletionHandler<void(WebCore::ExceptionOr<bool>&&)>&& completionHandler)52 void WebFileSystemStorageConnection::isSameEntry(WebCore::FileSystemHandleIdentifier identifier, WebCore::FileSystemHandleIdentifier otherIdentifier, WebCore::FileSystemStorageConnection::SameEntryCallback&& completionHandler) 54 53 { 55 54 if (!m_connection) 56 55 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost" }); 57 56 58 auto identifier = handle.storageHandleIdentifier(); 59 if (!identifier) 60 return completionHandler(false); 61 62 if (m_identifier.toUInt64() == *identifier) 57 if (identifier == otherIdentifier) 63 58 return completionHandler(true); 64 59 65 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::IsSameEntry(m_identifier, makeObjectIdentifier<FileSystemStorageHandleIdentifierType>(*identifier)), [completionHandler = WTFMove(completionHandler)](bool result) mutable { 66 completionHandler(result); 67 }); 60 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::IsSameEntry(identifier, otherIdentifier), WTFMove(completionHandler)); 68 61 } 69 62 70 void FileSystemStorageHandleProxy::getFileHandle(const String& name, bool createIfNecessary, CompletionHandler<void(WebCore::ExceptionOr<Ref<WebCore::FileSystemHandleImpl>>&&)>&& completionHandler)63 void WebFileSystemStorageConnection::getFileHandle(WebCore::FileSystemHandleIdentifier identifier, const String& name, bool createIfNecessary, WebCore::FileSystemStorageConnection::GetHandleCallback&& completionHandler) 71 64 { 72 65 if (!m_connection) 73 66 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost" }); 74 67 75 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::GetFileHandle( m_identifier, name, createIfNecessary), [connection = m_connection,name, completionHandler = WTFMove(completionHandler)](auto result) mutable {68 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::GetFileHandle(identifier, name, createIfNecessary), [name, completionHandler = WTFMove(completionHandler)](auto result) mutable { 76 69 if (!result) 77 70 return completionHandler(WebCore::Exception { convertToExceptionCode(result.error()) }); 78 79 auto handleIdentifier = result.value();80 if (! handleIdentifier.isValid())71 72 auto identifier = result.value(); 73 if (!identifier.isValid()) 81 74 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost"_s }); 82 75 83 Ref<WebCore::FileSystemHandleImpl> impl = FileSystemStorageHandleProxy::create(handleIdentifier, *connection); 84 completionHandler(WTFMove(impl)); 76 completionHandler(WTFMove(identifier)); 85 77 }); 86 78 } 87 79 88 void FileSystemStorageHandleProxy::getDirectoryHandle(const String& name, bool createIfNecessary, CompletionHandler<void(WebCore::ExceptionOr<Ref<WebCore::FileSystemHandleImpl>>&&)>&& completionHandler)80 void WebFileSystemStorageConnection::getDirectoryHandle(WebCore::FileSystemHandleIdentifier identifier, const String& name, bool createIfNecessary, WebCore::FileSystemStorageConnection::GetHandleCallback&& completionHandler) 89 81 { 90 82 if (!m_connection) 91 83 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost" }); 92 84 93 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::GetDirectoryHandle( m_identifier, name, createIfNecessary), [connection = m_connection,name, completionHandler = WTFMove(completionHandler)](auto result) mutable {85 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::GetDirectoryHandle(identifier, name, createIfNecessary), [name, completionHandler = WTFMove(completionHandler)](auto result) mutable { 94 86 if (!result) 95 87 return completionHandler(WebCore::Exception { convertToExceptionCode(result.error()) }); 96 97 auto handleIdentifier = result.value();98 if (! handleIdentifier.isValid())88 89 auto identifier = result.value(); 90 if (!identifier.isValid()) 99 91 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost"_s }); 100 92 101 Ref<WebCore::FileSystemHandleImpl> impl = FileSystemStorageHandleProxy::create(handleIdentifier, *connection); 102 completionHandler(WTFMove(impl)); 93 completionHandler(WTFMove(identifier)); 103 94 }); 104 95 } 105 96 106 void FileSystemStorageHandleProxy::removeEntry(const String& name, bool deleteRecursively, CompletionHandler<void(WebCore::ExceptionOr<void>&&)>&& completionHandler)97 void WebFileSystemStorageConnection::removeEntry(WebCore::FileSystemHandleIdentifier identifier, const String& name, bool deleteRecursively, WebCore::FileSystemStorageConnection::RemoveEntryCallback&& completionHandler) 107 98 { 108 99 if (!m_connection) 109 100 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost" }); 110 101 111 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::RemoveEntry( m_identifier, name, deleteRecursively), [completionHandler = WTFMove(completionHandler)](auto error) mutable {102 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::RemoveEntry(identifier, name, deleteRecursively), [completionHandler = WTFMove(completionHandler)](auto error) mutable { 112 103 if (error) 113 104 return completionHandler(WebCore::Exception { convertToExceptionCode(error.value()) }); … … 117 108 } 118 109 119 void FileSystemStorageHandleProxy::resolve(FileSystemHandleImpl& handle, CompletionHandler<void(WebCore::ExceptionOr<Vector<String>>&&)>&& completionHandler)110 void WebFileSystemStorageConnection::resolve(WebCore::FileSystemHandleIdentifier identifier, WebCore::FileSystemHandleIdentifier otherIdentifier, WebCore::FileSystemStorageConnection::ResolveCallback&& completionHandler) 120 111 { 121 112 if (!m_connection) 122 113 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost" }); 123 114 124 auto identifier = handle.storageHandleIdentifier(); 125 if (!identifier) 126 return completionHandler(Vector<String> { }); 127 128 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::Resolve(m_identifier, makeObjectIdentifier<FileSystemStorageHandleIdentifierType>(*identifier)), [completionHandler = WTFMove(completionHandler)](auto result) mutable { 115 m_connection->sendWithAsyncReply(Messages::NetworkStorageManager::Resolve(identifier, otherIdentifier), [completionHandler = WTFMove(completionHandler)](auto result) mutable { 129 116 if (!result) 130 117 return completionHandler(WebCore::Exception { convertToExceptionCode(result.error()) }); … … 135 122 136 123 } // namespace WebKit 137 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFileSystemStorageConnection.h
r283270 r283271 26 26 #pragma once 27 27 28 #include "FileSystemStorageHandleIdentifier.h" 29 #include <WebCore/FileSystemHandleImpl.h> 28 #include <WebCore/FileSystemStorageConnection.h> 30 29 31 30 namespace IPC { … … 41 40 namespace WebKit { 42 41 43 class FileSystemStorageHandleProxy final : public WebCore::FileSystemHandleImpl{42 class WebFileSystemStorageConnection final : public WebCore::FileSystemStorageConnection { 44 43 public: 45 static Ref< FileSystemStorageHandleProxy> create(FileSystemStorageHandleIdentifier,IPC::Connection&);44 static Ref<WebFileSystemStorageConnection> create(IPC::Connection&); 46 45 void connectionClosed(); 47 46 48 47 private: 49 FileSystemStorageHandleProxy(FileSystemStorageHandleIdentifier,IPC::Connection&);48 explicit WebFileSystemStorageConnection(IPC::Connection&); 50 49 51 // FileSystemHandleImpl 52 std::optional<uint64_t> storageHandleIdentifier() { return m_identifier.toUInt64(); } 53 void isSameEntry(FileSystemHandleImpl&, CompletionHandler<void(WebCore::ExceptionOr<bool>&&)>&&) final; 54 void getFileHandle(const String& name, bool createIfNecessary, CompletionHandler<void(WebCore::ExceptionOr<Ref<WebCore::FileSystemHandleImpl>>&&)>&&) final; 55 void getDirectoryHandle(const String& name, bool createIfNecessary, CompletionHandler<void(WebCore::ExceptionOr<Ref<WebCore::FileSystemHandleImpl>>&&)>&&) final; 56 void removeEntry(const String& name, bool deleteRecursively, CompletionHandler<void(WebCore::ExceptionOr<void>&&)>&&) final; 57 void resolve(FileSystemHandleImpl&, CompletionHandler<void(WebCore::ExceptionOr<Vector<String>>&&)>&&) final; 50 // FileSystemStorageConnection 51 void isSameEntry(WebCore::FileSystemHandleIdentifier, WebCore::FileSystemHandleIdentifier, WebCore::FileSystemStorageConnection::SameEntryCallback&&); 52 void getFileHandle(WebCore::FileSystemHandleIdentifier, const String& name, bool createIfNecessary, WebCore::FileSystemStorageConnection::GetHandleCallback&&); 53 void getDirectoryHandle(WebCore::FileSystemHandleIdentifier, const String& name, bool createIfNecessary, WebCore::FileSystemStorageConnection::GetHandleCallback&&); 54 void removeEntry(WebCore::FileSystemHandleIdentifier, const String& name, bool deleteRecursively, WebCore::FileSystemStorageConnection::RemoveEntryCallback&&); 55 void resolve(WebCore::FileSystemHandleIdentifier, WebCore::FileSystemHandleIdentifier, WebCore::FileSystemStorageConnection::ResolveCallback&&); 58 56 59 FileSystemStorageHandleIdentifier m_identifier;60 57 RefPtr<IPC::Connection> m_connection; 61 58 }; -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebStorageConnection.cpp
r283184 r283271 27 27 #include "WebStorageConnection.h" 28 28 29 #include "FileSystemStorageHandleProxy.h"30 29 #include "NetworkProcessConnection.h" 31 30 #include "NetworkStorageManagerMessages.h" 31 #include "WebFileSystemStorageConnection.h" 32 32 #include "WebProcess.h" 33 33 #include <WebCore/ClientOrigin.h> 34 34 #include <WebCore/ExceptionOr.h> 35 #include <WebCore/FileSystemHandleIdentifier.h> 35 36 36 37 namespace WebKit { … … 46 47 } 47 48 48 void WebStorageConnection::persist(const WebCore::ClientOrigin& origin, CompletionHandler<void(bool)>&& completionHandler)49 void WebStorageConnection::persist(const WebCore::ClientOrigin& origin, StorageConnection::PersistCallback&& completionHandler) 49 50 { 50 51 connection().sendWithAsyncReply(Messages::NetworkStorageManager::Persist(origin), WTFMove(completionHandler)); 51 52 } 52 53 53 void WebStorageConnection::fileSystemGetDirectory(const WebCore::ClientOrigin& origin, CompletionHandler<void(WebCore::ExceptionOr<Ref<WebCore::FileSystemHandleImpl>>&&)>&& completionHandler)54 void WebStorageConnection::fileSystemGetDirectory(const WebCore::ClientOrigin& origin, StorageConnection::GetDirectoryCallback&& completionHandler) 54 55 { 55 56 auto& connection = WebProcess::singleton().ensureNetworkProcessConnection().connection(); 56 connection.sendWithAsyncReply(Messages::NetworkStorageManager::FileSystemGetDirectory(origin), [ weakConnection = makeWeakPtr(connection),completionHandler = WTFMove(completionHandler)](auto result) mutable {57 connection.sendWithAsyncReply(Messages::NetworkStorageManager::FileSystemGetDirectory(origin), [completionHandler = WTFMove(completionHandler)](auto result) mutable { 57 58 if (!result) 58 59 return completionHandler(WebCore::Exception { convertToExceptionCode(result.error()) }); 59 60 60 if (!weakConnection || !result.value().isValid()) 61 auto identifier = result.value(); 62 if (!identifier.isValid()) 61 63 return completionHandler(WebCore::Exception { WebCore::UnknownError, "Connection is lost"_s }); 62 64 63 Ref<WebCore::FileSystemHandleImpl> impl = FileSystemStorageHandleProxy::create(result.value(), *weakConnection);64 return completionHandler( WTFMove(impl));65 auto connection = RefPtr<WebCore::FileSystemStorageConnection> { &WebProcess::singleton().fileSystemStorageConnection() }; 66 return completionHandler(std::pair { identifier, WTFMove(connection) }); 65 67 }); 66 68 } -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r283116 r283271 60 60 #include "WebCookieJar.h" 61 61 #include "WebCoreArgumentCoders.h" 62 #include "WebFileSystemStorageConnection.h" 62 63 #include "WebFrame.h" 63 64 #include "WebFrameNetworkingContext.h" … … 1208 1209 #endif 1209 1210 } 1211 1212 // Recreate a new connection with valid IPC connection on next operation. 1213 if (m_fileSystemStorageConnection) { 1214 m_fileSystemStorageConnection->connectionClosed(); 1215 m_fileSystemStorageConnection = nullptr; 1216 } 1217 } 1218 1219 WebFileSystemStorageConnection& WebProcess::fileSystemStorageConnection() 1220 { 1221 if (!m_fileSystemStorageConnection) 1222 m_fileSystemStorageConnection = WebFileSystemStorageConnection::create(ensureNetworkProcessConnection().connection()); 1223 1224 return *m_fileSystemStorageConnection; 1210 1225 } 1211 1226 -
trunk/Source/WebKit/WebProcess/WebProcess.h
r282669 r283271 141 141 class WebCompiledContentRuleListData; 142 142 class WebConnectionToUIProcess; 143 class WebFileSystemStorageConnection; 143 144 class WebFrame; 144 145 class WebLoaderStrategy; … … 246 247 NetworkProcessConnection* existingNetworkProcessConnection() { return m_networkProcessConnection.get(); } 247 248 WebLoaderStrategy& webLoaderStrategy(); 249 WebFileSystemStorageConnection& fileSystemStorageConnection(); 248 250 249 251 #if ENABLE(GPU_PROCESS) … … 652 654 RefPtr<NetworkProcessConnection> m_networkProcessConnection; 653 655 WebLoaderStrategy& m_webLoaderStrategy; 656 RefPtr<WebFileSystemStorageConnection> m_fileSystemStorageConnection; 654 657 655 658 #if ENABLE(GPU_PROCESS)
Note:
See TracChangeset
for help on using the changeset viewer.