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

Side by Side Diff: components/sync/engine_impl/sync_scheduler_impl.h

Issue 2494633005: Revert of [sync] "TwoClientBookmarksSyncTest.Sanity" is flaky (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « components/sync/engine/engine_components_factory_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 const std::map<ModelType, base::TimeDelta>& nudge_delays) override; 79 const std::map<ModelType, base::TimeDelta>& nudge_delays) override;
80 void OnReceivedClientInvalidationHintBufferSize(int size) override; 80 void OnReceivedClientInvalidationHintBufferSize(int size) override;
81 void OnSyncProtocolError( 81 void OnSyncProtocolError(
82 const SyncProtocolError& sync_protocol_error) override; 82 const SyncProtocolError& sync_protocol_error) override;
83 void OnReceivedGuRetryDelay(const base::TimeDelta& delay) override; 83 void OnReceivedGuRetryDelay(const base::TimeDelta& delay) override;
84 void OnReceivedMigrationRequest(ModelTypeSet types) override; 84 void OnReceivedMigrationRequest(ModelTypeSet types) override;
85 85
86 // Returns true if the client is currently in exponential backoff. 86 // Returns true if the client is currently in exponential backoff.
87 bool IsBackingOff() const; 87 bool IsBackingOff() const;
88 88
89 // Changes the default delay between nudge cycles. Model-type specific
90 // overrides will still apply. This is made public so that nudge cycles can be
91 // shortened in integration tests.
92 void SetDefaultNudgeDelay(base::TimeDelta delay_ms);
93
94 private: 89 private:
95 enum JobPriority { 90 enum JobPriority {
96 // Non-canary jobs respect exponential backoff. 91 // Non-canary jobs respect exponential backoff.
97 NORMAL_PRIORITY, 92 NORMAL_PRIORITY,
98 // Canary jobs bypass exponential backoff, so use with extreme caution. 93 // Canary jobs bypass exponential backoff, so use with extreme caution.
99 CANARY_PRIORITY 94 CANARY_PRIORITY
100 }; 95 };
101 96
102 enum PollAdjustType { 97 enum PollAdjustType {
103 // Restart the poll interval. 98 // Restart the poll interval.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 WaitInterval(Mode mode, base::TimeDelta length); 132 WaitInterval(Mode mode, base::TimeDelta length);
138 133
139 static const char* GetModeString(Mode mode); 134 static const char* GetModeString(Mode mode);
140 135
141 Mode mode; 136 Mode mode;
142 base::TimeDelta length; 137 base::TimeDelta length;
143 }; 138 };
144 139
145 static const char* GetModeString(Mode mode); 140 static const char* GetModeString(Mode mode);
146 141
142 void SetDefaultNudgeDelay(base::TimeDelta delay_ms);
143
147 // Invoke the syncer to perform a nudge job. 144 // Invoke the syncer to perform a nudge job.
148 void DoNudgeSyncCycleJob(JobPriority priority); 145 void DoNudgeSyncCycleJob(JobPriority priority);
149 146
150 // Invoke the syncer to perform a configuration job. 147 // Invoke the syncer to perform a configuration job.
151 void DoConfigurationSyncCycleJob(JobPriority priority); 148 void DoConfigurationSyncCycleJob(JobPriority priority);
152 149
153 void DoClearServerDataSyncCycleJob(JobPriority priority); 150 void DoClearServerDataSyncCycleJob(JobPriority priority);
154 151
155 // Helper function for Do{Nudge,Configuration,Poll}SyncCycleJob. 152 // Helper function for Do{Nudge,Configuration,Poll}SyncCycleJob.
156 void HandleSuccess(); 153 void HandleSuccess();
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // A second factory specially for weak_handle_this_, to allow the handle 315 // A second factory specially for weak_handle_this_, to allow the handle
319 // to be const and alleviate threading concerns. 316 // to be const and alleviate threading concerns.
320 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_; 317 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_;
321 318
322 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); 319 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl);
323 }; 320 };
324 321
325 } // namespace syncer 322 } // namespace syncer
326 323
327 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ 324 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « components/sync/engine/engine_components_factory_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698