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 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 unique_id_, NOTIFY_SELF, ObjectIdSetToInvalidationMap(new_ids, ""), | 193 unique_id_, NOTIFY_SELF, ObjectIdSetToInvalidationMap(new_ids, ""), |
194 REMOTE_INVALIDATION); | 194 REMOTE_INVALIDATION); |
195 SendNotificationData(notification_data); | 195 SendNotificationData(notification_data); |
196 } | 196 } |
197 | 197 |
198 void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) { | 198 void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) { |
199 DCHECK(thread_checker_.CalledOnValidThread()); | 199 DCHECK(thread_checker_.CalledOnValidThread()); |
200 registrar_.UnregisterHandler(handler); | 200 registrar_.UnregisterHandler(handler); |
201 } | 201 } |
202 | 202 |
| 203 void P2PInvalidator::Acknowledge(const invalidation::ObjectId& id, |
| 204 const AckHandle& ack_handle) { |
| 205 DCHECK(thread_checker_.CalledOnValidThread()); |
| 206 // Do nothing for the P2P implementation. |
| 207 } |
| 208 |
203 InvalidatorState P2PInvalidator::GetInvalidatorState() const { | 209 InvalidatorState P2PInvalidator::GetInvalidatorState() const { |
204 DCHECK(thread_checker_.CalledOnValidThread()); | 210 DCHECK(thread_checker_.CalledOnValidThread()); |
205 return registrar_.GetInvalidatorState(); | 211 return registrar_.GetInvalidatorState(); |
206 } | 212 } |
207 | 213 |
208 void P2PInvalidator::SetUniqueId(const std::string& unique_id) { | 214 void P2PInvalidator::SetUniqueId(const std::string& unique_id) { |
209 DCHECK(thread_checker_.CalledOnValidThread()); | 215 DCHECK(thread_checker_.CalledOnValidThread()); |
210 unique_id_ = unique_id; | 216 unique_id_ = unique_id; |
211 } | 217 } |
212 | 218 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 return; | 318 return; |
313 } | 319 } |
314 notifier::Notification notification; | 320 notifier::Notification notification; |
315 notification.channel = kSyncP2PNotificationChannel; | 321 notification.channel = kSyncP2PNotificationChannel; |
316 notification.data = notification_data.ToString(); | 322 notification.data = notification_data.ToString(); |
317 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); | 323 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); |
318 push_client_->SendNotification(notification); | 324 push_client_->SendNotification(notification); |
319 } | 325 } |
320 | 326 |
321 } // namespace syncer | 327 } // namespace syncer |
OLD | NEW |