| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_ERRORS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_ERRORS_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_ERRORS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_ERRORS_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/platform_file.h" | 9 #include "base/files/file.h" |
| 10 #include "google_apis/drive/gdata_errorcode.h" | 10 #include "google_apis/drive/gdata_errorcode.h" |
| 11 | 11 |
| 12 namespace drive { | 12 namespace drive { |
| 13 | 13 |
| 14 enum FileError { | 14 enum FileError { |
| 15 FILE_ERROR_OK = 0, | 15 FILE_ERROR_OK = 0, |
| 16 FILE_ERROR_FAILED = -1, | 16 FILE_ERROR_FAILED = -1, |
| 17 FILE_ERROR_IN_USE = -2, | 17 FILE_ERROR_IN_USE = -2, |
| 18 FILE_ERROR_EXISTS = -3, | 18 FILE_ERROR_EXISTS = -3, |
| 19 FILE_ERROR_NOT_FOUND = -4, | 19 FILE_ERROR_NOT_FOUND = -4, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 FILE_ERROR_NO_LOCAL_SPACE = -17, | 32 FILE_ERROR_NO_LOCAL_SPACE = -17, |
| 33 FILE_ERROR_SERVICE_UNAVAILABLE = -18, | 33 FILE_ERROR_SERVICE_UNAVAILABLE = -18, |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // Used as callbacks for file operations. | 36 // Used as callbacks for file operations. |
| 37 typedef base::Callback<void(FileError error)> FileOperationCallback; | 37 typedef base::Callback<void(FileError error)> FileOperationCallback; |
| 38 | 38 |
| 39 // Returns a string representation of FileError. | 39 // Returns a string representation of FileError. |
| 40 std::string FileErrorToString(FileError error); | 40 std::string FileErrorToString(FileError error); |
| 41 | 41 |
| 42 // Returns a PlatformFileError that corresponds to the FileError provided. | 42 // Returns a base::File::Error that corresponds to the FileError provided. |
| 43 base::PlatformFileError FileErrorToPlatformError(FileError error); | 43 base::File::Error FileErrorToBaseFileError(FileError error); |
| 44 | 44 |
| 45 // Converts GData error code into Drive file error code. | 45 // Converts GData error code into Drive file error code. |
| 46 FileError GDataToFileError(google_apis::GDataErrorCode status); | 46 FileError GDataToFileError(google_apis::GDataErrorCode status); |
| 47 | 47 |
| 48 } // namespace drive | 48 } // namespace drive |
| 49 | 49 |
| 50 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_ERRORS_H_ | 50 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_ERRORS_H_ |
| OLD | NEW |