| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_worker.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/sync_worker.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 bool used_network) { | 310 bool used_network) { |
| 311 UpdateServiceStateFromSyncStatusCode(status, used_network); | 311 UpdateServiceStateFromSyncStatusCode(status, used_network); |
| 312 | 312 |
| 313 if (GetMetadataDatabase()) { | 313 if (GetMetadataDatabase()) { |
| 314 FOR_EACH_OBSERVER( | 314 FOR_EACH_OBSERVER( |
| 315 Observer, observers_, | 315 Observer, observers_, |
| 316 OnPendingFileListUpdated(GetMetadataDatabase()->CountDirtyTracker())); | 316 OnPendingFileListUpdated(GetMetadataDatabase()->CountDirtyTracker())); |
| 317 } | 317 } |
| 318 } | 318 } |
| 319 | 319 |
| 320 void SyncWorker::RecordTaskLog(scoped_ptr<TaskLogger::TaskLog> task_log) { |
| 321 context_->GetUITaskRunner()->PostTask( |
| 322 FROM_HERE, |
| 323 base::Bind(&TaskLogger::RecordLog, |
| 324 context_->GetTaskLogger(), |
| 325 base::Passed(&task_log))); |
| 326 } |
| 327 |
| 320 void SyncWorker::OnNotificationReceived() { | 328 void SyncWorker::OnNotificationReceived() { |
| 321 if (service_state_ == REMOTE_SERVICE_TEMPORARY_UNAVAILABLE) | 329 if (service_state_ == REMOTE_SERVICE_TEMPORARY_UNAVAILABLE) |
| 322 UpdateServiceState(REMOTE_SERVICE_OK, "Got push notification for Drive."); | 330 UpdateServiceState(REMOTE_SERVICE_OK, "Got push notification for Drive."); |
| 323 | 331 |
| 324 should_check_remote_change_ = true; | 332 should_check_remote_change_ = true; |
| 325 MaybeScheduleNextTask(); | 333 MaybeScheduleNextTask(); |
| 326 } | 334 } |
| 327 | 335 |
| 328 void SyncWorker::OnReadyToSendRequests(const std::string& account_id) { | 336 void SyncWorker::OnReadyToSendRequests(const std::string& account_id) { |
| 329 if (service_state_ == REMOTE_SERVICE_OK) | 337 if (service_state_ == REMOTE_SERVICE_OK) |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 "Service state changed: %d->%d: %s", | 713 "Service state changed: %d->%d: %s", |
| 706 old_state, GetCurrentState(), description.c_str()); | 714 old_state, GetCurrentState(), description.c_str()); |
| 707 | 715 |
| 708 FOR_EACH_OBSERVER( | 716 FOR_EACH_OBSERVER( |
| 709 Observer, observers_, | 717 Observer, observers_, |
| 710 UpdateServiceState(GetCurrentState(), description)); | 718 UpdateServiceState(GetCurrentState(), description)); |
| 711 } | 719 } |
| 712 | 720 |
| 713 } // namespace drive_backend | 721 } // namespace drive_backend |
| 714 } // namespace sync_file_system | 722 } // namespace sync_file_system |
| OLD | NEW |