Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #pragma once | 8 #pragma once |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 virtual void OnReceivedShortPollIntervalUpdate( | 121 virtual void OnReceivedShortPollIntervalUpdate( |
| 122 const base::TimeDelta& new_interval) OVERRIDE; | 122 const base::TimeDelta& new_interval) OVERRIDE; |
| 123 virtual void OnReceivedLongPollIntervalUpdate( | 123 virtual void OnReceivedLongPollIntervalUpdate( |
| 124 const base::TimeDelta& new_interval) OVERRIDE; | 124 const base::TimeDelta& new_interval) OVERRIDE; |
| 125 virtual void OnReceivedSessionsCommitDelay( | 125 virtual void OnReceivedSessionsCommitDelay( |
| 126 const base::TimeDelta& new_delay) OVERRIDE; | 126 const base::TimeDelta& new_delay) OVERRIDE; |
| 127 virtual void OnShouldStopSyncingPermanently() OVERRIDE; | 127 virtual void OnShouldStopSyncingPermanently() OVERRIDE; |
| 128 virtual void OnSyncProtocolError( | 128 virtual void OnSyncProtocolError( |
| 129 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE; | 129 const sessions::SyncSessionSnapshot& snapshot) OVERRIDE; |
| 130 | 130 |
| 131 sessions::SyncSessionContext* session_context() { | |
|
rlarocque
2012/03/29 22:54:27
Don't forget to remove this if you're willing to a
lipalani1
2012/03/29 23:58:37
Done.
| |
| 132 return session_context_.get(); | |
| 133 } | |
| 134 | |
| 131 private: | 135 private: |
| 132 enum JobProcessDecision { | 136 enum JobProcessDecision { |
| 133 // Indicates we should continue with the current job. | 137 // Indicates we should continue with the current job. |
| 134 CONTINUE, | 138 CONTINUE, |
| 135 // Indicates that we should save it to be processed later. | 139 // Indicates that we should save it to be processed later. |
| 136 SAVE, | 140 SAVE, |
| 137 // Indicates we should drop this job. | 141 // Indicates we should drop this job. |
| 138 DROP, | 142 DROP, |
| 139 }; | 143 }; |
| 140 | 144 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 scoped_ptr<Syncer> syncer_; | 413 scoped_ptr<Syncer> syncer_; |
| 410 | 414 |
| 411 scoped_ptr<sessions::SyncSessionContext> session_context_; | 415 scoped_ptr<sessions::SyncSessionContext> session_context_; |
| 412 | 416 |
| 413 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); | 417 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); |
| 414 }; | 418 }; |
| 415 | 419 |
| 416 } // namespace browser_sync | 420 } // namespace browser_sync |
| 417 | 421 |
| 418 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ | 422 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ |
| OLD | NEW |