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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 } | 420 } |
421 } | 421 } |
422 | 422 |
423 void SyncWorker::PostInitializeTask() { | 423 void SyncWorker::PostInitializeTask() { |
424 DCHECK(!GetMetadataDatabase()); | 424 DCHECK(!GetMetadataDatabase()); |
425 | 425 |
426 // This initializer task may not run if MetadataDatabase in context_ is | 426 // This initializer task may not run if MetadataDatabase in context_ is |
427 // already initialized when it runs. | 427 // already initialized when it runs. |
428 SyncEngineInitializer* initializer = | 428 SyncEngineInitializer* initializer = |
429 new SyncEngineInitializer(context_.get(), | 429 new SyncEngineInitializer(context_.get(), |
430 context_->GetFileTaskRunner(), | |
431 base_dir_.Append(kDatabaseName), | 430 base_dir_.Append(kDatabaseName), |
432 env_override_); | 431 env_override_); |
433 task_manager_->ScheduleSyncTask( | 432 task_manager_->ScheduleSyncTask( |
434 FROM_HERE, | 433 FROM_HERE, |
435 scoped_ptr<SyncTask>(initializer), | 434 scoped_ptr<SyncTask>(initializer), |
436 SyncTaskManager::PRIORITY_HIGH, | 435 SyncTaskManager::PRIORITY_HIGH, |
437 base::Bind(&SyncWorker::DidInitialize, | 436 base::Bind(&SyncWorker::DidInitialize, |
438 weak_ptr_factory_.GetWeakPtr(), | 437 weak_ptr_factory_.GetWeakPtr(), |
439 initializer)); | 438 initializer)); |
440 } | 439 } |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 "Service state changed: %d->%d: %s", | 705 "Service state changed: %d->%d: %s", |
707 old_state, GetCurrentState(), description.c_str()); | 706 old_state, GetCurrentState(), description.c_str()); |
708 | 707 |
709 FOR_EACH_OBSERVER( | 708 FOR_EACH_OBSERVER( |
710 Observer, observers_, | 709 Observer, observers_, |
711 UpdateServiceState(GetCurrentState(), description)); | 710 UpdateServiceState(GetCurrentState(), description)); |
712 } | 711 } |
713 | 712 |
714 } // namespace drive_backend | 713 } // namespace drive_backend |
715 } // namespace sync_file_system | 714 } // namespace sync_file_system |
OLD | NEW |