Bug 1761370 - Add [Throws] annotation for `read` and `write` in FileSystemSyncAccessHandle; r=dom-storage-reviewers,janv,smaug

Differential Revision: https://phabricator.services.mozilla.com/D156685
This commit is contained in:
Jan Varga 2022-09-10 17:18:39 +00:00
Родитель 7b24a39a82
Коммит d20ecedd0e
3 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -35,13 +35,15 @@ JSObject* FileSystemSyncAccessHandle::WrapObject(
uint64_t FileSystemSyncAccessHandle::Read(
const MaybeSharedArrayBufferViewOrMaybeSharedArrayBuffer& aBuffer,
const FileSystemReadWriteOptions& aOptions) {
const FileSystemReadWriteOptions& aOptions, ErrorResult& aRv) {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return 0;
}
uint64_t FileSystemSyncAccessHandle::Write(
const MaybeSharedArrayBufferViewOrMaybeSharedArrayBuffer& aBuffer,
const FileSystemReadWriteOptions& aOptions) {
const FileSystemReadWriteOptions& aOptions, ErrorResult& aRv) {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
return 0;
}

Просмотреть файл

@ -38,11 +38,11 @@ class FileSystemSyncAccessHandle final : public nsISupports,
// WebIDL Interface
uint64_t Read(
const MaybeSharedArrayBufferViewOrMaybeSharedArrayBuffer& aBuffer,
const FileSystemReadWriteOptions& aOptions);
const FileSystemReadWriteOptions& aOptions, ErrorResult& aRv);
uint64_t Write(
const MaybeSharedArrayBufferViewOrMaybeSharedArrayBuffer& aBuffer,
const FileSystemReadWriteOptions& aOptions);
const FileSystemReadWriteOptions& aOptions, ErrorResult& aRv);
already_AddRefed<Promise> Truncate(uint64_t aSize, ErrorResult& aError);

Просмотреть файл

@ -10,8 +10,8 @@ dictionary FileSystemReadWriteOptions {
[Exposed=(DedicatedWorker), SecureContext, Pref="dom.fs.enabled"]
interface FileSystemSyncAccessHandle {
// TODO: Use `[AllowShared] BufferSource data` once it works (bug 1696216)
unsigned long long read(([AllowShared] ArrayBufferView or [AllowShared] ArrayBuffer) buffer, optional FileSystemReadWriteOptions options = {});
unsigned long long write(([AllowShared] ArrayBufferView or [AllowShared] ArrayBuffer) buffer, optional FileSystemReadWriteOptions options = {});
[Throws] unsigned long long read(([AllowShared] ArrayBufferView or [AllowShared] ArrayBuffer) buffer, optional FileSystemReadWriteOptions options = {});
[Throws] unsigned long long write(([AllowShared] ArrayBufferView or [AllowShared] ArrayBuffer) buffer, optional FileSystemReadWriteOptions options = {});
[NewObject]
Promise<void> truncate([EnforceRange] unsigned long long size);