Index: sync/internal_api/public/attachments/task_queue.h |
diff --git a/sync/internal_api/public/attachments/task_queue.h b/sync/internal_api/public/attachments/task_queue.h |
index 2466f3a3e3b34142ca2db6d6f8ec705940ff70e6..76d67bff697fc30298a5a5ab5fa5124b39c46b25 100644 |
--- a/sync/internal_api/public/attachments/task_queue.h |
+++ b/sync/internal_api/public/attachments/task_queue.h |
@@ -122,13 +122,19 @@ class TaskQueue : base::NonThreadSafe { |
// |task|. |
void Cancel(const T& task); |
- private: |
- FRIEND_TEST_ALL_PREFIXES(TaskQueueTest, Retry); |
+ // Reset any backoff delay and resume dispatching of tasks. |
+ // |
+ // Useful for when you know the cause of previous failures has been resolved |
+ // and you want don't want to wait for the accumulated backoff delay to |
+ // elapse. |
+ void ResetBackoff(); |
// Use |timer| for scheduled events. |
// |
// Used in tests. See also MockTimer. |
void SetTimerForTest(scoped_ptr<base::Timer> timer); |
+ |
+ private: |
void FinishTask(const T& task); |
void ScheduleDispatch(); |
void Dispatch(); |
@@ -218,6 +224,13 @@ void TaskQueue<T>::Cancel(const T& task) { |
} |
template <typename T> |
+void TaskQueue<T>::ResetBackoff() { |
+ backoff_timer_->Stop(); |
+ backoff_entry_->Reset(); |
+ ScheduleDispatch(); |
+} |
+ |
+template <typename T> |
void TaskQueue<T>::SetTimerForTest(scoped_ptr<base::Timer> timer) { |
DCHECK(CalledOnValidThread()); |
DCHECK(timer.get()); |