OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/notifier/p2p_invalidator.h" | 5 #include "sync/notifier/p2p_invalidator.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 send_notification_target_, | 173 send_notification_target_, |
174 ObjectIdInvalidationMap::InvalidateAll(ids)); | 174 ObjectIdInvalidationMap::InvalidateAll(ids)); |
175 SendNotificationData(notification_data); | 175 SendNotificationData(notification_data); |
176 } | 176 } |
177 | 177 |
178 void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) { | 178 void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) { |
179 DCHECK(thread_checker_.CalledOnValidThread()); | 179 DCHECK(thread_checker_.CalledOnValidThread()); |
180 registrar_.UnregisterHandler(handler); | 180 registrar_.UnregisterHandler(handler); |
181 } | 181 } |
182 | 182 |
183 void P2PInvalidator::Acknowledge(const invalidation::ObjectId& id, | |
184 const AckHandle& ack_handle) { | |
185 DCHECK(thread_checker_.CalledOnValidThread()); | |
186 // Do nothing for the P2P implementation. | |
187 } | |
188 | |
189 InvalidatorState P2PInvalidator::GetInvalidatorState() const { | 183 InvalidatorState P2PInvalidator::GetInvalidatorState() const { |
190 DCHECK(thread_checker_.CalledOnValidThread()); | 184 DCHECK(thread_checker_.CalledOnValidThread()); |
191 return registrar_.GetInvalidatorState(); | 185 return registrar_.GetInvalidatorState(); |
192 } | 186 } |
193 | 187 |
194 void P2PInvalidator::UpdateCredentials( | 188 void P2PInvalidator::UpdateCredentials( |
195 const std::string& email, const std::string& token) { | 189 const std::string& email, const std::string& token) { |
196 DCHECK(thread_checker_.CalledOnValidThread()); | 190 DCHECK(thread_checker_.CalledOnValidThread()); |
197 notifier::Subscription subscription; | 191 notifier::Subscription subscription; |
198 subscription.channel = kSyncP2PNotificationChannel; | 192 subscription.channel = kSyncP2PNotificationChannel; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 return; | 282 return; |
289 } | 283 } |
290 notifier::Notification notification; | 284 notifier::Notification notification; |
291 notification.channel = kSyncP2PNotificationChannel; | 285 notification.channel = kSyncP2PNotificationChannel; |
292 notification.data = notification_data.ToString(); | 286 notification.data = notification_data.ToString(); |
293 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); | 287 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); |
294 push_client_->SendNotification(notification); | 288 push_client_->SendNotification(notification); |
295 } | 289 } |
296 | 290 |
297 } // namespace syncer | 291 } // namespace syncer |
OLD | NEW |