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

Side by Side Diff: chrome/browser/sync/glue/change_processor.cc

Issue 10911073: NOT FOR COMMIT: Add DeviceInfo type and ChangeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix several issues Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/glue/DEPS ('k') | chrome/browser/sync/glue/device_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/sync/glue/change_processor.h" 5 #include "chrome/browser/sync/glue/change_processor.h"
6 #include "chrome/browser/profiles/profile.h" 6 #include "chrome/browser/profiles/profile.h"
7 7
8 namespace browser_sync { 8 namespace browser_sync {
9 9
10 ChangeProcessor::ChangeProcessor(DataTypeErrorHandler* error_handler) 10 ChangeProcessor::ChangeProcessor(DataTypeErrorHandler* error_handler)
11 : running_(false), 11 : running_(false),
12 error_handler_(error_handler), 12 error_handler_(error_handler),
13 share_handle_(NULL) {} 13 share_handle_(NULL) {}
14 14
15 ChangeProcessor::~ChangeProcessor() { 15 ChangeProcessor::~ChangeProcessor() {
16 DCHECK(!running_) << "ChangeProcessor dtor while running"; 16 DCHECK(!running_) << "ChangeProcessor dtor while running";
17 } 17 }
18 18
19 void ChangeProcessor::Start(Profile* profile, 19 void ChangeProcessor::Start(Profile* profile,
20 syncer::UserShare* share_handle) { 20 syncer::UserShare* share_handle) {
21 DCHECK(error_handler_ && !share_handle_); 21 DCHECK(!share_handle_);
22 share_handle_ = share_handle; 22 share_handle_ = share_handle;
23 StartImpl(profile); 23 StartImpl(profile);
24 running_ = true; 24 running_ = true;
25 } 25 }
26 26
27 void ChangeProcessor::Stop() { 27 void ChangeProcessor::Stop() {
28 if (!running_) 28 if (!running_)
29 return; 29 return;
30 StopImpl(); 30 StopImpl();
31 share_handle_ = NULL; 31 share_handle_ = NULL;
32 running_ = false; 32 running_ = false;
33 } 33 }
34 34
35 bool ChangeProcessor::IsRunning() const { 35 bool ChangeProcessor::IsRunning() const {
36 return running_; 36 return running_;
37 } 37 }
38 38
39 // Not implemented by default. 39 // Not implemented by default.
40 void ChangeProcessor::CommitChangesFromSyncModel() {} 40 void ChangeProcessor::CommitChangesFromSyncModel() {}
41 41
42 DataTypeErrorHandler* ChangeProcessor::error_handler() const { 42 DataTypeErrorHandler* ChangeProcessor::error_handler() const {
43 return error_handler_; 43 return error_handler_;
44 } 44 }
45 45
46 syncer::UserShare* ChangeProcessor::share_handle() const { 46 syncer::UserShare* ChangeProcessor::share_handle() const {
47 return share_handle_; 47 return share_handle_;
48 } 48 }
49 49
50 } // namespace browser_sync 50 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/DEPS ('k') | chrome/browser/sync/glue/device_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698