| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/sync/engine_impl/cycle/sync_cycle.h" | 5 #include "components/sync/engine_impl/cycle/sync_cycle.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "components/sync/syncable/directory.h" | 12 #include "components/sync/syncable/directory.h" |
| 13 | 13 |
| 14 namespace syncer { | 14 namespace syncer { |
| 15 | 15 |
| 16 // static | |
| 17 SyncCycle* SyncCycle::Build(SyncCycleContext* context, Delegate* delegate) { | |
| 18 return new SyncCycle(context, delegate); | |
| 19 } | |
| 20 | |
| 21 SyncCycle::SyncCycle(SyncCycleContext* context, Delegate* delegate) | 16 SyncCycle::SyncCycle(SyncCycleContext* context, Delegate* delegate) |
| 22 : context_(context), delegate_(delegate) { | 17 : context_(context), delegate_(delegate) { |
| 23 status_controller_ = base::MakeUnique<StatusController>(); | 18 status_controller_ = base::MakeUnique<StatusController>(); |
| 24 } | 19 } |
| 25 | 20 |
| 26 SyncCycle::~SyncCycle() {} | 21 SyncCycle::~SyncCycle() {} |
| 27 | 22 |
| 28 SyncCycleSnapshot SyncCycle::TakeSnapshot() const { | 23 SyncCycleSnapshot SyncCycle::TakeSnapshot() const { |
| 29 return TakeSnapshotWithSource(sync_pb::GetUpdatesCallerInfo::UNKNOWN); | 24 return TakeSnapshotWithSource(sync_pb::GetUpdatesCallerInfo::UNKNOWN); |
| 30 } | 25 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 for (auto& observer : *context_->listeners()) | 73 for (auto& observer : *context_->listeners()) |
| 79 observer.OnSyncCycleEvent(event); | 74 observer.OnSyncCycleEvent(event); |
| 80 } | 75 } |
| 81 | 76 |
| 82 void SyncCycle::SendProtocolEvent(const ProtocolEvent& event) { | 77 void SyncCycle::SendProtocolEvent(const ProtocolEvent& event) { |
| 83 for (auto& observer : *context_->listeners()) | 78 for (auto& observer : *context_->listeners()) |
| 84 observer.OnProtocolEvent(event); | 79 observer.OnProtocolEvent(event); |
| 85 } | 80 } |
| 86 | 81 |
| 87 } // namespace syncer | 82 } // namespace syncer |
| OLD | NEW |