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

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

Issue 8595023: [Sync] Parse and save per-data type throttle data (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 fbd5c0d023d8029dd4a4af0e55f39d2401072c76..f198d40c084014c4b59935d27f99aa6429f1ab7c 100644
--- a/chrome/browser/sync/sessions/sync_session_context.h
+++ b/chrome/browser/sync/sessions/sync_session_context.h
@@ -19,9 +19,11 @@
#define CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_CONTEXT_H_
#pragma once
+#include <map>
#include <string>
#include "base/memory/scoped_ptr.h"
+#include "base/time.h"
#include "chrome/browser/sync/engine/model_safe_worker.h"
#include "chrome/browser/sync/engine/syncer_types.h"
#include "chrome/browser/sync/sessions/debug_info_getter.h"
@@ -52,6 +54,9 @@ class SyncSessionContext {
ModelSafeWorkerRegistrar* model_safe_worker_registrar,
const std::vector<SyncEngineEventListener*>& listeners,
DebugInfoGetter* debug_info_getter);
+
+ // Empty constructor for unit tests.
+ SyncSessionContext();
~SyncSessionContext();
ConflictResolver* resolver() { return resolver_; }
@@ -103,7 +108,15 @@ class SyncSessionContext {
OnSyncEngineEvent(event));
}
+ // This is virtual to test this in unit tests.
akalin 2011/11/22 04:26:33 "to test this in" -> "for"
+ // TODO(lipalani) Consult the unthrottle times before committing data to
+ // the server.
+ virtual void SetUnthrottleTime(const syncable::ModelTypeSet& types,
+ const base::TimeTicks& time);
+
private:
+ typedef std::map<syncable::ModelType, base::TimeTicks> UnthrottleTimes;
+
// 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.
@@ -147,6 +160,10 @@ class SyncSessionContext {
// client behavior on server side.
DebugInfoGetter* const debug_info_getter_;
+ // This is a map from throttled datatypes to the time at which they can be
akalin 2011/11/22 04:26:33 datatypes -> data types
+ // unthrottled.
+ UnthrottleTimes unthrottle_times_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSessionContext);
};

Powered by Google App Engine
This is Rietveld 408576698