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

Side by Side Diff: sync/notifier/p2p_notifier.cc

Issue 10830023: [Sync] Don't send notifications with no changed types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_notifier.h" 5 #include "sync/notifier/p2p_notifier.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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 void P2PNotifier::SendNotificationDataForTest( 275 void P2PNotifier::SendNotificationDataForTest(
276 const P2PNotificationData& notification_data) { 276 const P2PNotificationData& notification_data) {
277 DCHECK(thread_checker_.CalledOnValidThread()); 277 DCHECK(thread_checker_.CalledOnValidThread());
278 SendNotificationData(notification_data); 278 SendNotificationData(notification_data);
279 } 279 }
280 280
281 void P2PNotifier::SendNotificationData( 281 void P2PNotifier::SendNotificationData(
282 const P2PNotificationData& notification_data) { 282 const P2PNotificationData& notification_data) {
283 DCHECK(thread_checker_.CalledOnValidThread()); 283 DCHECK(thread_checker_.CalledOnValidThread());
284 if (notification_data.GetChangedTypes().Empty()) {
285 DVLOG(1) << "Not sending XMPP notification with no changed types: "
286 << notification_data.ToString();
287 return;
288 }
284 notifier::Notification notification; 289 notifier::Notification notification;
285 notification.channel = kSyncP2PNotificationChannel; 290 notification.channel = kSyncP2PNotificationChannel;
286 notification.data = notification_data.ToString(); 291 notification.data = notification_data.ToString();
287 DVLOG(1) << "Sending XMPP notification: " << notification.ToString(); 292 DVLOG(1) << "Sending XMPP notification: " << notification.ToString();
288 push_client_->SendNotification(notification); 293 push_client_->SendNotification(notification);
289 } 294 }
290 295
291 } // namespace syncer 296 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698