Chromium Code Reviews| 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 "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_); |
|
rlarocque
2012/09/08 01:20:44
This is unfortunate. The only implementation of D
| |
| 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 |
| OLD | NEW |