| 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 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 | 1067 |
| 1068 RemoteChange remote_change; | 1068 RemoteChange remote_change; |
| 1069 const bool has_remote_change = GetPendingChangeForFileSystemURL( | 1069 const bool has_remote_change = GetPendingChangeForFileSystemURL( |
| 1070 url, &remote_change); | 1070 url, &remote_change); |
| 1071 if (has_remote_change && param->drive_metadata.resource_id().empty()) | 1071 if (has_remote_change && param->drive_metadata.resource_id().empty()) |
| 1072 param->drive_metadata.set_resource_id(remote_change.resource_id); | 1072 param->drive_metadata.set_resource_id(remote_change.resource_id); |
| 1073 | 1073 |
| 1074 LocalSyncOperationType operation = | 1074 LocalSyncOperationType operation = |
| 1075 LocalSyncOperationResolver::Resolve( | 1075 LocalSyncOperationResolver::Resolve( |
| 1076 local_file_change, | 1076 local_file_change, |
| 1077 has_remote_change, | 1077 has_remote_change ? &remote_change.change : NULL, |
| 1078 remote_change.change, | |
| 1079 param->has_drive_metadata ? &drive_metadata : NULL); | 1078 param->has_drive_metadata ? &drive_metadata : NULL); |
| 1080 | 1079 |
| 1081 DVLOG(1) << "ApplyLocalChange for " << url.DebugString() | 1080 DVLOG(1) << "ApplyLocalChange for " << url.DebugString() |
| 1082 << " local_change:" << local_file_change.DebugString() | 1081 << " local_change:" << local_file_change.DebugString() |
| 1083 << " ==> operation:" << operation; | 1082 << " ==> operation:" << operation; |
| 1084 | 1083 |
| 1085 switch (operation) { | 1084 switch (operation) { |
| 1086 case LOCAL_SYNC_OPERATION_ADD_FILE: | 1085 case LOCAL_SYNC_OPERATION_ADD_FILE: |
| 1087 sync_client_->UploadNewFile( | 1086 sync_client_->UploadNewFile( |
| 1088 origin_resource_id, | 1087 origin_resource_id, |
| (...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2419 pending_batch_sync_origins_.insert(origin); | 2418 pending_batch_sync_origins_.insert(origin); |
| 2420 } | 2419 } |
| 2421 callback.Run(status, resource_id); | 2420 callback.Run(status, resource_id); |
| 2422 } | 2421 } |
| 2423 | 2422 |
| 2424 std::string DriveFileSyncService::sync_root_resource_id() { | 2423 std::string DriveFileSyncService::sync_root_resource_id() { |
| 2425 return metadata_store_->sync_root_directory(); | 2424 return metadata_store_->sync_root_directory(); |
| 2426 } | 2425 } |
| 2427 | 2426 |
| 2428 } // namespace sync_file_system | 2427 } // namespace sync_file_system |
| OLD | NEW |