summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/util/syncer_error.h
diff options
context:
space:
mode:
authortim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-28 13:05:42 +0000
committertim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-28 13:05:42 +0000
commit70abaf0adbf88fb80d78f7088a1195a506690399 (patch)
tree798874040d19bb23fa6ff7a99c7eb82cf3c86797 /sync/internal_api/public/util/syncer_error.h
parentbc390f12b3be83a0698fae361e7c47dbf4270661 (diff)
downloadchromium_src-70abaf0adbf88fb80d78f7088a1195a506690399.zip
chromium_src-70abaf0adbf88fb80d78f7088a1195a506690399.tar.gz
chromium_src-70abaf0adbf88fb80d78f7088a1195a506690399.tar.bz2
sync: make scheduling logic and job ownership more obvious.
- inlines (and removes) SaveJob, to perform only the relevant "saving" bits where needed. As it turns out, most of it was only necessary for ShouldRunJob (which I'd like to rename, as it's destructive), and it's a lot easier to read what's happening and why. Note also removed TODO at SaveJob callsites. - inlines (and removes) InitOrCoalescePendingJob to perform only the relevant bits at each callsite. - pulls SyncSessionJob into a class, to handle basic responsibilities that need the job Purpose + session (like "Succeeded()" and "Finish") that were previously strewn about and partially copy/pasted in the scheduler. - meticulously transfers ownership (removes linked_ptr usage!) of jobs instead of making many implicit struct copies, as it resulted in non-obvious behavior. To do this, ownership is given to the scheduling mechanism (the MessageLoop for ScheduleSyncSessionJob, WaitInterval::timer for canary jobs), instead of jobs sitting around without knowing whether they're scheduled or not. There are a few cases where we can't actually "schedule" a job -- which wasn't even obvious from the old code, and other interesting revelations, like fact that we were actually pre-empt nudge canary jobs and "unscheduling" them in certain cases. - removes DoPendingJobIfPossible, since it is no longer needed for DoCanaryJob/Unthrottle cases, and make the behavior more explicit in the other cases (mode-switch and SCM error change), see TakePendingJobForCurrentMode. - removes the ability to create jobs as canary, since this wasn't needed and was adding complexity (see DoCanaryJob / GrantCanaryPrivilege). - removes retry_scheduled as it wasn't used anywhere - adds lots of comments. Also discovered that THROTTLED intervals seem to never fire a canary job with today's code (broken), config jobs are immune to per-data-type throttling, and the had_nudge allowance was defeated by extra IsBackingOff check in ScheduleNudgeImpl (see comment on review). BUG= Review URL: https://chromiumcodereview.appspot.com/10917234 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/public/util/syncer_error.h')
-rw-r--r--sync/internal_api/public/util/syncer_error.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sync/internal_api/public/util/syncer_error.h b/sync/internal_api/public/util/syncer_error.h
index ff184e3..478d888 100644
--- a/sync/internal_api/public/util/syncer_error.h
+++ b/sync/internal_api/public/util/syncer_error.h
@@ -28,6 +28,8 @@ enum SyncerError {
// Based on values returned by server. Most are defined in sync.proto.
SERVER_RETURN_INVALID_CREDENTIAL,
+ FIRST_SERVER_RETURN_VALUE = SERVER_RETURN_INVALID_CREDENTIAL,
+
SERVER_RETURN_UNKNOWN_ERROR,
SERVER_RETURN_THROTTLED,
SERVER_RETURN_TRANSIENT_ERROR,