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_service.h" | 5 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 base::Bind(&DriveFileSyncService::DidDownloadFileForRemoteSync, | 1538 base::Bind(&DriveFileSyncService::DidDownloadFileForRemoteSync, |
1539 AsWeakPtr(), base::Passed(¶m))); | 1539 AsWeakPtr(), base::Passed(¶m))); |
1540 } | 1540 } |
1541 | 1541 |
1542 void DriveFileSyncService::DidDownloadFileForRemoteSync( | 1542 void DriveFileSyncService::DidDownloadFileForRemoteSync( |
1543 scoped_ptr<ProcessRemoteChangeParam> param, | 1543 scoped_ptr<ProcessRemoteChangeParam> param, |
1544 google_apis::GDataErrorCode error, | 1544 google_apis::GDataErrorCode error, |
1545 const std::string& md5_checksum) { | 1545 const std::string& md5_checksum) { |
1546 if (error == google_apis::HTTP_NOT_MODIFIED) { | 1546 if (error == google_apis::HTTP_NOT_MODIFIED) { |
1547 param->sync_action = fileapi::SYNC_ACTION_NONE; | 1547 param->sync_action = fileapi::SYNC_ACTION_NONE; |
1548 CompleteRemoteSync(param.Pass(), fileapi::SYNC_STATUS_OK); | 1548 DidApplyRemoteChange(param.Pass(), fileapi::SYNC_STATUS_OK); |
1549 return; | 1549 return; |
1550 } | 1550 } |
1551 | 1551 |
1552 fileapi::SyncStatusCode status = GDataErrorCodeToSyncStatusCodeWrapper(error); | 1552 fileapi::SyncStatusCode status = GDataErrorCodeToSyncStatusCodeWrapper(error); |
1553 if (status != fileapi::SYNC_STATUS_OK) { | 1553 if (status != fileapi::SYNC_STATUS_OK) { |
1554 AbortRemoteSync(param.Pass(), status); | 1554 AbortRemoteSync(param.Pass(), status); |
1555 return; | 1555 return; |
1556 } | 1556 } |
1557 | 1557 |
1558 param->drive_metadata.set_md5_checksum(md5_checksum); | 1558 param->drive_metadata.set_md5_checksum(md5_checksum); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2022 fileapi::SyncStatusCode | 2022 fileapi::SyncStatusCode |
2023 DriveFileSyncService::GDataErrorCodeToSyncStatusCodeWrapper( | 2023 DriveFileSyncService::GDataErrorCodeToSyncStatusCodeWrapper( |
2024 google_apis::GDataErrorCode error) const { | 2024 google_apis::GDataErrorCode error) const { |
2025 fileapi::SyncStatusCode status = GDataErrorCodeToSyncStatusCode(error); | 2025 fileapi::SyncStatusCode status = GDataErrorCodeToSyncStatusCode(error); |
2026 if (status != fileapi::SYNC_STATUS_OK && !sync_client_->IsAuthenticated()) | 2026 if (status != fileapi::SYNC_STATUS_OK && !sync_client_->IsAuthenticated()) |
2027 return fileapi::SYNC_STATUS_AUTHENTICATION_FAILED; | 2027 return fileapi::SYNC_STATUS_AUTHENTICATION_FAILED; |
2028 return status; | 2028 return status; |
2029 } | 2029 } |
2030 | 2030 |
2031 } // namespace sync_file_system | 2031 } // namespace sync_file_system |
OLD | NEW |