Commit 4eaf36d3 authored by Austin Sullivan's avatar Austin Sullivan Committed by Chromium LUCI CQ

[FSA] Refactor CreateWriterOptions -> CreateWritableOptions

This change was originally proposed in this refactor [1], but has been
split into another CL.

[1] https://crrev.com/c/2601576

Bug: 1110509
Change-Id: Ifd92321c5136ac3b29a714f24ad39674c866c9f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2604975
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841539}
parent 04f3f163
...@@ -98,12 +98,12 @@ class FileSystemHandle { ...@@ -98,12 +98,12 @@ class FileSystemHandle {
} }
/** @typedef {{keepExistingData: boolean}} */ /** @typedef {{keepExistingData: boolean}} */
let FileSystemCreateWriterOptions; let FileSystemCreateWritableOptions;
/** @interface */ /** @interface */
class FileSystemFileHandle extends FileSystemHandle { class FileSystemFileHandle extends FileSystemHandle {
/** /**
* @param {FileSystemCreateWriterOptions=} options * @param {FileSystemCreateWritableOptions=} options
* @return {!Promise<!FileSystemWritableFileStream>} * @return {!Promise<!FileSystemWritableFileStream>}
*/ */
createWritable(options) {} createWritable(options) {}
......
...@@ -283,8 +283,8 @@ generated_dictionary_sources_in_modules = [ ...@@ -283,8 +283,8 @@ generated_dictionary_sources_in_modules = [
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_picker_accept_type.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_picker_accept_type.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_picker_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_picker_options.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_picker_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_picker_options.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writer_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writable_options.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writer_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writable_options.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_flags.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_flags.cc",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_flags.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_flags.h",
"$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_get_directory_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_file_system_get_directory_options.cc",
......
...@@ -210,7 +210,7 @@ static_idl_files_in_modules = get_path_info( ...@@ -210,7 +210,7 @@ static_idl_files_in_modules = get_path_info(
"//third_party/blink/renderer/modules/file_system_access/directory_picker_options.idl", "//third_party/blink/renderer/modules/file_system_access/directory_picker_options.idl",
"//third_party/blink/renderer/modules/file_system_access/file_picker_accept_type.idl", "//third_party/blink/renderer/modules/file_system_access/file_picker_accept_type.idl",
"//third_party/blink/renderer/modules/file_system_access/file_picker_options.idl", "//third_party/blink/renderer/modules/file_system_access/file_picker_options.idl",
"//third_party/blink/renderer/modules/file_system_access/file_system_create_writer_options.idl", "//third_party/blink/renderer/modules/file_system_access/file_system_create_writable_options.idl",
"//third_party/blink/renderer/modules/file_system_access/file_system_directory_handle.idl", "//third_party/blink/renderer/modules/file_system_access/file_system_directory_handle.idl",
"//third_party/blink/renderer/modules/file_system_access/file_system_file_handle.idl", "//third_party/blink/renderer/modules/file_system_access/file_system_file_handle.idl",
"//third_party/blink/renderer/modules/file_system_access/file_system_get_directory_options.idl", "//third_party/blink/renderer/modules/file_system_access/file_system_get_directory_options.idl",
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// https://wicg.github.io/file-system-access/#dictdef-filesystemcreatewriteroptions // https://wicg.github.io/file-system-access/#dictdef-filesystemcreatewritableoptions
dictionary FileSystemCreateWriterOptions { dictionary FileSystemCreateWritableOptions {
boolean keepExistingData = false; boolean keepExistingData = false;
[RuntimeEnabled=FileSystemAccessAPIExperimental] boolean autoClose = false; [RuntimeEnabled=FileSystemAccessAPIExperimental] boolean autoClose = false;
}; };
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom-blink.h" #include "third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom-blink.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_transfer_token.mojom-blink.h" #include "third_party/blink/public/mojom/file_system_access/file_system_access_transfer_token.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writer_options.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_file_system_create_writable_options.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/fileapi/file.h" #include "third_party/blink/renderer/core/fileapi/file.h"
#include "third_party/blink/renderer/core/fileapi/file_error.h" #include "third_party/blink/renderer/core/fileapi/file_error.h"
...@@ -34,7 +34,7 @@ FileSystemFileHandle::FileSystemFileHandle( ...@@ -34,7 +34,7 @@ FileSystemFileHandle::FileSystemFileHandle(
ScriptPromise FileSystemFileHandle::createWritable( ScriptPromise FileSystemFileHandle::createWritable(
ScriptState* script_state, ScriptState* script_state,
const FileSystemCreateWriterOptions* options, const FileSystemCreateWritableOptions* options,
ExceptionState& exception_state) { ExceptionState& exception_state) {
if (!mojo_ptr_.is_bound()) { if (!mojo_ptr_.is_bound()) {
exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, ""); exception_state.ThrowDOMException(DOMExceptionCode::kInvalidStateError, "");
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h" #include "third_party/blink/renderer/platform/mojo/heap_mojo_remote.h"
namespace blink { namespace blink {
class FileSystemCreateWriterOptions; class FileSystemCreateWritableOptions;
class FileSystemFileHandle final : public FileSystemHandle { class FileSystemFileHandle final : public FileSystemHandle {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
...@@ -25,7 +25,7 @@ class FileSystemFileHandle final : public FileSystemHandle { ...@@ -25,7 +25,7 @@ class FileSystemFileHandle final : public FileSystemHandle {
bool isFile() const override { return true; } bool isFile() const override { return true; }
ScriptPromise createWritable(ScriptState*, ScriptPromise createWritable(ScriptState*,
const FileSystemCreateWriterOptions* options, const FileSystemCreateWritableOptions* options,
ExceptionState&); ExceptionState&);
ScriptPromise getFile(ScriptState*, ExceptionState&); ScriptPromise getFile(ScriptState*, ExceptionState&);
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
Serializable, Serializable,
RuntimeEnabled=FileSystemAccess RuntimeEnabled=FileSystemAccess
] interface FileSystemFileHandle : FileSystemHandle { ] interface FileSystemFileHandle : FileSystemHandle {
[CallWith=ScriptState, RaisesException] Promise<FileSystemWritableFileStream> createWritable(optional FileSystemCreateWriterOptions options = {}); [CallWith=ScriptState, RaisesException]
Promise<FileSystemWritableFileStream> createWritable(optional FileSystemCreateWritableOptions options = {});
[CallWith=ScriptState, RaisesException] Promise<File> getFile(); [CallWith=ScriptState, RaisesException] Promise<File> getFile();
}; };
...@@ -14,7 +14,7 @@ modules_dictionary_idl_files = [ ...@@ -14,7 +14,7 @@ modules_dictionary_idl_files = [
"directory_picker_options.idl", "directory_picker_options.idl",
"file_picker_accept_type.idl", "file_picker_accept_type.idl",
"file_picker_options.idl", "file_picker_options.idl",
"file_system_create_writer_options.idl", "file_system_create_writable_options.idl",
"file_system_get_directory_options.idl", "file_system_get_directory_options.idl",
"file_system_get_file_options.idl", "file_system_get_file_options.idl",
"file_system_handle_permission_descriptor.idl", "file_system_handle_permission_descriptor.idl",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment