| Index: chrome/browser/sync/sessions/sync_session_context.cc
|
| diff --git a/chrome/browser/sync/sessions/sync_session_context.cc b/chrome/browser/sync/sessions/sync_session_context.cc
|
| index c0aeb3445e8cef70bdf4716d6ad00f44814b661f..170baa3ec85bcfa01f889b711472e02771dd3a3b 100644
|
| --- a/chrome/browser/sync/sessions/sync_session_context.cc
|
| +++ b/chrome/browser/sync/sessions/sync_session_context.cc
|
| @@ -58,5 +58,39 @@ void SyncSessionContext::SetUnthrottleTime(const syncable::ModelTypeSet& types,
|
| }
|
| }
|
|
|
| +syncable::ModelTypeSet SyncSessionContext::
|
| + UpdateAndGetCurrentlyThrottledTypes() {
|
| + UpdateThrottledTypes(base::TimeTicks::Now());
|
| + return GetThrottledTypes();
|
| +}
|
| +
|
| +void SyncSessionContext::UpdateThrottledTypes(const base::TimeTicks& time) {
|
| + UnthrottleTimes::const_iterator it = unthrottle_times_.begin();
|
| + while (it != unthrottle_times_.end()) {
|
| + if (it->second <= time) {
|
| + // Delete and increment the iterator.
|
| + UnthrottleTimes::const_iterator iterator_to_delete = it;
|
| + ++it;
|
| + unthrottle_times_.erase(iterator_to_delete);
|
| + } else {
|
| + // Just increment the iterator.
|
| + ++it;
|
| + }
|
| + }
|
| +}
|
| +
|
| +// TODO(lipalani): Call this function and fill the return values in snapshot
|
| +// so it could be shown in the about:sync page.
|
| +syncable::ModelTypeSet SyncSessionContext::GetThrottledTypes() const {
|
| + syncable::ModelTypeSet types;
|
| + for (UnthrottleTimes::const_iterator it = unthrottle_times_.begin();
|
| + it != unthrottle_times_.end();
|
| + ++it) {
|
| + types.insert(it->first);
|
| + }
|
| + return types;
|
| +}
|
| +
|
| +
|
| } // namespace sessions
|
| } // namespace browser_sync
|
|
|