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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 observers_.Clear(); | 63 observers_.Clear(); |
64 } | 64 } |
65 | 65 |
66 void SyncWorker::Initialize(scoped_ptr<SyncEngineContext> context) { | 66 void SyncWorker::Initialize(scoped_ptr<SyncEngineContext> context) { |
67 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); | 67 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); |
68 DCHECK(!task_manager_); | 68 DCHECK(!task_manager_); |
69 | 69 |
70 context_ = context.Pass(); | 70 context_ = context.Pass(); |
71 | 71 |
72 task_manager_.reset(new SyncTaskManager( | 72 task_manager_.reset(new SyncTaskManager( |
73 weak_ptr_factory_.GetWeakPtr(), 0 /* maximum_background_task */)); | 73 weak_ptr_factory_.GetWeakPtr(), 0 /* maximum_background_task */, |
| 74 context_->GetWorkerTaskRunner())); |
74 task_manager_->Initialize(SYNC_STATUS_OK); | 75 task_manager_->Initialize(SYNC_STATUS_OK); |
75 | 76 |
76 PostInitializeTask(); | 77 PostInitializeTask(); |
77 | 78 |
78 net::NetworkChangeNotifier::ConnectionType type = | 79 net::NetworkChangeNotifier::ConnectionType type = |
79 net::NetworkChangeNotifier::GetConnectionType(); | 80 net::NetworkChangeNotifier::GetConnectionType(); |
80 network_available_ = | 81 network_available_ = |
81 type != net::NetworkChangeNotifier::CONNECTION_NONE; | 82 type != net::NetworkChangeNotifier::CONNECTION_NONE; |
82 } | 83 } |
83 | 84 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 "Service state changed: %d->%d: %s", | 742 "Service state changed: %d->%d: %s", |
742 old_state, GetCurrentState(), description.c_str()); | 743 old_state, GetCurrentState(), description.c_str()); |
743 | 744 |
744 FOR_EACH_OBSERVER( | 745 FOR_EACH_OBSERVER( |
745 Observer, observers_, | 746 Observer, observers_, |
746 UpdateServiceState(GetCurrentState(), description)); | 747 UpdateServiceState(GetCurrentState(), description)); |
747 } | 748 } |
748 | 749 |
749 } // namespace drive_backend | 750 } // namespace drive_backend |
750 } // namespace sync_file_system | 751 } // namespace sync_file_system |
OLD | NEW |