Chromium Code Reviews| Index: chrome/browser/sync/sessions/sync_session.h |
| diff --git a/chrome/browser/sync/sessions/sync_session.h b/chrome/browser/sync/sessions/sync_session.h |
| index ce7c9e5dd11da04267ce648cf907b058190a2673..13b60be4aa9300b9c2aa711fe7d156e1225273ec 100644 |
| --- a/chrome/browser/sync/sessions/sync_session.h |
| +++ b/chrome/browser/sync/sessions/sync_session.h |
| @@ -35,8 +35,6 @@ namespace browser_sync { |
| class ModelSafeWorker; |
| namespace sessions { |
| -typedef std::pair<sync_pb::GetUpdatesCallerInfo::GetUpdatesSource, |
| - syncable::ModelTypeBitSet> SyncSourceInfo; |
| class SyncSession { |
| public: |
| @@ -92,8 +90,19 @@ class SyncSession { |
| // engine again. |
| bool HasMoreToSync() const; |
| - SyncSessionContext* context() { return context_; } |
| - Delegate* delegate() { return delegate_; } |
| + // Collects all state pertaining to how and why |s| originated and unions it |
| + // with corresponding state in |this|, leaving |s| unchanged. Allows |this| |
| + // to take on the responsibilities |s| had (e.g. certain data types) in the |
| + // next SyncShare operation using |this|, rather than needed two separate |
| + // sessions. |
| + void Coalesce(const SyncSession* s); |
|
akalin
2011/01/25 06:09:53
why not a const ref?
|
| + |
| + // Should be called any time |this| is being re-used in a new call to |
| + // SyncShare (e.g., HasMoreToSync returned true). |
| + void ResetTransientState(); |
| + |
| + SyncSessionContext* context() const { return context_; } |
| + Delegate* delegate() const { return delegate_; } |
| syncable::WriteTransaction* write_transaction() { return write_transaction_; } |
| StatusController* status_controller() { return status_controller_.get(); } |
| @@ -138,12 +147,13 @@ class SyncSession { |
| scoped_ptr<StatusController> status_controller_; |
| // The set of active ModelSafeWorkers for the duration of this session. |
| - const std::vector<ModelSafeWorker*> workers_; |
| + // This can change if this session is Coalesce()'d with another. |
| + std::vector<ModelSafeWorker*> workers_; |
| // The routing info for the duration of this session, dictating which |
| // datatypes should be synced and which workers should be used when working |
| // on those datatypes. |
| - const ModelSafeRoutingInfo routing_info_; |
| + ModelSafeRoutingInfo routing_info_; |
| DISALLOW_COPY_AND_ASSIGN(SyncSession); |
| }; |