| 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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 requested_types.Put(i->first); | 431 requested_types.Put(i->first); |
| 432 } | 432 } |
| 433 | 433 |
| 434 // If all types are throttled, do not CONTINUE. Today, we don't treat | 434 // If all types are throttled, do not CONTINUE. Today, we don't treat |
| 435 // a per-datatype "unthrottle" event as something that should force a | 435 // a per-datatype "unthrottle" event as something that should force a |
| 436 // canary job. For this reason, there's no good time to reschedule this job | 436 // canary job. For this reason, there's no good time to reschedule this job |
| 437 // to run -- we'll lazily wait for an independent event to trigger a sync. | 437 // to run -- we'll lazily wait for an independent event to trigger a sync. |
| 438 // Note that there may already be such an event if we're in a WaitInterval, | 438 // Note that there may already be such an event if we're in a WaitInterval, |
| 439 // so we can retry it then. | 439 // so we can retry it then. |
| 440 if (!requested_types.Empty() && throttled_types.HasAll(requested_types)) | 440 if (!requested_types.Empty() && throttled_types.HasAll(requested_types)) |
| 441 return SAVE; | 441 return DROP; // TODO(tim): Don't drop. http://crbug.com/177659 |
| 442 } | 442 } |
| 443 | 443 |
| 444 if (wait_interval_.get()) | 444 if (wait_interval_.get()) |
| 445 return DecideWhileInWaitInterval(job); | 445 return DecideWhileInWaitInterval(job); |
| 446 | 446 |
| 447 if (mode_ == CONFIGURATION_MODE) { | 447 if (mode_ == CONFIGURATION_MODE) { |
| 448 if (job.purpose() == SyncSessionJob::NUDGE) | 448 if (job.purpose() == SyncSessionJob::NUDGE) |
| 449 return SAVE; // Running requires a mode switch. | 449 return SAVE; // Running requires a mode switch. |
| 450 else if (job.purpose() == SyncSessionJob::CONFIGURATION) | 450 else if (job.purpose() == SyncSessionJob::CONFIGURATION) |
| 451 return CONTINUE; | 451 return CONTINUE; |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 | 1210 |
| 1211 #undef SDVLOG_LOC | 1211 #undef SDVLOG_LOC |
| 1212 | 1212 |
| 1213 #undef SDVLOG | 1213 #undef SDVLOG |
| 1214 | 1214 |
| 1215 #undef SLOG | 1215 #undef SLOG |
| 1216 | 1216 |
| 1217 #undef ENUM_CASE | 1217 #undef ENUM_CASE |
| 1218 | 1218 |
| 1219 } // namespace syncer | 1219 } // namespace syncer |
| OLD | NEW |