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

Side by Side Diff: trunk/src/sync/engine/sync_scheduler.h

Issue 23658030: Revert 222154 "sync: Gracefully handle very early shutdown" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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
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 // A class to schedule syncer tasks intelligently. 5 // A class to schedule syncer tasks intelligently.
6 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_H_ 6 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_H_
7 #define SYNC_ENGINE_SYNC_SCHEDULER_H_ 7 #define SYNC_ENGINE_SYNC_SCHEDULER_H_
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // scheduled tasks from the old mode may still run. 68 // scheduled tasks from the old mode may still run.
69 virtual void Start(Mode mode) = 0; 69 virtual void Start(Mode mode) = 0;
70 70
71 // Schedules the configuration task specified by |params|. Returns true if 71 // Schedules the configuration task specified by |params|. Returns true if
72 // the configuration task executed immediately, false if it had to be 72 // the configuration task executed immediately, false if it had to be
73 // scheduled for a later attempt. |params.ready_task| is invoked whenever the 73 // scheduled for a later attempt. |params.ready_task| is invoked whenever the
74 // configuration task executes. 74 // configuration task executes.
75 // Note: must already be in CONFIGURATION mode. 75 // Note: must already be in CONFIGURATION mode.
76 virtual bool ScheduleConfiguration(const ConfigurationParams& params) = 0; 76 virtual bool ScheduleConfiguration(const ConfigurationParams& params) = 0;
77 77
78 // Request that the syncer avoid starting any new tasks and prepare for 78 // Request that any running syncer task stop as soon as possible and
79 // shutdown. 79 // cancel all scheduled tasks. This function can be called from any thread,
80 virtual void Stop() = 0; 80 // and should in fact be called from a thread that isn't the sync loop to
81 // allow preempting ongoing sync cycles.
82 virtual void RequestStop() = 0;
81 83
82 // The meat and potatoes. All three of the following methods will post a 84 // The meat and potatoes. All three of the following methods will post a
83 // delayed task to attempt the actual nudge (see ScheduleNudgeImpl). 85 // delayed task to attempt the actual nudge (see ScheduleNudgeImpl).
84 // 86 //
85 // NOTE: |desired_delay| is best-effort. If a nudge is already scheduled to 87 // NOTE: |desired_delay| is best-effort. If a nudge is already scheduled to
86 // depart earlier than Now() + delay, the scheduler can and will prefer to 88 // depart earlier than Now() + delay, the scheduler can and will prefer to
87 // batch the two so that only one nudge is sent (at the earlier time). Also, 89 // batch the two so that only one nudge is sent (at the earlier time). Also,
88 // as always with delayed tasks and timers, it's possible the task gets run 90 // as always with delayed tasks and timers, it's possible the task gets run
89 // any time after |desired_delay|. 91 // any time after |desired_delay|.
90 92
(...skipping 30 matching lines...) Expand all
121 // Called when credentials are updated by the user. 123 // Called when credentials are updated by the user.
122 virtual void OnCredentialsUpdated() = 0; 124 virtual void OnCredentialsUpdated() = 0;
123 125
124 // Called when the network layer detects a connection status change. 126 // Called when the network layer detects a connection status change.
125 virtual void OnConnectionStatusChange() = 0; 127 virtual void OnConnectionStatusChange() = 0;
126 }; 128 };
127 129
128 } // namespace syncer 130 } // namespace syncer
129 131
130 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ 132 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_
OLDNEW
« no previous file with comments | « trunk/src/sync/engine/net/server_connection_manager.cc ('k') | trunk/src/sync/engine/sync_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698