Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Side by Side Diff: components/sync/engine_impl/cycle/sync_cycle.cc

Issue 2850213002: [Sync] Minor refactor around SyncCycle and ModelTypeSet usage. (Closed)
Patch Set: Fix comment grammar. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/sync/engine_impl/cycle/sync_cycle.h ('k') | components/sync/engine_impl/get_updates_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698