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

Unified Diff: chrome/browser/sync/sessions/sync_session_context.cc

Issue 8631021: [Sync] Prevent uploading throttled datatypes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For committing. Created 9 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 side-by-side diff with in-line comments
Download patch
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..8a11c85806a405b3c1ba2ca5485db826cca7785e 100644
--- a/chrome/browser/sync/sessions/sync_session_context.cc
+++ b/chrome/browser/sync/sessions/sync_session_context.cc
@@ -58,5 +58,32 @@ void SyncSessionContext::SetUnthrottleTime(const syncable::ModelTypeSet& types,
}
}
+void SyncSessionContext::PruneUnthrottledTypes(const base::TimeTicks& time) {
+ UnthrottleTimes::iterator it = unthrottle_times_.begin();
+ while (it != unthrottle_times_.end()) {
+ if (it->second <= time) {
+ // Delete and increment the iterator.
+ UnthrottleTimes::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
« no previous file with comments | « chrome/browser/sync/sessions/sync_session_context.h ('k') | chrome/browser/sync/sessions/sync_session_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698