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/frontend_data_type_controller.h" | 5 #include "chrome/browser/sync/glue/frontend_data_type_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/sync/glue/change_processor.h" | 9 #include "chrome/browser/sync/glue/change_processor.h" |
| 10 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" | 10 #include "chrome/browser/sync/glue/chrome_report_unrecoverable_error.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 start_callback_ = start_callback; | 82 start_callback_ = start_callback; |
| 83 state_ = ASSOCIATING; | 83 state_ = ASSOCIATING; |
| 84 if (!Associate()) { | 84 if (!Associate()) { |
| 85 // We failed to associate and are aborting. | 85 // We failed to associate and are aborting. |
| 86 DCHECK(state_ == DISABLED || state_ == NOT_RUNNING); | 86 DCHECK(state_ == DISABLED || state_ == NOT_RUNNING); |
| 87 return; | 87 return; |
| 88 } | 88 } |
| 89 DCHECK_EQ(state_, RUNNING); | 89 DCHECK_EQ(state_, RUNNING); |
| 90 } | 90 } |
| 91 | 91 |
| 92 | |
|
tim (not reviewing)
2012/05/23 03:18:52
extra newlines
lipalani1
2012/05/23 17:47:20
Done.
| |
| 93 | |
| 92 void FrontendDataTypeController::Stop() { | 94 void FrontendDataTypeController::Stop() { |
| 93 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 95 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 94 | 96 |
| 95 State prev_state = state_; | 97 State prev_state = state_; |
| 96 state_ = STOPPING; | 98 state_ = STOPPING; |
| 97 | 99 |
| 98 // If Stop() is called while Start() is waiting for the datatype model to | 100 // If Stop() is called while Start() is waiting for the datatype model to |
| 99 // load, abort the start. | 101 // load, abort the start. |
| 100 if (prev_state == MODEL_STARTING) { | 102 if (prev_state == MODEL_STARTING) { |
| 101 AbortModelLoad(); | 103 AbortModelLoad(); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 298 ChangeProcessor* FrontendDataTypeController::change_processor() const { | 300 ChangeProcessor* FrontendDataTypeController::change_processor() const { |
| 299 return change_processor_.get(); | 301 return change_processor_.get(); |
| 300 } | 302 } |
| 301 | 303 |
| 302 void FrontendDataTypeController::set_change_processor( | 304 void FrontendDataTypeController::set_change_processor( |
| 303 ChangeProcessor* change_processor) { | 305 ChangeProcessor* change_processor) { |
| 304 change_processor_.reset(change_processor); | 306 change_processor_.reset(change_processor); |
| 305 } | 307 } |
| 306 | 308 |
| 307 } // namespace browser_sync | 309 } // namespace browser_sync |
| OLD | NEW |