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