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

Unified Diff: chrome/browser/sync/sessions/sync_session.h

Issue 6182004: [SYNC] Refactor SyncSourceInfo and add support in chrome invalidation client ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Added util functions Created 9 years, 11 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
Index: chrome/browser/sync/sessions/sync_session.h
===================================================================
--- chrome/browser/sync/sessions/sync_session.h (revision 71618)
+++ chrome/browser/sync/sessions/sync_session.h (working copy)
@@ -15,16 +15,20 @@
#define CHROME_BROWSER_SYNC_SESSIONS_SYNC_SESSION_H_
#pragma once
+#include <map>
+#include <string>
#include <utility>
#include <vector>
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "base/time.h"
+#include "chrome/browser/sync/engine/model_safe_worker.h"
akalin 2011/01/24 22:17:29 I think you can forward declare ModelSafeRoutingIn
Nicolas Zea 2011/01/25 00:29:14 ModelSafeRoutingInfo is a typedef, so can't be for
akalin 2011/01/26 01:15:17 Ah, actually if it's a typedef, then we should inc
#include "chrome/browser/sync/sessions/ordered_commit_set.h"
#include "chrome/browser/sync/sessions/session_state.h"
#include "chrome/browser/sync/sessions/status_controller.h"
#include "chrome/browser/sync/sessions/sync_session_context.h"
+#include "chrome/browser/sync/syncable/model_type.h"
#include "chrome/browser/sync/util/extensions_activity_monitor.h"
namespace syncable {
@@ -35,9 +39,33 @@
class ModelSafeWorker;
namespace sessions {
-typedef std::pair<sync_pb::GetUpdatesCallerInfo::GetUpdatesSource,
- syncable::ModelTypeBitSet> SyncSourceInfo;
+// A container that contains a set of datatypes with possible string payloads.
+typedef std::map<syncable::ModelType, std::string> ModelTypeMap;
akalin 2011/01/24 22:17:29 ModelTypeMap is a bit generic -- how about ModelTy
Nicolas Zea 2011/01/25 00:29:14 Done.
+
+// Helper utils for building ModelTypeMaps.
+void BuildModelTypeMapFromModelTypeBitSet(
akalin 2011/01/24 22:17:29 These names are a bit long. I suggest: ModelType
Nicolas Zea 2011/01/25 00:29:14 Done.
+ const syncable::ModelTypeBitSet& types,
+ const std::string& payload,
+ ModelTypeMap* map);
+void BuildModelTypeMapFromModelSafeRoutingInfo(
+ const ModelSafeRoutingInfo& routes,
+ const std::string& payload,
+ ModelTypeMap* map);
+
+// 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.
+struct SyncSourceInfo {
+ SyncSourceInfo();
+ SyncSourceInfo(
+ const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u,
+ const ModelTypeMap& t);
+
+ sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source;
+ ModelTypeMap types;
+};
+
class SyncSession {
public:
// The Delegate services events that occur during the session requiring an

Powered by Google App Engine
This is Rietveld 408576698