summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_util.cc
diff options
context:
space:
mode:
authorbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 08:14:27 +0000
committerbenwells@chromium.org <benwells@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-30 08:14:27 +0000
commit0b38b4e5f4937528241ee5004d3bf953629a875b (patch)
tree19b83430989f97ac61262eec21e9fc09973aa28e /webkit/fileapi/file_system_util.cc
parent26d35e56c0ed0cc8b4eb3af0096c6c630bb934dc (diff)
downloadchromium_src-0b38b4e5f4937528241ee5004d3bf953629a875b.zip
chromium_src-0b38b4e5f4937528241ee5004d3bf953629a875b.tar.gz
chromium_src-0b38b4e5f4937528241ee5004d3bf953629a875b.tar.bz2
Move fileapi into its own component
Before this change fileapi is a static library. As it has static data, this causes problems when used from multiple components like chrome and content. BUG=129885 TEST=Existing tests Review URL: https://chromiumcodereview.appspot.com/10447055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139498 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_util.cc')
-rw-r--r--webkit/fileapi/file_system_util.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_util.cc b/webkit/fileapi/file_system_util.cc
index 0bfbb5e..985c021 100644
--- a/webkit/fileapi/file_system_util.cc
+++ b/webkit/fileapi/file_system_util.cc
@@ -249,4 +249,31 @@ FilePath StringToFilePath(const std::string& file_path_string) {
#endif
}
+WebKit::WebFileError PlatformFileErrorToWebFileError(
+ base::PlatformFileError error_code) {
+ switch (error_code) {
+ case base::PLATFORM_FILE_ERROR_NOT_FOUND:
+ return WebKit::WebFileErrorNotFound;
+ case base::PLATFORM_FILE_ERROR_INVALID_OPERATION:
+ case base::PLATFORM_FILE_ERROR_EXISTS:
+ case base::PLATFORM_FILE_ERROR_NOT_EMPTY:
+ return WebKit::WebFileErrorInvalidModification;
+ case base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY:
+ case base::PLATFORM_FILE_ERROR_NOT_A_FILE:
+ return WebKit::WebFileErrorTypeMismatch;
+ case base::PLATFORM_FILE_ERROR_ACCESS_DENIED:
+ return WebKit::WebFileErrorNoModificationAllowed;
+ case base::PLATFORM_FILE_ERROR_FAILED:
+ return WebKit::WebFileErrorInvalidState;
+ case base::PLATFORM_FILE_ERROR_ABORT:
+ return WebKit::WebFileErrorAbort;
+ case base::PLATFORM_FILE_ERROR_SECURITY:
+ return WebKit::WebFileErrorSecurity;
+ case base::PLATFORM_FILE_ERROR_NO_SPACE:
+ return WebKit::WebFileErrorQuotaExceeded;
+ default:
+ return WebKit::WebFileErrorInvalidModification;
+ }
+}
+
} // namespace fileapi