Chromium Code Reviews| Index: sync/sessions/sync_session.h |
| diff --git a/sync/sessions/sync_session.h b/sync/sessions/sync_session.h |
| index 763bd3bc47941101552755b9a3cb0388e8d34219..d8fca511005743faceb52d30ff8f444c9f3d6af4 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 |
| @@ -90,9 +92,19 @@ class SYNC_EXPORT_PRIVATE SyncSession { |
| 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* BuildForNonNudge(SyncSessionContext* context, |
|
tim (not reviewing)
2013/05/07 20:34:13
Build() and BuildForNudge() wouldn't be horrible,
rlarocque
2013/05/07 21:50:57
Done.
|
| + Delegate* delegate, |
| + const SyncSourceInfo& source); |
| + |
| ~SyncSession(); |
| // Builds a thread-safe and read-only copy of the current session state. |
| @@ -113,7 +125,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 +145,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); |
| }; |