summaryrefslogtreecommitdiffstats
path: root/sync/notifier
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-26 03:13:46 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-26 03:13:46 +0000
commit177bcf2f346f89e8e56b8e301fc3dc5ec9b060a0 (patch)
treee91760b246ccdec98f279cd19ad80037830218f3 /sync/notifier
parent721e176bce5a03c2c8b5b1a1ff32cbf3d33b4d5e (diff)
downloadchromium_src-177bcf2f346f89e8e56b8e301fc3dc5ec9b060a0.zip
chromium_src-177bcf2f346f89e8e56b8e301fc3dc5ec9b060a0.tar.gz
chromium_src-177bcf2f346f89e8e56b8e301fc3dc5ec9b060a0.tar.bz2
[Sync] Don't send notifications with no changed types
They would get dropped by the recipients anyway. BUG=138893 TEST= Review URL: https://chromiumcodereview.appspot.com/10830023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/notifier')
-rw-r--r--sync/notifier/p2p_notifier.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sync/notifier/p2p_notifier.cc b/sync/notifier/p2p_notifier.cc
index 9466d4b..5d5aeff 100644
--- a/sync/notifier/p2p_notifier.cc
+++ b/sync/notifier/p2p_notifier.cc
@@ -271,6 +271,11 @@ void P2PNotifier::SendNotificationDataForTest(
void P2PNotifier::SendNotificationData(
const P2PNotificationData& notification_data) {
DCHECK(thread_checker_.CalledOnValidThread());
+ if (notification_data.GetChangedTypes().Empty()) {
+ DVLOG(1) << "Not sending XMPP notification with no changed types: "
+ << notification_data.ToString();
+ return;
+ }
notifier::Notification notification;
notification.channel = kSyncP2PNotificationChannel;
notification.data = notification_data.ToString();