Lines Matching refs:job
170 const SyncSessionJob& job) {
173 DCHECK_NE(job.purpose, SyncSessionJob::CLEAR_USER_DATA);
177 << wait_interval_->had_nudge << "is canary job : "
178 << job.is_canary_job;
180 if (job.purpose == SyncSessionJob::POLL)
183 DCHECK(job.purpose == SyncSessionJob::NUDGE ||
184 job.purpose == SyncSessionJob::CONFIGURATION);
189 if (job.purpose == SyncSessionJob::NUDGE) {
197 // This is a config job.
198 return job.is_canary_job ? CONTINUE : SAVE;
202 const SyncSessionJob& job) {
203 if (job.purpose == SyncSessionJob::CLEAR_USER_DATA)
207 return DecideWhileInWaitInterval(job);
210 if (job.purpose == SyncSessionJob::NUDGE)
212 else if (job.purpose == SyncSessionJob::CONFIGURATION)
220 DCHECK_NE(job.purpose, SyncSessionJob::CONFIGURATION);
223 if (job.scheduled_start < last_sync_session_end_time_) {
225 << " Dropping job because of freshness";
233 << " Bad server connection. Using that to decide on job.";
234 return job.purpose == SyncSessionJob::NUDGE ? SAVE : DROP;
237 void SyncerThread::InitOrCoalescePendingJob(const SyncSessionJob& job) {
238 DCHECK(job.purpose != SyncSessionJob::CONFIGURATION);
241 << " Creating a pending nudge job";
242 SyncSession* s = job.session.get();
246 SyncSessionJob new_job(SyncSessionJob::NUDGE, job.scheduled_start,
247 make_linked_ptr(session.release()), false, job.nudge_location);
254 pending_nudge_->session->Coalesce(*(job.session.get()));
255 pending_nudge_->scheduled_start = job.scheduled_start;
261 bool SyncerThread::ShouldRunJob(const SyncSessionJob& job) {
262 JobProcessDecision decision = DecideOnJob(job);
263 VLOG(1) << "SyncerThread(" << this << ")" << " Should run job, decision: "
264 << decision << " Job purpose " << job.purpose << "mode " << mode_;
268 DCHECK(job.purpose == SyncSessionJob::NUDGE || job.purpose ==
271 SaveJob(job);
275 void SyncerThread::SaveJob(const SyncSessionJob& job) {
276 DCHECK(job.purpose != SyncSessionJob::CLEAR_USER_DATA);
277 if (job.purpose == SyncSessionJob::NUDGE) {
278 VLOG(1) << "SyncerThread(" << this << ")" << " Saving a nudge job";
279 InitOrCoalescePendingJob(job);
280 } else if (job.purpose == SyncSessionJob::CONFIGURATION){
281 VLOG(1) << "SyncerThread(" << this << ")" << " Saving a configuration job";
285 SyncSession* old = job.session.get();
288 SyncSessionJob new_job(job.purpose, TimeTicks::Now(),
289 make_linked_ptr(s), false, job.nudge_location);
368 SyncSessionJob job(SyncSessionJob::NUDGE, TimeTicks::Now() + delay,
373 if (!ShouldRunJob(job))
384 pending_nudge_->session->Coalesce(*(job.session.get()));
388 << " we are not in backoff and the job was coalesced";
394 job.session.reset(new SyncSession(s->context(), s->delegate(),
400 // TODO(lipalani) - pass the job itself to ScheduleSyncSessionJob.
401 ScheduleSyncSessionJob(delay, SyncSessionJob::NUDGE, job.session.release(),
489 SyncSessionJob job(purpose, TimeTicks::Now() + delay,
495 pending_nudge_.reset(new SyncSessionJob(job));
498 << " Posting job to execute in DoSyncSessionJob. Job purpose "
499 << job.purpose;
501 &SyncerThread::DoSyncSessionJob, job),
526 void SyncerThread::DoSyncSessionJob(const SyncSessionJob& job) {
528 if (!ShouldRunJob(job)) {
530 << job.session->source().updates_source;
534 if (job.purpose == SyncSessionJob::NUDGE) {
535 if (pending_nudge_.get() == NULL || pending_nudge_->session != job.session)
539 VLOG(1) << "SyncerThread(" << this << ")" << " DoSyncSessionJob. job purpose "
540 << job.purpose;
544 SetSyncerStepsForPurpose(job.purpose, &begin, &end);
547 while (ShouldRunJob(job) && has_more_to_sync) {
551 syncer_->SyncShare(job.session.get(), begin, end);
552 has_more_to_sync = job.session->HasMoreToSync();
554 job.session->ResetTransientState();
558 FinishSyncSessionJob(job);
580 void SyncerThread::FinishSyncSessionJob(const SyncSessionJob& job) {
586 for (iter = job.session->source().types.begin();
587 iter != job.session->source().types.end();
594 UpdateCarryoverSessionState(job);
598 SaveJob(job);
604 ScheduleNextSync(job);
626 // Success implies backoff relief. Note that if this was a "one-off" job
632 << " Job suceeded so not scheduling more jobs";
639 << " Job failed with source continuation";
652 << " Failed. Schedule a job with continuation as source";
703 << " In handle continuation error. Old job purpose is "
713 SyncSessionJob job(old_job.purpose, TimeTicks::Now() + length,
715 wait_interval_->pending_configure_job.reset(new SyncSessionJob(job));
717 // We are not in configuration mode. So wait_interval's pending job
759 VLOG(1) << "SyncerThread(" << this << ")" << " Do canary job";
767 VLOG(1) << "SyncerThread(" << this << ")" << " Found pending configure job";
770 VLOG(1) << "SyncerThread(" << this << ")" << " Found pending nudge job";
771 // Pending jobs mostly have time from the past. Reset it so this job
787 VLOG(1) << "SyncerThread(" << this << ")" << " Executing pending job";