Index: chrome/browser/sync/sessions/sync_session.h |
=================================================================== |
--- chrome/browser/sync/sessions/sync_session.h (revision 71061) |
+++ chrome/browser/sync/sessions/sync_session.h (working copy) |
@@ -15,6 +15,7 @@ |
#define CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_ |
#pragma once |
+#include <string> |
#include <utility> |
#include <vector> |
@@ -35,9 +36,39 @@ |
class ModelSafeWorker; |
namespace sessions { |
-typedef std::pair<sync_pb::GetUpdatesCallerInfo::GetUpdatesSource, |
- syncable::ModelTypeBitSet> SyncSourceInfo; |
+// A container for the source of a sync session. This includes the update |
+// source, the datatypes triggering the sync session, and possible session |
+// specific payloads which should be sent to the server. |
+class SyncSourceInfo { |
akalin
2011/01/12 09:55:19
any reason why this can't be a plain struct with p
Nicolas Zea
2011/01/13 19:17:30
It seemed cleaner to me since the private members
akalin
2011/01/13 19:47:41
In that case, what about a struct with const membe
Nicolas Zea
2011/01/18 06:07:23
I went ahead and just switched to a normal struct.
|
+ public: |
+ SyncSourceInfo() {} |
+ SyncSourceInfo( |
+ const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& updates_source, |
+ const syncable::ModelTypeBitSet& types) |
+ : updates_source_(updates_source), types_(types) {} |
+ SyncSourceInfo( |
+ const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& updates_source, |
+ const syncable::ModelTypeBitSet& types, |
+ const std::vector<std::string>& payloads) |
+ : updates_source_(updates_source), types_(types), payloads_(payloads) {} |
+ inline const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& updates_source() |
+ const { |
+ return updates_source_; |
+ } |
+ inline const syncable::ModelTypeBitSet& types() const { |
+ return types_; |
+ } |
+ inline const std::vector<std::string>& payloads() const { |
+ return payloads_; |
+ } |
+ |
+ private: |
+ sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source_; |
+ syncable::ModelTypeBitSet types_; |
+ std::vector<std::string> payloads_; |
+}; |
+ |
class SyncSession { |
public: |
// The Delegate services events that occur during the session requiring an |