1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_STATUS_CODE_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_STATUS_CODE_H_
10 #include "base/files/file.h"
16 namespace sync_file_system
{
20 SYNC_STATUS_UNKNOWN
= -1000,
22 // Generic error code which is not specifically related to a specific
23 // submodule error code (yet).
24 SYNC_STATUS_FAILED
= -1001,
26 // Basic ones that could be directly mapped to File::Error.
27 SYNC_FILE_ERROR_FAILED
= -1,
28 SYNC_FILE_ERROR_IN_USE
= -2,
29 SYNC_FILE_ERROR_EXISTS
= -3,
30 SYNC_FILE_ERROR_NOT_FOUND
= -4,
31 SYNC_FILE_ERROR_ACCESS_DENIED
= -5,
32 SYNC_FILE_ERROR_TOO_MANY_OPENED
= -6,
33 SYNC_FILE_ERROR_NO_MEMORY
= -7,
34 SYNC_FILE_ERROR_NO_SPACE
= -8,
35 SYNC_FILE_ERROR_NOT_A_DIRECTORY
= -9,
36 SYNC_FILE_ERROR_INVALID_OPERATION
= -10,
37 SYNC_FILE_ERROR_SECURITY
= -11,
38 SYNC_FILE_ERROR_ABORT
= -12,
39 SYNC_FILE_ERROR_NOT_A_FILE
= -13,
40 SYNC_FILE_ERROR_NOT_EMPTY
= -14,
41 SYNC_FILE_ERROR_INVALID_URL
= -15,
42 SYNC_FILE_ERROR_IO
= -16,
44 // Database related errors.
45 SYNC_DATABASE_ERROR_NOT_FOUND
= -50,
46 SYNC_DATABASE_ERROR_CORRUPTION
= -51,
47 SYNC_DATABASE_ERROR_IO_ERROR
= -52,
48 SYNC_DATABASE_ERROR_FAILED
= -53,
50 // Sync specific status code.
51 SYNC_STATUS_FILE_BUSY
= -100,
52 SYNC_STATUS_HAS_CONFLICT
= -101,
53 SYNC_STATUS_NO_CONFLICT
= -102,
54 SYNC_STATUS_ABORT
= -103,
55 SYNC_STATUS_NO_CHANGE_TO_SYNC
= -104,
56 SYNC_STATUS_SERVICE_TEMPORARILY_UNAVAILABLE
= -105,
57 SYNC_STATUS_NETWORK_ERROR
= -106,
58 SYNC_STATUS_AUTHENTICATION_FAILED
= -107,
59 SYNC_STATUS_UNKNOWN_ORIGIN
= -108,
60 SYNC_STATUS_NOT_MODIFIED
= -109,
61 SYNC_STATUS_SYNC_DISABLED
= -110,
62 SYNC_STATUS_ACCESS_FORBIDDEN
= -111,
63 SYNC_STATUS_RETRY
= -112,
66 const char* SyncStatusCodeToString(SyncStatusCode status
);
68 SyncStatusCode
LevelDBStatusToSyncStatusCode(const leveldb::Status
& status
);
70 SyncStatusCode
FileErrorToSyncStatusCode(base::File::Error file_error
);
72 base::File::Error
SyncStatusCodeToFileError(SyncStatusCode status
);
74 } // namespace sync_file_system
76 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_STATUS_CODE_H_