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

Unified Diff: sync/engine/sync_session_job.cc

Issue 13422003: sync: Refactor job ownership in SyncScheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/engine/sync_session_job.h ('k') | sync/engine/sync_session_job_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/sync_session_job.cc
diff --git a/sync/engine/sync_session_job.cc b/sync/engine/sync_session_job.cc
index 0195f80ce6d5f04e19aeef8a1a648e6f108c7a9c..84b491e92a7e5212b3f78bcac98e5717db825b65 100644
--- a/sync/engine/sync_session_job.cc
+++ b/sync/engine/sync_session_job.cc
@@ -18,8 +18,7 @@ SyncSessionJob::SyncSessionJob(
: purpose_(purpose),
source_info_(source_info),
scheduled_start_(start),
- config_params_(config_params),
- finished_(NOT_FINISHED) {
+ config_params_(config_params) {
}
#define ENUM_CASE(x) case x: return #x; break;
@@ -36,15 +35,9 @@ const char* SyncSessionJob::GetPurposeString(SyncSessionJob::Purpose purpose) {
#undef ENUM_CASE
bool SyncSessionJob::Finish(bool early_exit, sessions::SyncSession* session) {
- DCHECK_EQ(finished_, NOT_FINISHED);
- // Did we run through all SyncerSteps from start_step() to end_step()
- // until the SyncSession returned !HasMoreToSync()?
- // Note: if not, it's possible the scheduler hasn't started with
- // SyncShare yet, it's possible there is still more to sync in the session,
- // and it's also possible the job quit part way through due to a premature
- // exit condition (such as shutdown).
- finished_ = early_exit ? EARLY_EXIT : FINISHED;
-
+ // Did we quit part-way through due to premature exit condition, like
+ // shutdown? Note that this branch will not be hit for other kinds
+ // of early return scenarios, like certain kinds of transient errors.
if (early_exit)
return false;
@@ -75,12 +68,6 @@ bool SyncSessionJob::Finish(bool early_exit, sessions::SyncSession* session) {
return true;
}
-scoped_ptr<SyncSessionJob> SyncSessionJob::Clone() const {
- return scoped_ptr<SyncSessionJob>(new SyncSessionJob(
- purpose_, scheduled_start_, source_info_,
- config_params_));
-}
-
void SyncSessionJob::CoalesceSources(const sessions::SyncSourceInfo& source) {
CoalesceStates(source.types, &source_info_.types);
source_info_.updates_source = source.updates_source;
« no previous file with comments | « sync/engine/sync_session_job.h ('k') | sync/engine/sync_session_job_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698