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

Unified Diff: sync/notifier/p2p_invalidator.cc

Issue 12847003: Separate invalidator and sync client ID (part 2/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_listen_notifications utility Created 7 years, 9 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/p2p_invalidator.h ('k') | sync/notifier/p2p_invalidator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/p2p_invalidator.cc
diff --git a/sync/notifier/p2p_invalidator.cc b/sync/notifier/p2p_invalidator.cc
index e71d1e3c0802a7dd897c3e460dae522dc65112c8..dd9a34d071456ceeafc117a2a282ea68cec91330 100644
--- a/sync/notifier/p2p_invalidator.cc
+++ b/sync/notifier/p2p_invalidator.cc
@@ -137,8 +137,10 @@ bool P2PNotificationData::ResetFromString(const std::string& str) {
}
P2PInvalidator::P2PInvalidator(scoped_ptr<notifier::PushClient> push_client,
+ const std::string& invalidator_client_id,
P2PNotificationTarget send_notification_target)
: push_client_(push_client.Pass()),
+ invalidator_client_id_(invalidator_client_id),
logged_in_(false),
notifications_enabled_(false),
send_notification_target_(send_notification_target) {
@@ -169,7 +171,8 @@ void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
ObjectIdLessThan());
registrar_.UpdateRegisteredIds(handler, ids);
const P2PNotificationData notification_data(
- unique_id_, NOTIFY_SELF, ObjectIdSetToInvalidationMap(new_ids, ""));
+ invalidator_client_id_, NOTIFY_SELF,
+ ObjectIdSetToInvalidationMap(new_ids, ""));
SendNotificationData(notification_data);
}
@@ -189,11 +192,6 @@ InvalidatorState P2PInvalidator::GetInvalidatorState() const {
return registrar_.GetInvalidatorState();
}
-void P2PInvalidator::SetUniqueId(const std::string& unique_id) {
- DCHECK(thread_checker_.CalledOnValidThread());
- unique_id_ = unique_id;
-}
-
void P2PInvalidator::UpdateCredentials(
const std::string& email, const std::string& token) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -215,7 +213,7 @@ void P2PInvalidator::SendInvalidation(
const ObjectIdInvalidationMap& invalidation_map) {
DCHECK(thread_checker_.CalledOnValidThread());
const P2PNotificationData notification_data(
- unique_id_, send_notification_target_, invalidation_map);
+ invalidator_client_id_, send_notification_target_, invalidation_map);
SendNotificationData(notification_data);
}
@@ -226,7 +224,7 @@ void P2PInvalidator::OnNotificationsEnabled() {
registrar_.UpdateInvalidatorState(INVALIDATIONS_ENABLED);
if (just_turned_on) {
const P2PNotificationData notification_data(
- unique_id_, NOTIFY_SELF,
+ invalidator_client_id_, NOTIFY_SELF,
ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""));
SendNotificationData(notification_data);
}
@@ -260,10 +258,10 @@ void P2PInvalidator::OnIncomingNotification(
<< notification.data;
notification_data =
P2PNotificationData(
- unique_id_, NOTIFY_ALL,
+ invalidator_client_id_, NOTIFY_ALL,
ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""));
}
- if (!notification_data.IsTargeted(unique_id_)) {
+ if (!notification_data.IsTargeted(invalidator_client_id_)) {
DVLOG(1) << "Not a target of the notification -- "
<< "not emitting notification";
return;
« no previous file with comments | « sync/notifier/p2p_invalidator.h ('k') | sync/notifier/p2p_invalidator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698