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

Side by Side Diff: sync/engine/sync_scheduler_impl.cc

Issue 12386012: sync: Drop fully datatype throttled sync jobs rather than saving them. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sync/engine/sync_scheduler_whitebox_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 requested_types.Put(i->first); 422 requested_types.Put(i->first);
423 } 423 }
424 424
425 // If all types are throttled, do not CONTINUE. Today, we don't treat 425 // If all types are throttled, do not CONTINUE. Today, we don't treat
426 // a per-datatype "unthrottle" event as something that should force a 426 // a per-datatype "unthrottle" event as something that should force a
427 // canary job. For this reason, there's no good time to reschedule this job 427 // canary job. For this reason, there's no good time to reschedule this job
428 // to run -- we'll lazily wait for an independent event to trigger a sync. 428 // to run -- we'll lazily wait for an independent event to trigger a sync.
429 // Note that there may already be such an event if we're in a WaitInterval, 429 // Note that there may already be such an event if we're in a WaitInterval,
430 // so we can retry it then. 430 // so we can retry it then.
431 if (!requested_types.Empty() && throttled_types.HasAll(requested_types)) 431 if (!requested_types.Empty() && throttled_types.HasAll(requested_types))
432 return SAVE; 432 return DROP; // TODO(tim): Don't drop. http://crbug.com/177659
433 } 433 }
434 434
435 if (wait_interval_.get()) 435 if (wait_interval_.get())
436 return DecideWhileInWaitInterval(job); 436 return DecideWhileInWaitInterval(job);
437 437
438 if (mode_ == CONFIGURATION_MODE) { 438 if (mode_ == CONFIGURATION_MODE) {
439 if (job.purpose() == SyncSessionJob::NUDGE) 439 if (job.purpose() == SyncSessionJob::NUDGE)
440 return SAVE; // Running requires a mode switch. 440 return SAVE; // Running requires a mode switch.
441 else if (job.purpose() == SyncSessionJob::CONFIGURATION) 441 else if (job.purpose() == SyncSessionJob::CONFIGURATION)
442 return CONTINUE; 442 return CONTINUE;
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 1191
1192 #undef SDVLOG_LOC 1192 #undef SDVLOG_LOC
1193 1193
1194 #undef SDVLOG 1194 #undef SDVLOG
1195 1195
1196 #undef SLOG 1196 #undef SLOG
1197 1197
1198 #undef ENUM_CASE 1198 #undef ENUM_CASE
1199 1199
1200 } // namespace syncer 1200 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | sync/engine/sync_scheduler_whitebox_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698