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 "sync/engine/sync_session_job.h" | 5 #include "sync/engine/sync_session_job.h" |
6 #include "sync/internal_api/public/sessions/model_neutral_state.h" | 6 #include "sync/internal_api/public/sessions/model_neutral_state.h" |
7 | 7 |
8 namespace syncer { | 8 namespace syncer { |
9 | 9 |
10 SyncSessionJob::~SyncSessionJob() {} | 10 SyncSessionJob::~SyncSessionJob() {} |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // until the SyncSession returned !HasMoreToSync()? | 43 // until the SyncSession returned !HasMoreToSync()? |
44 // Note: if not, it's possible the scheduler hasn't started with | 44 // Note: if not, it's possible the scheduler hasn't started with |
45 // SyncShare yet, it's possible there is still more to sync in the session, | 45 // SyncShare yet, it's possible there is still more to sync in the session, |
46 // and it's also possible the job quit part way through due to a premature | 46 // and it's also possible the job quit part way through due to a premature |
47 // exit condition (such as shutdown). | 47 // exit condition (such as shutdown). |
48 finished_ = early_exit ? EARLY_EXIT : FINISHED; | 48 finished_ = early_exit ? EARLY_EXIT : FINISHED; |
49 | 49 |
50 if (early_exit) | 50 if (early_exit) |
51 return false; | 51 return false; |
52 | 52 |
53 DCHECK(!session_->HasMoreToSync()); | |
54 | |
55 // Did we hit any errors along the way? | 53 // Did we hit any errors along the way? |
56 if (sessions::HasSyncerError( | 54 if (sessions::HasSyncerError( |
57 session_->status_controller().model_neutral_state())) { | 55 session_->status_controller().model_neutral_state())) { |
58 return false; | 56 return false; |
59 } | 57 } |
60 | 58 |
61 const sessions::ModelNeutralState& state( | 59 const sessions::ModelNeutralState& state( |
62 session_->status_controller().model_neutral_state()); | 60 session_->status_controller().model_neutral_state()); |
63 switch (purpose_) { | 61 switch (purpose_) { |
64 case POLL: | 62 case POLL: |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 return; | 173 return; |
176 default: | 174 default: |
177 NOTREACHED(); | 175 NOTREACHED(); |
178 *start = SYNCER_END; | 176 *start = SYNCER_END; |
179 *end = SYNCER_END; | 177 *end = SYNCER_END; |
180 return; | 178 return; |
181 } | 179 } |
182 } | 180 } |
183 | 181 |
184 } // namespace syncer | 182 } // namespace syncer |
OLD | NEW |