diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h b/chromium/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h new file mode 100644 index 00000000000..1c46d619a0f --- /dev/null +++ b/chromium/third_party/blink/renderer/modules/file_system_access/file_system_file_handle.h @@ -0,0 +1,59 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_SYSTEM_ACCESS_FILE_SYSTEM_FILE_HANDLE_H_ +#define THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_SYSTEM_ACCESS_FILE_SYSTEM_FILE_HANDLE_H_ + +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_handle.mojom-blink.h" +#include "third_party/blink/renderer/modules/file_system_access/file_system_handle.h" +#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" + +namespace blink { +class FileSystemCreateWritableOptions; + +class FileSystemFileHandle final : public FileSystemHandle { + DEFINE_WRAPPERTYPEINFO(); + + public: + FileSystemFileHandle( + ExecutionContext* context, + const String& name, + mojo::PendingRemote<mojom::blink::FileSystemAccessFileHandle>); + + bool isFile() const override { return true; } + + ScriptPromise createWritable(ScriptState*, + const FileSystemCreateWritableOptions* options, + ExceptionState&); + ScriptPromise getFile(ScriptState*, ExceptionState&); + + mojo::PendingRemote<mojom::blink::FileSystemAccessTransferToken> Transfer() + override; + + mojom::blink::FileSystemAccessFileHandle* MojoHandle() { + return mojo_ptr_.get(); + } + + void Trace(Visitor*) const override; + + private: + void QueryPermissionImpl( + bool writable, + base::OnceCallback<void(mojom::blink::PermissionStatus)>) override; + void RequestPermissionImpl( + bool writable, + base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr, + mojom::blink::PermissionStatus)>) override; + void IsSameEntryImpl( + mojo::PendingRemote<mojom::blink::FileSystemAccessTransferToken> other, + base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr, bool)>) + override; + + HeapMojoRemote<mojom::blink::FileSystemAccessFileHandle> mojo_ptr_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_MODULES_FILE_SYSTEM_ACCESS_FILE_SYSTEM_FILE_HANDLE_H_ |