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

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 review. 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.h
diff --git a/chrome/browser/sync/sessions/sync_session_context.h b/chrome/browser/sync/sessions/sync_session_context.h
index f8085b2409827d06e10b1660efa32ab6511ac2eb..58641986a06fd4b5dd68a49bacf6c7efb3b72352 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"
@@ -44,6 +45,7 @@ static const int kDefaultMaxCommitBatchSize = 25;
namespace sessions {
class ScopedSessionContextConflictResolver;
+class SyncSessionContextTest;
akalin 2011/11/23 03:44:33 there's actually no need to forward-declare for FR
struct SyncSessionSnapshot;
class TestScopedSessionEventListener;
@@ -109,14 +111,19 @@ 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);
+ void UpdateThrottledTypes(const base::TimeTicks& time);
akalin 2011/11/23 03:44:33 maybe a better name would be: "PruneUnthrottledTyp
+ syncable::ModelTypeSet GetThrottledTypes() const;
akalin 2011/11/23 03:44:33 Add comment explaining what this does, and that it
+
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.

Powered by Google App Engine
This is Rietveld 408576698