#include "third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.h"
#include <utility>
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_error.mojom-blink.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_access_error.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_access_manager.h"
#include "third_party/blink/renderer/modules/file_system_access/file_system_directory_handle.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
namespace {
constexpr const char kSandboxRootDirectoryName[] = …;
void OnGotAccessAllowed(
ScriptPromiseResolver<FileSystemDirectoryHandle>* resolver,
base::OnceCallback<void(ScriptPromiseResolver<FileSystemDirectoryHandle>*)>
on_allowed,
const mojom::blink::FileSystemAccessErrorPtr result) { … }
}
ScriptPromise<FileSystemDirectoryHandle>
StorageManagerFileSystemAccess::getDirectory(ScriptState* script_state,
const StorageManager& storage,
ExceptionState& exception_state) { … }
ScriptPromise<FileSystemDirectoryHandle>
StorageManagerFileSystemAccess::CheckStorageAccessIsAllowed(
ScriptState* script_state,
ExceptionState& exception_state,
base::OnceCallback<void(ScriptPromiseResolver<FileSystemDirectoryHandle>*)>
on_allowed) { … }
void StorageManagerFileSystemAccess::CheckStorageAccessIsAllowed(
ExecutionContext* context,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr)> callback) { … }
void StorageManagerFileSystemAccess::DidGetSandboxedFileSystem(
ScriptPromiseResolver<FileSystemDirectoryHandle>* resolver,
mojom::blink::FileSystemAccessErrorPtr result,
mojo::PendingRemote<mojom::blink::FileSystemAccessDirectoryHandle> handle) { … }
void StorageManagerFileSystemAccess::DidGetSandboxedFileSystemForDevtools(
ExecutionContext* context,
base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr,
FileSystemDirectoryHandle*)> callback,
mojom::blink::FileSystemAccessErrorPtr result,
mojo::PendingRemote<mojom::blink::FileSystemAccessDirectoryHandle> handle) { … }
}