Commit 604074aa authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Files app: Change FMP.StartCopy to ues MyFiles path to check disk space

Change the FileManagerPrivate API to use MyFiles path to check for disk
space for StartCopy method.

The net result for this change is 0,because the implementation actually
uses statvfs [1] to check the spaceavailable which checks the space
used by the whole volume, so the result is literally the same with
Downloads or MyFiles path, however this is more correct. Note that when
MyFilesVolume flag is disabled it'll still use Downloads path because
the function GetMyFilesFolderForProfile handles that accordingly.

[1] - http://man7.org/linux/man-pages/man2/statvfs.2.html

Bug: 873539
Change-Id: I44cafdb35ee4f8825c45fa85793ccdac80d9e14c
Reviewed-on: https://chromium-review.googlesource.com/c/1352127Reviewed-by: default avatarJoel Hockey <joelhockey@chromium.org>
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611901}
parent 4adf9909
...@@ -749,7 +749,7 @@ void FileManagerPrivateInternalStartCopyFunction::RunAfterGetFileMetadata( ...@@ -749,7 +749,7 @@ void FileManagerPrivateInternalStartCopyFunction::RunAfterGetFileMetadata(
FROM_HERE, {base::MayBlock()}, FROM_HERE, {base::MayBlock()},
base::BindOnce( base::BindOnce(
&CheckLocalDiskSpace, &CheckLocalDiskSpace,
file_manager::util::GetDownloadsFolderForProfile(GetProfile()), file_manager::util::GetMyFilesFolderForProfile(GetProfile()),
file_info.size), file_info.size),
base::BindOnce( base::BindOnce(
&FileManagerPrivateInternalStartCopyFunction::RunAfterFreeDiskSpace, &FileManagerPrivateInternalStartCopyFunction::RunAfterFreeDiskSpace,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment