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

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

Issue 2422253002: [Sync] Rewriting ".reset(new" pattern to use "= base::MakeUnique" instead. (Closed)
Patch Set: Fixing compile. Created 4 years, 2 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 "components/sync/syncable/directory.h" 12 #include "components/sync/syncable/directory.h"
12 13
13 namespace syncer { 14 namespace syncer {
14 15
15 // static 16 // static
16 SyncCycle* SyncCycle::Build(SyncCycleContext* context, Delegate* delegate) { 17 SyncCycle* SyncCycle::Build(SyncCycleContext* context, Delegate* delegate) {
17 return new SyncCycle(context, delegate); 18 return new SyncCycle(context, delegate);
18 } 19 }
19 20
20 SyncCycle::SyncCycle(SyncCycleContext* context, Delegate* delegate) 21 SyncCycle::SyncCycle(SyncCycleContext* context, Delegate* delegate)
21 : context_(context), delegate_(delegate) { 22 : context_(context), delegate_(delegate) {
22 status_controller_.reset(new StatusController()); 23 status_controller_ = base::MakeUnique<StatusController>();
23 } 24 }
24 25
25 SyncCycle::~SyncCycle() {} 26 SyncCycle::~SyncCycle() {}
26 27
27 SyncCycleSnapshot SyncCycle::TakeSnapshot() const { 28 SyncCycleSnapshot SyncCycle::TakeSnapshot() const {
28 return TakeSnapshotWithSource(sync_pb::GetUpdatesCallerInfo::UNKNOWN); 29 return TakeSnapshotWithSource(sync_pb::GetUpdatesCallerInfo::UNKNOWN);
29 } 30 }
30 31
31 SyncCycleSnapshot SyncCycle::TakeSnapshotWithSource( 32 SyncCycleSnapshot SyncCycle::TakeSnapshotWithSource(
32 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source) 33 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource legacy_updates_source)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()), 78 FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()),
78 OnSyncCycleEvent(event)); 79 OnSyncCycleEvent(event));
79 } 80 }
80 81
81 void SyncCycle::SendProtocolEvent(const ProtocolEvent& event) { 82 void SyncCycle::SendProtocolEvent(const ProtocolEvent& event) {
82 FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()), 83 FOR_EACH_OBSERVER(SyncEngineEventListener, *(context_->listeners()),
83 OnProtocolEvent(event)); 84 OnProtocolEvent(event));
84 } 85 }
85 86
86 } // namespace syncer 87 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698