#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 {
constexpr int64_t kMinAllocationSize = …;
constexpr int64_t kMaxAllocationDoublingSize = …;
}
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) { … }
int64_t FileSystemAccessCapacityTracker::GetNextCapacityRequestSize(
int64_t required_capacity) { … }
}