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

Side by Side Diff: components/sync/driver/change_processor.cc

Issue 2289143003: [Sync] Convert DTCs to be not RefCounted and NonThreadSafe. (Closed)
Patch Set: Rebase. Created 4 years, 3 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 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 "components/sync/driver/change_processor.h" 5 #include "components/sync/driver/change_processor.h"
6 6
7 #include <utility>
8
7 namespace sync_driver { 9 namespace sync_driver {
8 10
9 ChangeProcessor::ChangeProcessor(syncer::DataTypeErrorHandler* error_handler) 11 ChangeProcessor::ChangeProcessor(
10 : error_handler_(error_handler), share_handle_(NULL) {} 12 std::unique_ptr<syncer::DataTypeErrorHandler> error_handler)
13 : error_handler_(std::move(error_handler)), share_handle_(NULL) {}
11 14
12 ChangeProcessor::~ChangeProcessor() {} 15 ChangeProcessor::~ChangeProcessor() {}
13 16
14 void ChangeProcessor::Start(syncer::UserShare* share_handle) { 17 void ChangeProcessor::Start(syncer::UserShare* share_handle) {
15 DCHECK(!share_handle_); 18 DCHECK(!share_handle_);
16 share_handle_ = share_handle; 19 share_handle_ = share_handle;
17 StartImpl(); 20 StartImpl();
18 } 21 }
19 22
20 // Not implemented by default. 23 // Not implemented by default.
21 void ChangeProcessor::CommitChangesFromSyncModel() {} 24 void ChangeProcessor::CommitChangesFromSyncModel() {}
22 25
23 syncer::DataTypeErrorHandler* ChangeProcessor::error_handler() const { 26 syncer::DataTypeErrorHandler* ChangeProcessor::error_handler() const {
24 return error_handler_; 27 return error_handler_.get();
25 } 28 }
26 29
27 syncer::UserShare* ChangeProcessor::share_handle() const { 30 syncer::UserShare* ChangeProcessor::share_handle() const {
28 return share_handle_; 31 return share_handle_;
29 } 32 }
30 33
31 } // namespace sync_driver 34 } // namespace sync_driver
OLDNEW
« no previous file with comments | « components/sync/driver/change_processor.h ('k') | components/sync/driver/change_processor_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698