Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6377)

Unified Diff: chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.cc

Issue 125733003: [SyncFS] Clean up V1 drive_file_sync_util.h dependency from V2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.cc
diff --git a/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.cc b/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.cc
index 2e736d5e651fac48690d513c2fdef4a2f03c49cd..73dbc607056420b38c8aff9f35e162104e2c60b0 100644
--- a/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.cc
+++ b/chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.cc
@@ -21,73 +21,6 @@ bool is_drive_api_disabled = false;
} // namespace
-SyncStatusCode GDataErrorCodeToSyncStatusCode(
- google_apis::GDataErrorCode error) {
- // NOTE: Please update DriveFileSyncService::UpdateServiceState when you add
- // more error code mapping.
- switch (error) {
- case google_apis::HTTP_SUCCESS:
- case google_apis::HTTP_CREATED:
- case google_apis::HTTP_NO_CONTENT:
- case google_apis::HTTP_FOUND:
- return SYNC_STATUS_OK;
-
- case google_apis::HTTP_NOT_MODIFIED:
- return SYNC_STATUS_NOT_MODIFIED;
-
- case google_apis::HTTP_CONFLICT:
- case google_apis::HTTP_PRECONDITION:
- return SYNC_STATUS_HAS_CONFLICT;
-
- case google_apis::HTTP_UNAUTHORIZED:
- return SYNC_STATUS_AUTHENTICATION_FAILED;
-
- case google_apis::GDATA_NO_CONNECTION:
- return SYNC_STATUS_NETWORK_ERROR;
-
- case google_apis::HTTP_INTERNAL_SERVER_ERROR:
- case google_apis::HTTP_BAD_GATEWAY:
- case google_apis::HTTP_SERVICE_UNAVAILABLE:
- case google_apis::GDATA_CANCELLED:
- case google_apis::GDATA_NOT_READY:
- return SYNC_STATUS_SERVICE_TEMPORARILY_UNAVAILABLE;
-
- case google_apis::HTTP_NOT_FOUND:
- case google_apis::HTTP_GONE:
- return SYNC_FILE_ERROR_NOT_FOUND;
-
- case google_apis::GDATA_FILE_ERROR:
- return SYNC_FILE_ERROR_FAILED;
-
- case google_apis::HTTP_FORBIDDEN:
- return SYNC_STATUS_ACCESS_FORBIDDEN;
-
- case google_apis::HTTP_RESUME_INCOMPLETE:
- case google_apis::HTTP_BAD_REQUEST:
- case google_apis::HTTP_LENGTH_REQUIRED:
- case google_apis::HTTP_NOT_IMPLEMENTED:
- case google_apis::GDATA_PARSE_ERROR:
- case google_apis::GDATA_OTHER_ERROR:
- return SYNC_STATUS_FAILED;
-
- case google_apis::GDATA_NO_SPACE:
- return SYNC_FILE_ERROR_NO_SPACE;
- }
-
- // There's a case where DriveService layer returns GDataErrorCode==-1
- // when network is unavailable. (http://crbug.com/223042)
- // TODO(kinuko,nhiroki): We should identify from where this undefined error
- // code is coming.
- if (error == -1)
- return SYNC_STATUS_NETWORK_ERROR;
-
- util::Log(logging::LOG_WARNING,
- FROM_HERE,
- "Got unexpected error: %d",
- static_cast<int>(error));
- return SYNC_STATUS_FAILED;
-}
-
void SetDisableDriveAPI(bool flag) {
is_drive_api_disabled = flag;
}
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend_v1/drive_file_sync_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698