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

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: Upload 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.h
diff --git a/chrome/browser/sync/sessions/sync_session_context.h b/chrome/browser/sync/sessions/sync_session_context.h
index fbd5c0d023d8029dd4a4af0e55f39d2401072c76..f8085b2409827d06e10b1660efa32ab6511ac2eb 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,7 +54,10 @@ class SyncSessionContext {
ModelSafeWorkerRegistrar* model_safe_worker_registrar,
const std::vector<SyncEngineEventListener*>& listeners,
DebugInfoGetter* debug_info_getter);
- ~SyncSessionContext();
+
+ // Empty constructor for unit tests.
+ SyncSessionContext();
+ virtual ~SyncSessionContext();
ConflictResolver* resolver() { return resolver_; }
ServerConnectionManager* connection_manager() {
@@ -103,7 +108,15 @@ class SyncSessionContext {
OnSyncEngineEvent(event));
}
+ // 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);
+
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 data types to the time at which they can be
+ // unthrottled.
+ UnthrottleTimes unthrottle_times_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSessionContext);
};
« no previous file with comments | « chrome/browser/sync/protocol/sync_protocol_error.h ('k') | chrome/browser/sync/sessions/sync_session_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698