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

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

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
« no previous file with comments | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/sessions/sync_session_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/sync_session_context.h
diff --git a/chrome/browser/sync/sessions/sync_session_context.h b/chrome/browser/sync/sessions/sync_session_context.h
index b08b64c176ef222daec882dc82ab3223112c913f..1ca222e5657c57cd0f4054fa3829927bb566dee2 100644
--- a/chrome/browser/sync/sessions/sync_session_context.h
+++ b/chrome/browser/sync/sessions/sync_session_context.h
@@ -22,6 +22,7 @@
#include <map>
#include <string>
+#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
@@ -109,14 +110,24 @@ class SyncSessionContext {
}
// This is virtual for unit tests.
- // TODO(lipalani) Consult the unthrottle times before committing data to
- // the server.
virtual void SetUnthrottleTime(const syncable::ModelTypeSet& types,
const base::TimeTicks& time);
+ // This prunes the |unthrottle_time_| map based on the |time| passed in. This
+ // is called by syncer at the SYNCER_BEGIN stage.
+ void PruneUnthrottledTypes(const base::TimeTicks& time);
+
+ // This returns the list of currently throttled types. Unless server returns
+ // new throttled types this will remain constant through out the sync cycle.
+ syncable::ModelTypeSet GetThrottledTypes() const;
+
private:
typedef std::map<syncable::ModelType, base::TimeTicks> UnthrottleTimes;
+ FRIEND_TEST_ALL_PREFIXES(SyncSessionContextTest, AddUnthrottleTimeTest);
+ FRIEND_TEST_ALL_PREFIXES(SyncSessionContextTest,
+ GetCurrentlyThrottledTypesTest);
+
// Rather than force clients to set and null-out various context members, we
// extend our encapsulation boundary to scoped helpers that take care of this
// once they are allocated. See definitions of these below.
« no previous file with comments | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/sessions/sync_session_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698