diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /dom/fs/include | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/fs/include')
-rw-r--r-- | dom/fs/include/fs/FileSystemChildFactory.h | 31 | ||||
-rw-r--r-- | dom/fs/include/fs/FileSystemConstants.h | 18 | ||||
-rw-r--r-- | dom/fs/include/fs/FileSystemRequestHandler.h | 94 |
3 files changed, 143 insertions, 0 deletions
diff --git a/dom/fs/include/fs/FileSystemChildFactory.h b/dom/fs/include/fs/FileSystemChildFactory.h new file mode 100644 index 0000000000..7fe58d65e9 --- /dev/null +++ b/dom/fs/include/fs/FileSystemChildFactory.h @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef DOM_FS_FILESYSTEMCHILDFACTORY_H_ +#define DOM_FS_FILESYSTEMCHILDFACTORY_H_ + +#include "mozilla/AlreadyAddRefed.h" + +namespace mozilla { +class ErrorResult; + +namespace dom { +class FileSystemManagerChild; +} // namespace dom +} // namespace mozilla + +namespace mozilla::dom::fs { + +class FileSystemChildFactory { + public: + virtual already_AddRefed<FileSystemManagerChild> Create() const; + + virtual ~FileSystemChildFactory() = default; +}; + +} // namespace mozilla::dom::fs + +#endif // DOM_FS_FILESYSTEMCHILDFACTORY_H_ diff --git a/dom/fs/include/fs/FileSystemConstants.h b/dom/fs/include/fs/FileSystemConstants.h new file mode 100644 index 0000000000..fc9e1840c4 --- /dev/null +++ b/dom/fs/include/fs/FileSystemConstants.h @@ -0,0 +1,18 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef DOM_FS_FILESYSTEMCONSTANTS_H_ +#define DOM_FS_FILESYSTEMCONSTANTS_H_ + +#include "nsLiteralString.h" + +namespace mozilla::dom::fs { + +constexpr nsLiteralString kRootName = u"root"_ns; + +} // namespace mozilla::dom::fs + +#endif // DOM_FS_FILESYSTEMCONSTANTS_H_ diff --git a/dom/fs/include/fs/FileSystemRequestHandler.h b/dom/fs/include/fs/FileSystemRequestHandler.h new file mode 100644 index 0000000000..d535d75164 --- /dev/null +++ b/dom/fs/include/fs/FileSystemRequestHandler.h @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef DOM_FS_CHILD_FILESYSTEMREQUESTHANDLER_H_ +#define DOM_FS_CHILD_FILESYSTEMREQUESTHANDLER_H_ + +#include "mozilla/dom/FileSystemTypes.h" + +template <class T> +class RefPtr; + +namespace mozilla { + +class ErrorResult; + +namespace dom { + +class FileSystemHandle; +class FileSystemManager; +class Promise; + +namespace fs { + +class FileSystemChildMetadata; +class FileSystemEntryMetadata; +class FileSystemEntryMetadataArray; +class FileSystemEntryPair; + +class FileSystemRequestHandler { + public: + virtual void GetRootHandle(RefPtr<FileSystemManager> aManager, + RefPtr<Promise> aPromise, ErrorResult& aError); + + virtual void GetDirectoryHandle(RefPtr<FileSystemManager>& aManager, + const FileSystemChildMetadata& aDirectory, + bool aCreate, RefPtr<Promise> aPromise, + ErrorResult& aError); + + virtual void GetFileHandle(RefPtr<FileSystemManager>& aManager, + const FileSystemChildMetadata& aFile, bool aCreate, + RefPtr<Promise> aPromise, ErrorResult& aError); + + virtual void GetFile(RefPtr<FileSystemManager>& aManager, + const FileSystemEntryMetadata& aFile, + RefPtr<Promise> aPromise, ErrorResult& aError); + + virtual void GetAccessHandle(RefPtr<FileSystemManager>& aManager, + const FileSystemEntryMetadata& aFile, + const RefPtr<Promise>& aPromise, + ErrorResult& aError); + + virtual void GetWritable(RefPtr<FileSystemManager>& aManager, + const FileSystemEntryMetadata& aFile, bool aKeepData, + const RefPtr<Promise>& aPromise, + ErrorResult& aError); + + virtual void GetEntries(RefPtr<FileSystemManager>& aManager, + const EntryId& aDirectory, PageNumber aPage, + RefPtr<Promise> aPromise, + RefPtr<FileSystemEntryMetadataArray>& aSink, + ErrorResult& aError); + + virtual void RemoveEntry(RefPtr<FileSystemManager>& aManager, + const FileSystemChildMetadata& aEntry, + bool aRecursive, RefPtr<Promise> aPromise, + ErrorResult& aError); + + virtual void MoveEntry(RefPtr<FileSystemManager>& aManager, + FileSystemHandle* aHandle, + const FileSystemEntryMetadata& aEntry, + const FileSystemChildMetadata& aNewEntry, + RefPtr<Promise> aPromise, ErrorResult& aError); + + virtual void RenameEntry(RefPtr<FileSystemManager>& aManager, + FileSystemHandle* aHandle, + const FileSystemEntryMetadata& aEntry, + const Name& aName, RefPtr<Promise> aPromise, + ErrorResult& aError); + + virtual void Resolve(RefPtr<FileSystemManager>& aManager, + const FileSystemEntryPair& aEndpoints, + RefPtr<Promise> aPromise, ErrorResult& aError); + + virtual ~FileSystemRequestHandler() = default; +}; // class FileSystemRequestHandler + +} // namespace fs +} // namespace dom +} // namespace mozilla + +#endif // DOM_FS_CHILD_FILESYSTEMREQUESTHANDLER_H_ |