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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 const P2PNotificationData notification_data( | 171 const P2PNotificationData notification_data( |
172 unique_id_, NOTIFY_SELF, ObjectIdSetToInvalidationMap(new_ids, "")); | 172 unique_id_, NOTIFY_SELF, ObjectIdSetToInvalidationMap(new_ids, "")); |
173 SendNotificationData(notification_data); | 173 SendNotificationData(notification_data); |
174 } | 174 } |
175 | 175 |
176 void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) { | 176 void P2PInvalidator::UnregisterHandler(InvalidationHandler* handler) { |
177 DCHECK(thread_checker_.CalledOnValidThread()); | 177 DCHECK(thread_checker_.CalledOnValidThread()); |
178 registrar_.UnregisterHandler(handler); | 178 registrar_.UnregisterHandler(handler); |
179 } | 179 } |
180 | 180 |
| 181 void P2PInvalidator::Acknowledge(const invalidation::ObjectId& id, |
| 182 const AckHandle& ack_handle) { |
| 183 DCHECK(thread_checker_.CalledOnValidThread()); |
| 184 // Do nothing for the P2P implementation. |
| 185 } |
| 186 |
181 InvalidatorState P2PInvalidator::GetInvalidatorState() const { | 187 InvalidatorState P2PInvalidator::GetInvalidatorState() const { |
182 DCHECK(thread_checker_.CalledOnValidThread()); | 188 DCHECK(thread_checker_.CalledOnValidThread()); |
183 return registrar_.GetInvalidatorState(); | 189 return registrar_.GetInvalidatorState(); |
184 } | 190 } |
185 | 191 |
186 void P2PInvalidator::SetUniqueId(const std::string& unique_id) { | 192 void P2PInvalidator::SetUniqueId(const std::string& unique_id) { |
187 DCHECK(thread_checker_.CalledOnValidThread()); | 193 DCHECK(thread_checker_.CalledOnValidThread()); |
188 unique_id_ = unique_id; | 194 unique_id_ = unique_id; |
189 } | 195 } |
190 | 196 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 return; | 287 return; |
282 } | 288 } |
283 notifier::Notification notification; | 289 notifier::Notification notification; |
284 notification.channel = kSyncP2PNotificationChannel; | 290 notification.channel = kSyncP2PNotificationChannel; |
285 notification.data = notification_data.ToString(); | 291 notification.data = notification_data.ToString(); |
286 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); | 292 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); |
287 push_client_->SendNotification(notification); | 293 push_client_->SendNotification(notification); |
288 } | 294 } |
289 | 295 |
290 } // namespace syncer | 296 } // namespace syncer |
OLD | NEW |