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

Unified Diff: chrome/browser/sync_file_system/sync_process_runner.h

Issue 386523002: [SyncFS] Refine SyncProcessRunner's throttling algorithm for parallel task support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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: chrome/browser/sync_file_system/sync_process_runner.h
diff --git a/chrome/browser/sync_file_system/sync_process_runner.h b/chrome/browser/sync_file_system/sync_process_runner.h
index 0143cfefd3bc556b869dacd85f2b991d74f916ee..c84a385124bb87397cfa4480bba9a8aa9d42eef5 100644
--- a/chrome/browser/sync_file_system/sync_process_runner.h
+++ b/chrome/browser/sync_file_system/sync_process_runner.h
@@ -75,7 +75,6 @@ class SyncProcessRunner {
// Schedules a new sync.
void Schedule();
- void ScheduleIfNotRunning();
int64 pending_changes() const { return pending_changes_; }
@@ -88,16 +87,29 @@ class SyncProcessRunner {
virtual SyncServiceState GetServiceState();
private:
- void Finished(const base::TimeTicks& start_time, SyncStatusCode status);
+ void Finished(const base::TimeTicks& start_time,
+ SyncStatusCode status);
void Run();
void ScheduleInternal(int64 delay);
+ // Throttles new sync for |base_delay| milliseconds for an error case.
+ // If new sync is already throttled, back off the duration.
+ void ThrottleSync(int64 base_delay);
+
+ // Clears old throttling setting that is already over.
+ void ResetOldThrottling();
+ void ResetThrottling();
+
std::string name_;
Client* client_;
int max_parallel_task_;
int running_tasks_;
scoped_ptr<TimerHelper> timer_helper_;
base::TimeTicks last_scheduled_;
+
+ base::TimeTicks throttle_from_;
+ base::TimeTicks throttle_until_;
+
int64 current_delay_;
int64 last_delay_;
int64 pending_changes_;

Powered by Google App Engine
This is Rietveld 408576698