diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 15:47:54 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 15:47:54 +0000 |
commit | ad56b506976c2e82111f16e31112fd0916dc44f0 (patch) | |
tree | 2d4616918ed86040de7e16dbe0a1d6c251fbe335 /base | |
parent | 5fc11997ca737c1d4d2f13dd5ecc88cff6386a9e (diff) | |
download | chromium_src-ad56b506976c2e82111f16e31112fd0916dc44f0.zip chromium_src-ad56b506976c2e82111f16e31112fd0916dc44f0.tar.gz chromium_src-ad56b506976c2e82111f16e31112fd0916dc44f0.tar.bz2 |
add check for fAnyOperationsAborted
BUG=67621
TEST=none
Review URL: http://codereview.chromium.org/6001003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69832 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/file_util_win.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc index 4645acc..3ca52ae 100644 --- a/base/file_util_win.cc +++ b/base/file_util_win.cc @@ -163,6 +163,14 @@ bool Delete(const FilePath& path, bool recursive) { if (!recursive) file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY; int err = SHFileOperation(&file_operation); + + // Since we're passing flags to the operation telling it to be silent, + // it's possible for the operation to be aborted/cancelled without err + // being set (although MSDN doesn't give any scenarios for how this can + // happen). See MSDN for SHFileOperation and SHFILEOPTSTRUCT. + if (file_operation.fAnyOperationsAborted) + return false; + // Some versions of Windows return ERROR_FILE_NOT_FOUND (0x2) when deleting // an empty directory and some return 0x402 when they should be returning // ERROR_FILE_NOT_FOUND. MSDN says Vista and up won't return 0x402. |