| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_backend/folder_creator.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/folder_creator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" | 10 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" |
| 10 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" | 11 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
| 11 #include "components/drive/drive_api_util.h" | 12 #include "components/drive/drive_api_util.h" |
| 12 #include "components/drive/service/drive_service_interface.h" | 13 #include "components/drive/service/drive_service_interface.h" |
| 13 #include "google_apis/drive/drive_api_parser.h" | 14 #include "google_apis/drive/drive_api_parser.h" |
| 14 | 15 |
| 15 namespace drive { | 16 namespace drive { |
| 16 class DriveServiceInterface; | 17 class DriveServiceInterface; |
| 17 class DriveUploaderInterface; | 18 class DriveUploaderInterface; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 oldest = &entry; | 103 oldest = &entry; |
| 103 } | 104 } |
| 104 | 105 |
| 105 if (!oldest) { | 106 if (!oldest) { |
| 106 callback.Run(std::string(), SYNC_FILE_ERROR_NOT_FOUND); | 107 callback.Run(std::string(), SYNC_FILE_ERROR_NOT_FOUND); |
| 107 return; | 108 return; |
| 108 } | 109 } |
| 109 | 110 |
| 110 std::string file_id = oldest->file_id(); | 111 std::string file_id = oldest->file_id(); |
| 111 | 112 |
| 112 status = metadata_database_->UpdateByFileResourceList(candidates.Pass()); | 113 status = metadata_database_->UpdateByFileResourceList(std::move(candidates)); |
| 113 if (status != SYNC_STATUS_OK) { | 114 if (status != SYNC_STATUS_OK) { |
| 114 callback.Run(std::string(), status); | 115 callback.Run(std::string(), status); |
| 115 return; | 116 return; |
| 116 } | 117 } |
| 117 | 118 |
| 118 DCHECK(!file_id.empty()); | 119 DCHECK(!file_id.empty()); |
| 119 if (!metadata_database_->FindFileByFileID(file_id, nullptr)) { | 120 if (!metadata_database_->FindFileByFileID(file_id, nullptr)) { |
| 120 callback.Run(std::string(), SYNC_FILE_ERROR_NOT_FOUND); | 121 callback.Run(std::string(), SYNC_FILE_ERROR_NOT_FOUND); |
| 121 return; | 122 return; |
| 122 } | 123 } |
| 123 | 124 |
| 124 callback.Run(file_id, status); | 125 callback.Run(file_id, status); |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace drive_backend | 128 } // namespace drive_backend |
| 128 } // namespace sync_file_system | 129 } // namespace sync_file_system |
| OLD | NEW |