From 660ba100917c772756675be039ff1f86a3c7202b Mon Sep 17 00:00:00 2001 From: Jan Varga Date: Tue, 7 Feb 2023 08:27:07 +0000 Subject: [PATCH] Bug 1809064 - Expose FileSystemDataManager::mIOTarget; r=dom-storage-reviewers,jari This patch also fixes the misnamed getter for mIOTaskQueue. Depends on D166344 Differential Revision: https://phabricator.services.mozilla.com/D166345 --- dom/fs/parent/FileSystemManagerParent.cpp | 4 ++-- dom/fs/parent/FileSystemManagerParentFactory.cpp | 2 +- dom/fs/parent/datamodel/FileSystemDataManager.cpp | 4 ++-- dom/fs/parent/datamodel/FileSystemDataManager.h | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dom/fs/parent/FileSystemManagerParent.cpp b/dom/fs/parent/FileSystemManagerParent.cpp index d99e0cd9a847..8c995f145905 100644 --- a/dom/fs/parent/FileSystemManagerParent.cpp +++ b/dom/fs/parent/FileSystemManagerParent.cpp @@ -465,11 +465,11 @@ void FileSystemManagerParent::RequestAllowToClose() { mRequestedAllowToClose.Flip(); - InvokeAsync(mDataManager->MutableIOTargetPtr(), __func__, + InvokeAsync(mDataManager->MutableIOTaskQueuePtr(), __func__, [self = RefPtr(this)]() { return self->SendCloseAll(); }) - ->Then(mDataManager->MutableIOTargetPtr(), __func__, + ->Then(mDataManager->MutableIOTaskQueuePtr(), __func__, [self = RefPtr(this)]( const CloseAllPromise::ResolveOrRejectValue& aValue) { self->Close(); diff --git a/dom/fs/parent/FileSystemManagerParentFactory.cpp b/dom/fs/parent/FileSystemManagerParentFactory.cpp index 1da98a7bc51c..a06e3942e4ea 100644 --- a/dom/fs/parent/FileSystemManagerParentFactory.cpp +++ b/dom/fs/parent/FileSystemManagerParentFactory.cpp @@ -65,7 +65,7 @@ mozilla::ipc::IPCResult CreateFileSystemManagerParent( [aResolver](const auto& aRv) { aResolver(ToNSResult(aRv)); }); InvokeAsync( - dataManager->MutableIOTargetPtr(), __func__, + dataManager->MutableIOTaskQueuePtr(), __func__, [dataManager = RefPtr(dataManager), rootId, parentEndpoint = std::move(parentEndpoint)]() mutable { diff --git a/dom/fs/parent/datamodel/FileSystemDataManager.cpp b/dom/fs/parent/datamodel/FileSystemDataManager.cpp index e0e0bf978282..a0229ee55f24 100644 --- a/dom/fs/parent/datamodel/FileSystemDataManager.cpp +++ b/dom/fs/parent/datamodel/FileSystemDataManager.cpp @@ -429,7 +429,7 @@ RefPtr FileSystemDataManager::BeginOpen() { return BoolPromise::CreateAndResolve(true, __func__); }) - ->Then(MutableIOTargetPtr(), __func__, + ->Then(MutableIOTaskQueuePtr(), __func__, [self = RefPtr(this)]( const BoolPromise::ResolveOrRejectValue& value) { if (value.IsReject()) { @@ -494,7 +494,7 @@ RefPtr FileSystemDataManager::BeginClose() { mState = State::Closing; - InvokeAsync(MutableIOTargetPtr(), __func__, + InvokeAsync(MutableIOTaskQueuePtr(), __func__, [self = RefPtr(this)]() { if (self->mDatabaseManager) { self->mDatabaseManager->Close(); diff --git a/dom/fs/parent/datamodel/FileSystemDataManager.h b/dom/fs/parent/datamodel/FileSystemDataManager.h index d6e2d8e9bc4b..20d97705528e 100644 --- a/dom/fs/parent/datamodel/FileSystemDataManager.h +++ b/dom/fs/parent/datamodel/FileSystemDataManager.h @@ -83,7 +83,9 @@ class FileSystemDataManager return mBackgroundTarget.get(); } - nsISerialEventTarget* MutableIOTargetPtr() const { + nsIEventTarget* MutableIOTargetPtr() const { return mIOTarget.get(); } + + nsISerialEventTarget* MutableIOTaskQueuePtr() const { return mIOTaskQueue.get(); }