Files.app: Call FreeDiskSpace before starting copy.
Previously Files.app can run out of local storage by copying files to Downloads.
The CL let fileManagerPrivate API call FreeDiskSpace before starting copy so
that it can secure available space by removing drive caches.
If it cannot secure available space, the API returns QuotaExceededError.
BUG=230283
TEST=FileSystemTest.FreeDiskSpaceIfNeededFor
Review URL: https://codereview.chromium.org/935513002
Cr-Commit-Position: refs/heads/master@{#316548}
diff --git a/chrome/browser/chromeos/drive/fake_file_system.h b/chrome/browser/chromeos/drive/fake_file_system.h
index cc25821..144d0f3 100644
--- a/chrome/browser/chromeos/drive/fake_file_system.h
+++ b/chrome/browser/chromeos/drive/fake_file_system.h
@@ -121,6 +121,8 @@
void Reset(const FileOperationCallback& callback) override;
void GetPathFromResourceId(const std::string& resource_id,
const GetFilePathCallback& callback) override;
+ void FreeDiskSpaceIfNeededFor(int64 num_bytes,
+ const FreeDiskSpaceCallback& callback) override;
private:
// Helpers of GetFileContent.