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

Unified Diff: chrome/browser/notifications/sync_notifier/synced_notification_app_info_service.cc

Issue 202993002: Fix "unreachable code" warnings (MSVC warning 4702) in chrome/browser/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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: chrome/browser/notifications/sync_notifier/synced_notification_app_info_service.cc
===================================================================
--- chrome/browser/notifications/sync_notifier/synced_notification_app_info_service.cc (revision 256983)
+++ chrome/browser/notifications/sync_notifier/synced_notification_app_info_service.cc (working copy)
@@ -42,14 +42,15 @@
syncer::SyncMergeResult merge_result(syncer::SYNCED_NOTIFICATION_APP_INFO);
// There should only be one sync data in the list for this data type.
- if (initial_sync_data.size() != 1 && initial_sync_data.size() != 0) {
+ if (initial_sync_data.size() > 1) {
LOG(ERROR) << "Too many app infos over sync";
}
- for (syncer::SyncDataList::const_iterator it = initial_sync_data.begin();
- it != initial_sync_data.end();
- ++it) {
- const syncer::SyncData& sync_data = *it;
+ // TODO(petewil): Today we can only handle a single object, so we simply check
+ // for a non-empty list. If in the future we can ever handle more, convert
+ // this whole block to be a loop over all of |initial_sync_data|.
+ if (!initial_sync_data.empty()) {
+ const syncer::SyncData& sync_data = initial_sync_data.front();
DCHECK_EQ(syncer::SYNCED_NOTIFICATION_APP_INFO, sync_data.GetDataType());
const sync_pb::SyncedNotificationAppInfoSpecifics& specifics =
@@ -69,10 +70,6 @@
ProcessIncomingAppInfoProtobuf(app_info);
}
-
- // TODO(petewil): Today we can only handle a single object, so we break
- // here. In the future if we can ever handle more, remove the next line.
- break;
}
return merge_result;
« no previous file with comments | « chrome/browser/media/chrome_webrtc_apprtc_browsertest.cc ('k') | chrome/browser/prefs/incognito_mode_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698