chromium/third_party/blink/renderer/modules/file_system_access/storage_manager_file_system_access.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {
// The name to use for the root directory of a sandboxed file system.
constexpr const char kSandboxRootDirectoryName[] =;

// Called with the result of browser-side permissions checks.
void OnGotAccessAllowed(
    ScriptPromiseResolver<FileSystemDirectoryHandle>* resolver,
    base::OnceCallback<void(ScriptPromiseResolver<FileSystemDirectoryHandle>*)>
        on_allowed,
    const mojom::blink::FileSystemAccessErrorPtr result) {}

}  // namespace

// static
ScriptPromise<FileSystemDirectoryHandle>
StorageManagerFileSystemAccess::getDirectory(ScriptState* script_state,
                                             const StorageManager& storage,
                                             ExceptionState& exception_state) {}

// static
ScriptPromise<FileSystemDirectoryHandle>
StorageManagerFileSystemAccess::CheckStorageAccessIsAllowed(
    ScriptState* script_state,
    ExceptionState& exception_state,
    base::OnceCallback<void(ScriptPromiseResolver<FileSystemDirectoryHandle>*)>
        on_allowed) {}

// static
void StorageManagerFileSystemAccess::CheckStorageAccessIsAllowed(
    ExecutionContext* context,
    base::OnceCallback<void(mojom::blink::FileSystemAccessErrorPtr)> callback) {}

// static
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) {}

}  // namespace blink