| 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_v1/local_sync_delegate.h
" | 5 #include "chrome/browser/sync_file_system/drive_backend_v1/local_sync_delegate.h
" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "chrome/browser/sync_file_system/conflict_resolution_resolver.h" | 9 #include "chrome/browser/sync_file_system/conflict_resolution_resolver.h" |
| 10 #include "chrome/browser/sync_file_system/drive_backend_v1/api_util.h" | 10 #include "chrome/browser/sync_file_system/drive_backend_v1/api_util.h" |
| 11 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_metadata_store.
h" | 11 #include "chrome/browser/sync_file_system/drive_backend_v1/drive_metadata_store.
h" |
| 12 #include "chrome/browser/sync_file_system/logger.h" | 12 #include "chrome/browser/sync_file_system/logger.h" |
| 13 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" | 13 #include "chrome/browser/sync_file_system/syncable_file_system_util.h" |
| 14 | 14 |
| 15 namespace sync_file_system { | 15 namespace sync_file_system { |
| 16 namespace drive_backend { | 16 namespace drive_backend { |
| 17 | 17 |
| 18 LocalSyncDelegate::LocalSyncDelegate( | 18 LocalSyncDelegate::LocalSyncDelegate(DriveFileSyncService* sync_service, |
| 19 DriveFileSyncService* sync_service, | 19 const FileChange& local_change, |
| 20 const FileChange& local_change, | 20 const base::FilePath& local_path, |
| 21 const base::FilePath& local_path, | 21 const SyncFileMetadata& local_metadata, |
| 22 const SyncFileMetadata& local_metadata, | 22 const storage::FileSystemURL& url) |
| 23 const fileapi::FileSystemURL& url) | |
| 24 : sync_service_(sync_service), | 23 : sync_service_(sync_service), |
| 25 operation_(SYNC_OPERATION_NONE), | 24 operation_(SYNC_OPERATION_NONE), |
| 26 url_(url), | 25 url_(url), |
| 27 local_change_(local_change), | 26 local_change_(local_change), |
| 28 local_path_(local_path), | 27 local_path_(local_path), |
| 29 local_metadata_(local_metadata), | 28 local_metadata_(local_metadata), |
| 30 has_drive_metadata_(false), | 29 has_drive_metadata_(false), |
| 31 has_remote_change_(false), | 30 has_remote_change_(false), |
| 32 weak_factory_(this) {} | 31 weak_factory_(this) { |
| 32 } |
| 33 | 33 |
| 34 LocalSyncDelegate::~LocalSyncDelegate() {} | 34 LocalSyncDelegate::~LocalSyncDelegate() {} |
| 35 | 35 |
| 36 void LocalSyncDelegate::Run(const SyncStatusCallback& callback) { | 36 void LocalSyncDelegate::Run(const SyncStatusCallback& callback) { |
| 37 DCHECK(!local_change_.IsDirectory()); | 37 DCHECK(!local_change_.IsDirectory()); |
| 38 operation_ = SYNC_OPERATION_NONE; | 38 operation_ = SYNC_OPERATION_NONE; |
| 39 | 39 |
| 40 has_drive_metadata_ = | 40 has_drive_metadata_ = |
| 41 metadata_store()->ReadEntry(url_, &drive_metadata_) == SYNC_STATUS_OK; | 41 metadata_store()->ReadEntry(url_, &drive_metadata_) == SYNC_STATUS_OK; |
| 42 | 42 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 RemoteChangeHandler* LocalSyncDelegate::remote_change_handler() { | 584 RemoteChangeHandler* LocalSyncDelegate::remote_change_handler() { |
| 585 return &sync_service_->remote_change_handler_; | 585 return &sync_service_->remote_change_handler_; |
| 586 } | 586 } |
| 587 | 587 |
| 588 ConflictResolutionResolver* LocalSyncDelegate::conflict_resolution_resolver() { | 588 ConflictResolutionResolver* LocalSyncDelegate::conflict_resolution_resolver() { |
| 589 return &sync_service_->conflict_resolution_resolver_; | 589 return &sync_service_->conflict_resolution_resolver_; |
| 590 } | 590 } |
| 591 | 591 |
| 592 } // namespace drive_backend | 592 } // namespace drive_backend |
| 593 } // namespace sync_file_system | 593 } // namespace sync_file_system |
| OLD | NEW |