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

// Copyright 2021 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/file_system_access_capacity_tracker.h"

#include "base/bits.h"
#include "base/numerics/checked_math.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "base/types/pass_key.h"
#include "third_party/blink/public/mojom/file_system_access/file_system_access_file_modification_host.mojom-blink.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"

namespace {
// Minimum size of an allocation requested from the browser.
constexpr int64_t kMinAllocationSize =;
// Maximum size until which the allocation strategy doubles the requested
// allocation.
constexpr int64_t kMaxAllocationDoublingSize =;
}  // namespace

namespace blink {

FileSystemAccessCapacityTracker::FileSystemAccessCapacityTracker(
    ExecutionContext* context,
    mojo::PendingRemote<mojom::blink::FileSystemAccessFileModificationHost>
        file_modification_host_remote,
    int64_t file_size,
    base::PassKey<FileSystemAccessRegularFileDelegate>)
    :{}

void FileSystemAccessCapacityTracker::RequestFileCapacityChange(
    int64_t required_capacity,
    base::OnceCallback<void(bool)> callback) {}

bool FileSystemAccessCapacityTracker::RequestFileCapacityChangeSync(
    int64_t required_capacity) {}

void FileSystemAccessCapacityTracker::OnFileContentsModified(int64_t new_size) {}

void FileSystemAccessCapacityTracker::DidRequestCapacityChange(
    int64_t required_capacity,
    base::OnceCallback<void(bool)> callback,
    int64_t granted_capacity) {}

// static
int64_t FileSystemAccessCapacityTracker::GetNextCapacityRequestSize(
    int64_t required_capacity) {}

}  // namespace blink