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

Unified Diff: sync/sessions/sync_session.h

Issue 14963002: sync: Report GetUpdate triggers to the server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix handling of NEW_CLIENT GU source Created 7 years, 7 months 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 | « sync/sessions/nudge_tracker_unittest.cc ('k') | sync/sessions/sync_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/sync_session.h
diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h
index 763bd3bc47941101552755b9a3cb0388e8d34219..a8bfb4d61d26c9ce5b340c417c5e77c3081ba2ce 100644
--- a/sync/sessions/sync_session.h
+++ b/sync/sessions/sync_session.h
@@ -36,6 +36,8 @@ class ModelSafeWorker;
namespace sessions {
+class NudgeTracker;
+
class SYNC_EXPORT_PRIVATE SyncSession {
public:
// The Delegate services events that occur during the session requiring an
@@ -86,13 +88,27 @@ class SYNC_EXPORT_PRIVATE SyncSession {
virtual void OnSyncProtocolError(
const sessions::SyncSessionSnapshot& snapshot) = 0;
+ // Called when the server wants to change the number of hints the client
+ // will buffer locally.
+ virtual void OnReceivedClientInvalidationHintBufferSize(int size) = 0;
+
protected:
virtual ~Delegate() {}
};
- SyncSession(SyncSessionContext* context,
- Delegate* delegate,
- const SyncSourceInfo& source);
+ // Build a session with a nudge tracker. Used for sync cycles with origin of
+ // GU_TRIGGER (ie. notification, local change, and/or refresh request)
+ static SyncSession* BuildForNudge(SyncSessionContext* context,
+ Delegate* delegate,
+ const SyncSourceInfo& source,
+ const NudgeTracker* nudge_tracker);
+
+ // Build a session without a nudge tracker. Used for poll or configure type
+ // sync cycles.
+ static SyncSession* Build(SyncSessionContext* context,
+ Delegate* delegate,
+ const SyncSourceInfo& source);
+
~SyncSession();
// Builds a thread-safe and read-only copy of the current session state.
@@ -113,7 +129,14 @@ class SYNC_EXPORT_PRIVATE SyncSession {
const SyncSourceInfo& source() const { return source_; }
+ const NudgeTracker* nudge_tracker() const { return nudge_tracker_; }
+
private:
+ SyncSession(SyncSessionContext* context,
+ Delegate* delegate,
+ const SyncSourceInfo& source,
+ const NudgeTracker* nudge_tracker);
+
// The context for this session, guaranteed to outlive |this|.
SyncSessionContext* const context_;
@@ -126,6 +149,8 @@ class SYNC_EXPORT_PRIVATE SyncSession {
// Our controller for various status and error counters.
scoped_ptr<StatusController> status_controller_;
+ const NudgeTracker* nudge_tracker_;
+
DISALLOW_COPY_AND_ASSIGN(SyncSession);
};
« no previous file with comments | « sync/sessions/nudge_tracker_unittest.cc ('k') | sync/sessions/sync_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698