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

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

Issue 12781007: Merge 185528 "sync: Drop fully datatype throttled sync jobs rath..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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