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_scheduler_impl.h" | 5 #include "sync/engine/sync_scheduler_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 requested_types.Put(i->first); | 424 requested_types.Put(i->first); |
425 } | 425 } |
426 | 426 |
427 // If all types are throttled, do not CONTINUE. Today, we don't treat | 427 // If all types are throttled, do not CONTINUE. Today, we don't treat |
428 // a per-datatype "unthrottle" event as something that should force a | 428 // a per-datatype "unthrottle" event as something that should force a |
429 // canary job. For this reason, there's no good time to reschedule this job | 429 // canary job. For this reason, there's no good time to reschedule this job |
430 // to run -- we'll lazily wait for an independent event to trigger a sync. | 430 // to run -- we'll lazily wait for an independent event to trigger a sync. |
431 // Note that there may already be such an event if we're in a WaitInterval, | 431 // Note that there may already be such an event if we're in a WaitInterval, |
432 // so we can retry it then. | 432 // so we can retry it then. |
433 if (!requested_types.Empty() && throttled_types.HasAll(requested_types)) | 433 if (!requested_types.Empty() && throttled_types.HasAll(requested_types)) |
434 return SAVE; | 434 return DROP; // TODO(tim): Don't drop. http://crbug.com/177659 |
435 } | 435 } |
436 | 436 |
437 if (wait_interval_.get()) | 437 if (wait_interval_.get()) |
438 return DecideWhileInWaitInterval(job); | 438 return DecideWhileInWaitInterval(job); |
439 | 439 |
440 if (mode_ == CONFIGURATION_MODE) { | 440 if (mode_ == CONFIGURATION_MODE) { |
441 if (job.purpose() == SyncSessionJob::NUDGE) | 441 if (job.purpose() == SyncSessionJob::NUDGE) |
442 return SAVE; // Running requires a mode switch. | 442 return SAVE; // Running requires a mode switch. |
443 else if (job.purpose() == SyncSessionJob::CONFIGURATION) | 443 else if (job.purpose() == SyncSessionJob::CONFIGURATION) |
444 return CONTINUE; | 444 return CONTINUE; |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1189 |
1190 #undef SDVLOG_LOC | 1190 #undef SDVLOG_LOC |
1191 | 1191 |
1192 #undef SDVLOG | 1192 #undef SDVLOG |
1193 | 1193 |
1194 #undef SLOG | 1194 #undef SLOG |
1195 | 1195 |
1196 #undef ENUM_CASE | 1196 #undef ENUM_CASE |
1197 | 1197 |
1198 } // namespace syncer | 1198 } // namespace syncer |
OLD | NEW |