| 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 "chrome/browser/drive/drive_service_interface.h" | 10 #include "chrome/browser/drive/drive_service_interface.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 void SyncWorker::Initialize(scoped_ptr<SyncEngineContext> context) { | 68 void SyncWorker::Initialize(scoped_ptr<SyncEngineContext> context) { |
| 69 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 69 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
| 70 DCHECK(!task_manager_); | 70 DCHECK(!task_manager_); |
| 71 | 71 |
| 72 context_ = context.Pass(); | 72 context_ = context.Pass(); |
| 73 | 73 |
| 74 task_manager_.reset(new SyncTaskManager( | 74 task_manager_.reset(new SyncTaskManager( |
| 75 weak_ptr_factory_.GetWeakPtr(), 0 /* maximum_background_task */, | 75 weak_ptr_factory_.GetWeakPtr(), 0 /* maximum_background_task */, |
| 76 context_->GetWorkerTaskRunner())); | 76 context_->GetWorkerTaskRunner(), |
| 77 context_->GetWorkerPool())); |
| 77 task_manager_->Initialize(SYNC_STATUS_OK); | 78 task_manager_->Initialize(SYNC_STATUS_OK); |
| 78 | 79 |
| 79 PostInitializeTask(); | 80 PostInitializeTask(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void SyncWorker::RegisterOrigin( | 83 void SyncWorker::RegisterOrigin( |
| 83 const GURL& origin, | 84 const GURL& origin, |
| 84 const SyncStatusCallback& callback) { | 85 const SyncStatusCallback& callback) { |
| 85 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 86 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
| 86 | 87 |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 return context_->GetDriveUploader(); | 715 return context_->GetDriveUploader(); |
| 715 } | 716 } |
| 716 | 717 |
| 717 MetadataDatabase* SyncWorker::GetMetadataDatabase() { | 718 MetadataDatabase* SyncWorker::GetMetadataDatabase() { |
| 718 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 719 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
| 719 return context_->GetMetadataDatabase(); | 720 return context_->GetMetadataDatabase(); |
| 720 } | 721 } |
| 721 | 722 |
| 722 } // namespace drive_backend | 723 } // namespace drive_backend |
| 723 } // namespace sync_file_system | 724 } // namespace sync_file_system |
| OLD | NEW |