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

Unified Diff: sync/notifier/p2p_notifier.cc

Issue 10833004: [Sync] Make P2PNotifier emit a notification only if some enabled types changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed MC_DeleteBookmarks Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: sync/notifier/p2p_notifier.cc
diff --git a/sync/notifier/p2p_notifier.cc b/sync/notifier/p2p_notifier.cc
index e2a4209bfdd3b8bd0d363df1978a36cf97b97e36..c4fcfbe649eab9dd939630969d76165031d42984 100644
--- a/sync/notifier/p2p_notifier.cc
+++ b/sync/notifier/p2p_notifier.cc
@@ -260,13 +260,14 @@ void P2PNotifier::OnIncomingNotification(
<< "not emitting notification";
return;
}
- if (notification_data.GetChangedTypes().Empty()) {
- DVLOG(1) << "No changed types -- not emitting notification";
+ const ModelTypeSet types_to_notify =
+ Intersection(enabled_types_, notification_data.GetChangedTypes());
+ if (types_to_notify.Empty()) {
+ DVLOG(1) << "No enabled and changed types -- not emitting notification";
return;
}
const ModelTypePayloadMap& type_payloads =
- ModelTypePayloadMapFromEnumSet(
- notification_data.GetChangedTypes(), std::string());
+ ModelTypePayloadMapFromEnumSet(types_to_notify, std::string());
FOR_EACH_OBSERVER(SyncNotifierObserver, observer_list_,
OnIncomingNotification(type_payloads, REMOTE_NOTIFICATION));
}
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc ('k') | sync/notifier/p2p_notifier_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698