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

Unified Diff: sync/notifier/p2p_invalidator.cc

Issue 12092091: Separate sync and invalidation client IDs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« 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 d04a1914f4b10aa77d16ace0f714b5f948d5cb55..e8e0d6eeed6c337842fa02dbbcbccb7418585084 100644
--- a/sync/notifier/p2p_invalidator.cc
+++ b/sync/notifier/p2p_invalidator.cc
@@ -158,8 +158,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) {
@@ -190,8 +192,8 @@ void P2PInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
ObjectIdLessThan());
registrar_.UpdateRegisteredIds(handler, ids);
const P2PNotificationData notification_data(
- unique_id_, NOTIFY_SELF, ObjectIdSetToInvalidationMap(new_ids, ""),
- REMOTE_INVALIDATION);
+ invalidator_client_id_, NOTIFY_SELF,
+ ObjectIdSetToInvalidationMap(new_ids, ""), REMOTE_INVALIDATION);
SendNotificationData(notification_data);
}
@@ -205,11 +207,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());
@@ -231,7 +228,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,
REMOTE_INVALIDATION);
SendNotificationData(notification_data);
}
@@ -243,7 +240,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(), ""),
REMOTE_INVALIDATION);
SendNotificationData(notification_data);
@@ -278,11 +275,11 @@ void P2PInvalidator::OnIncomingNotification(
<< notification.data;
notification_data =
P2PNotificationData(
- unique_id_, NOTIFY_ALL,
+ invalidator_client_id_, NOTIFY_ALL,
ObjectIdSetToInvalidationMap(registrar_.GetAllRegisteredIds(), ""),
REMOTE_INVALIDATION);
}
- 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