summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-02 18:38:22 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-02 18:38:22 +0000
commit065499f70249cd46f7c04e727e90207179e39408 (patch)
tree0ff28b4644490416acfe4595a02e65abd04952ad /base
parent49fd1defd074fcc5fadbb0c45e8d2646626b58ee (diff)
downloadchromium_src-065499f70249cd46f7c04e727e90207179e39408.zip
chromium_src-065499f70249cd46f7c04e727e90207179e39408.tar.gz
chromium_src-065499f70249cd46f7c04e727e90207179e39408.tar.bz2
Add more error codes to base::CreatePlatformFile on windows.
This is a rough classification of the errors that showed up in the PlatformFile.UnknownCreateFileErrors histogram. I added an IO entry to to the enum because a bunch of the errors seem to indicate a low-level problem that is out of the application programmer's control. BUG=229252 R=jar@chromium.org Review URL: https://codereview.chromium.org/14586003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197947 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/platform_file.h3
-rw-r--r--base/platform_file_win.cc12
2 files changed, 14 insertions, 1 deletions
diff --git a/base/platform_file.h b/base/platform_file.h
index b1efaaa..43758c5 100644
--- a/base/platform_file.h
+++ b/base/platform_file.h
@@ -79,8 +79,9 @@ enum PlatformFileError {
PLATFORM_FILE_ERROR_NOT_A_FILE = -13,
PLATFORM_FILE_ERROR_NOT_EMPTY = -14,
PLATFORM_FILE_ERROR_INVALID_URL = -15,
+ PLATFORM_FILE_ERROR_IO = -16,
// Put new entries here and increment PLATFORM_FILE_ERROR_MAX.
- PLATFORM_FILE_ERROR_MAX = -16
+ PLATFORM_FILE_ERROR_MAX = -17
};
// This explicit mapping matches both FILE_ on Windows and SEEK_ on Linux.
diff --git a/base/platform_file_win.cc b/base/platform_file_win.cc
index b980550..2d25d33 100644
--- a/base/platform_file_win.cc
+++ b/base/platform_file_win.cc
@@ -100,6 +100,7 @@ PlatformFile CreatePlatformFileUnsafe(const FilePath& name,
*error = PLATFORM_FILE_ERROR_EXISTS;
break;
case ERROR_FILE_NOT_FOUND:
+ case ERROR_PATH_NOT_FOUND:
*error = PLATFORM_FILE_ERROR_NOT_FOUND;
break;
case ERROR_ACCESS_DENIED:
@@ -117,6 +118,17 @@ PlatformFile CreatePlatformFileUnsafe(const FilePath& name,
case ERROR_DISK_RESOURCES_EXHAUSTED:
*error = PLATFORM_FILE_ERROR_NO_SPACE;
break;
+ case ERROR_USER_MAPPED_FILE:
+ *error = PLATFORM_FILE_ERROR_INVALID_OPERATION;
+ break;
+ case ERROR_NOT_READY:
+ case ERROR_SECTOR_NOT_FOUND:
+ case ERROR_DEV_NOT_EXIST:
+ case ERROR_IO_DEVICE:
+ case ERROR_FILE_CORRUPT:
+ case ERROR_DISK_CORRUPT:
+ *error = PLATFORM_FILE_ERROR_IO;
+ break;
default:
UMA_HISTOGRAM_SPARSE_SLOWLY("PlatformFile.UnknownCreateFileErrors",
last_error);