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

Unified Diff: sync/engine/sync_scheduler_impl.h

Issue 146113003: sync: GU retry with less explicit TimeTicks logic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: sync/engine/sync_scheduler_impl.h
diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h
index 68d2a802ed9680b5aea9ed07313e87dca0b431d1..a7c95cc6462c97f26f03966ee2ecfeb944442560 100644
--- a/sync/engine/sync_scheduler_impl.h
+++ b/sync/engine/sync_scheduler_impl.h
@@ -113,20 +113,6 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
friend class SyncSchedulerWhiteboxTest;
friend class SyncerTest;
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest, NoNudgesInConfigureMode);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
- DropNudgeWhileExponentialBackOff);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest, SaveNudge);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
- SaveNudgeWhileTypeThrottled);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest, ContinueNudge);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest, ContinueConfiguration);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
- SaveConfigurationWhileThrottled);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
- SaveNudgeWhileThrottled);
- FRIEND_TEST_ALL_PREFIXES(SyncSchedulerWhiteboxTest,
- ContinueCanaryJobConfig);
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, TransientPollFailure);
FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest,
ServerConnectionChangeDuringBackoff);
@@ -134,6 +120,9 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
ConnectionChangeCanaryPreemptedByNudge);
FRIEND_TEST_ALL_PREFIXES(BackoffTriggersSyncSchedulerTest,
FailGetEncryptionKey);
+ FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, SuccessfulRetry);
+ FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, FailedRetry);
+ FRIEND_TEST_ALL_PREFIXES(SyncSchedulerTest, ReceiveNewRetryDelay);
struct SYNC_EXPORT_PRIVATE WaitInterval {
enum Mode {
@@ -253,6 +242,12 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
virtual void OnActionableError(const sessions::SyncSessionSnapshot& snapshot);
+ // Helper to process the GU retry delay we received in the previous cycle.
+ void ProcessReceivedGuRetryDelay();
+
+ // Helper to clear state associated with the receipt of GU retry requests.
+ void ClearReceivedGuRetryDelayFlag();
+
// For certain methods that need to worry about X-thread posting.
WeakHandle<SyncSchedulerImpl> weak_handle_this_;
@@ -337,15 +332,21 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl
// It is reset back to NORMAL_PRIORITY on every call to TrySyncSessionJobImpl.
JobPriority next_sync_session_job_priority_;
+ // Set by the OnReceivedGuRetryDelay callback.
+ base::TimeDelta pending_retry_delay_;
+
+ // Set byt he OnReceivedGuRetryDelay callback.
pavely 2014/01/27 11:54:05 typo: "byt he" => "by the"
+ bool received_pending_retry_;
+
+ // One-shot timer for scheduling GU retry according to delay set by server.
+ base::OneShotTimer<SyncSchedulerImpl> retry_timer_;
+
base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_;
// A second factory specially for weak_handle_this_, to allow the handle
// to be const and alleviate threading concerns.
base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_;
- // One-shot timer for scheduling GU retry according to delay set by server.
- base::OneShotTimer<SyncSchedulerImpl> retry_timer_;
-
DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl);
};

Powered by Google App Engine
This is Rietveld 408576698