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

Unified Diff: sync/notifier/p2p_invalidator.h

Issue 10874096: [Sync] Rework Invalidator-related unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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/notifier/object_id_state_map.cc ('k') | sync/notifier/p2p_invalidator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/p2p_invalidator.h
diff --git a/sync/notifier/p2p_invalidator.h b/sync/notifier/p2p_invalidator.h
index ce486ac1c76ece088e6e2592b3ef8e55120cf766..99d7fb814dcf748281187a50d9eb99994db92b27 100644
--- a/sync/notifier/p2p_invalidator.h
+++ b/sync/notifier/p2p_invalidator.h
@@ -29,7 +29,7 @@ class PushClient;
namespace syncer {
// The channel to use for sync notifications.
-extern const char* kSyncP2PNotificationChannel;
+extern const char kSyncP2PNotificationChannel[];
// The intended recipient(s) of a P2P notification.
enum P2PNotificationTarget {
@@ -56,14 +56,17 @@ class P2PNotificationData {
P2PNotificationData();
P2PNotificationData(const std::string& sender_id,
P2PNotificationTarget target,
- ModelTypeSet changed_types);
+ const ObjectIdStateMap& id_state_map,
+ IncomingNotificationSource source);
~P2PNotificationData();
// Returns true if the given ID is targeted by this notification.
bool IsTargeted(const std::string& id) const;
- ModelTypeSet GetChangedTypes() const;
+ const ObjectIdStateMap& GetIdStateMap() const;
+
+ IncomingNotificationSource GetSource() const;
bool Equals(const P2PNotificationData& other) const;
@@ -78,8 +81,10 @@ class P2PNotificationData {
std::string sender_id_;
// The intendent recipient(s) of the notification.
P2PNotificationTarget target_;
- // The types the notification is for.
- ModelTypeSet changed_types_;
+ // The state map for the notification.
+ ObjectIdStateMap id_state_map_;
+ // The source of the notification.
+ IncomingNotificationSource source_;
};
class P2PInvalidator : public Invalidator,
@@ -104,7 +109,7 @@ class P2PInvalidator : public Invalidator,
virtual void SetStateDeprecated(const std::string& state) OVERRIDE;
virtual void UpdateCredentials(
const std::string& email, const std::string& token) OVERRIDE;
- virtual void SendNotification(ModelTypeSet changed_types) OVERRIDE;
+ virtual void SendNotification(const ObjectIdStateMap& id_state_map) OVERRIDE;
// PushClientObserver implementation.
virtual void OnNotificationsEnabled() OVERRIDE;
@@ -133,8 +138,6 @@ class P2PInvalidator : public Invalidator,
// Which set of clients should be sent notifications.
P2PNotificationTarget send_notification_target_;
- ModelTypeSet enabled_types_;
-
DISALLOW_COPY_AND_ASSIGN(P2PInvalidator);
};
« no previous file with comments | « sync/notifier/object_id_state_map.cc ('k') | sync/notifier/p2p_invalidator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698