| 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/sync_engine.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_engine.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/drive/drive_api_service.h" | 10 #include "chrome/browser/drive/drive_api_service.h" |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 void SyncEngine::DownloadRemoteVersion( | 294 void SyncEngine::DownloadRemoteVersion( |
| 295 const fileapi::FileSystemURL& url, | 295 const fileapi::FileSystemURL& url, |
| 296 const std::string& version_id, | 296 const std::string& version_id, |
| 297 const DownloadVersionCallback& callback) { | 297 const DownloadVersionCallback& callback) { |
| 298 // TODO(tzik): Implement this before we support manual conflict resolution. | 298 // TODO(tzik): Implement this before we support manual conflict resolution. |
| 299 callback.Run(SYNC_STATUS_FAILED, webkit_blob::ScopedFile()); | 299 callback.Run(SYNC_STATUS_FAILED, webkit_blob::ScopedFile()); |
| 300 } | 300 } |
| 301 | 301 |
| 302 void SyncEngine::PromoteDemotedChanges() { | 302 void SyncEngine::PromoteDemotedChanges() { |
| 303 if (metadata_database_) | 303 if (metadata_database_ && metadata_database_->HasLowPriorityDirtyTracker()) { |
| 304 metadata_database_->PromoteLowerPriorityTrackersToNormal(); | 304 metadata_database_->PromoteLowerPriorityTrackersToNormal(); |
| 305 FOR_EACH_OBSERVER( |
| 306 Observer, |
| 307 service_observers_, |
| 308 OnRemoteChangeQueueUpdated( |
| 309 metadata_database_->CountDirtyTracker())); |
| 310 } |
| 305 } | 311 } |
| 306 | 312 |
| 307 void SyncEngine::ApplyLocalChange( | 313 void SyncEngine::ApplyLocalChange( |
| 308 const FileChange& local_change, | 314 const FileChange& local_change, |
| 309 const base::FilePath& local_path, | 315 const base::FilePath& local_path, |
| 310 const SyncFileMetadata& local_metadata, | 316 const SyncFileMetadata& local_metadata, |
| 311 const fileapi::FileSystemURL& url, | 317 const fileapi::FileSystemURL& url, |
| 312 const SyncStatusCallback& callback) { | 318 const SyncStatusCallback& callback) { |
| 313 LocalToRemoteSyncer* syncer = new LocalToRemoteSyncer( | 319 LocalToRemoteSyncer* syncer = new LocalToRemoteSyncer( |
| 314 this, local_metadata, local_change, local_path, url); | 320 this, local_metadata, local_change, local_path, url); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; | 724 tracker.tracker_kind() == TRACKER_KIND_APP_ROOT; |
| 719 if (is_app_enabled && !is_app_root_tracker_enabled) | 725 if (is_app_enabled && !is_app_root_tracker_enabled) |
| 720 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); | 726 EnableOrigin(origin, base::Bind(&EmptyStatusCallback)); |
| 721 else if (!is_app_enabled && is_app_root_tracker_enabled) | 727 else if (!is_app_enabled && is_app_root_tracker_enabled) |
| 722 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); | 728 DisableOrigin(origin, base::Bind(&EmptyStatusCallback)); |
| 723 } | 729 } |
| 724 } | 730 } |
| 725 | 731 |
| 726 } // namespace drive_backend | 732 } // namespace drive_backend |
| 727 } // namespace sync_file_system | 733 } // namespace sync_file_system |
| OLD | NEW |