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 #include "chrome/browser/sync_file_system/drive_file_sync_util.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace sync_file_system { | 9 namespace sync_file_system { |
10 | 10 |
11 fileapi::SyncStatusCode GDataErrorCodeToSyncStatusCode( | 11 fileapi::SyncStatusCode GDataErrorCodeToSyncStatusCode( |
12 google_apis::GDataErrorCode error) { | 12 google_apis::GDataErrorCode error) { |
| 13 // NOTE: Please update DriveFileSyncService::UpdateServiceState when you add |
| 14 // more error code mapping. |
13 switch (error) { | 15 switch (error) { |
14 case google_apis::HTTP_SUCCESS: | 16 case google_apis::HTTP_SUCCESS: |
15 case google_apis::HTTP_CREATED: | 17 case google_apis::HTTP_CREATED: |
16 case google_apis::HTTP_FOUND: | 18 case google_apis::HTTP_FOUND: |
17 case google_apis::HTTP_NOT_MODIFIED: | 19 case google_apis::HTTP_NOT_MODIFIED: |
18 return fileapi::SYNC_STATUS_OK; | 20 return fileapi::SYNC_STATUS_OK; |
19 | 21 |
20 case google_apis::HTTP_CONFLICT: | 22 case google_apis::HTTP_CONFLICT: |
21 return fileapi::SYNC_STATUS_HAS_CONFLICT; | 23 return fileapi::SYNC_STATUS_HAS_CONFLICT; |
22 | 24 |
(...skipping 22 matching lines...) Expand all Loading... |
45 case google_apis::HTTP_PRECONDITION: | 47 case google_apis::HTTP_PRECONDITION: |
46 case google_apis::GDATA_PARSE_ERROR: | 48 case google_apis::GDATA_PARSE_ERROR: |
47 case google_apis::GDATA_OTHER_ERROR: | 49 case google_apis::GDATA_OTHER_ERROR: |
48 return fileapi::SYNC_STATUS_FAILED; | 50 return fileapi::SYNC_STATUS_FAILED; |
49 } | 51 } |
50 NOTREACHED(); | 52 NOTREACHED(); |
51 return fileapi::SYNC_STATUS_FAILED; | 53 return fileapi::SYNC_STATUS_FAILED; |
52 } | 54 } |
53 | 55 |
54 } // namespace sync_file_system | 56 } // namespace sync_file_system |
OLD | NEW |