mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1803062 - Expose the sync close operation using a dedicated method; r=smaug
This is a preparation for changing the internal Close method to be async. Differential Revision: https://phabricator.services.mozilla.com/D164192
This commit is contained in:
parent
fe224998ea
commit
3042af06bf
@ -136,7 +136,7 @@ FileSystemSyncAccessHandle::Create(
|
||||
|
||||
RefPtr<StrongWorkerRef> workerRef =
|
||||
StrongWorkerRef::Create(workerPrivate, "FileSystemSyncAccessHandle",
|
||||
[result]() { result->Close(); });
|
||||
[result]() { result->CloseInternal(); });
|
||||
QM_TRY(MOZ_TO_RESULT(workerRef));
|
||||
|
||||
autoClose.release();
|
||||
@ -160,7 +160,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FileSystemSyncAccessHandle)
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal)
|
||||
// Don't unlink mManager!
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
|
||||
tmp->Close();
|
||||
tmp->CloseInternal();
|
||||
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FileSystemSyncAccessHandle)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
|
||||
@ -188,7 +188,7 @@ void FileSystemSyncAccessHandle::ClearActor() {
|
||||
mActor = nullptr;
|
||||
}
|
||||
|
||||
void FileSystemSyncAccessHandle::Close() {
|
||||
void FileSystemSyncAccessHandle::CloseInternal() {
|
||||
if (mClosed) {
|
||||
return;
|
||||
}
|
||||
@ -284,6 +284,8 @@ void FileSystemSyncAccessHandle::Flush(ErrorResult& aError) {
|
||||
mStream->OutputStream()->Flush();
|
||||
}
|
||||
|
||||
void FileSystemSyncAccessHandle::Close() { CloseInternal(); }
|
||||
|
||||
uint64_t FileSystemSyncAccessHandle::ReadOrWrite(
|
||||
const MaybeSharedArrayBufferViewOrMaybeSharedArrayBuffer& aBuffer,
|
||||
const FileSystemReadWriteOptions& aOptions, const bool aRead,
|
||||
|
@ -43,6 +43,8 @@ class FileSystemSyncAccessHandle final : public nsISupports,
|
||||
|
||||
void ClearActor();
|
||||
|
||||
void CloseInternal();
|
||||
|
||||
// WebIDL Boilerplate
|
||||
nsIGlobalObject* GetParentObject() const;
|
||||
|
||||
|
@ -21,7 +21,7 @@ void FileSystemManagerChild::CloseAll() {
|
||||
for (const auto& item : ManagedPFileSystemAccessHandleChild()) {
|
||||
auto* child = static_cast<FileSystemAccessHandleChild*>(item);
|
||||
|
||||
child->MutableAccessHandlePtr()->Close();
|
||||
child->MutableAccessHandlePtr()->CloseInternal();
|
||||
}
|
||||
|
||||
for (const auto& item : ManagedPFileSystemWritableFileStreamChild()) {
|
||||
|
Loading…
Reference in New Issue
Block a user