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

Unified Diff: sync/engine/syncer_proto_util.cc

Issue 11533014: Merge 172232 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years 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
« no previous file with comments | « sync/engine/store_timestamps_command.cc ('k') | sync/internal_api/public/base/model_type.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/syncer_proto_util.cc
===================================================================
--- sync/engine/syncer_proto_util.cc (revision 172388)
+++ sync/engine/syncer_proto_util.cc (working copy)
@@ -117,8 +117,13 @@
<< "MIGRATION_DONE but no types specified.";
ModelTypeSet to_migrate;
for (int i = 0; i < response->migrated_data_type_id_size(); i++) {
- to_migrate.Put(GetModelTypeFromSpecificsFieldNumber(
- response->migrated_data_type_id(i)));
+ int field_number = response->migrated_data_type_id(i);
+ ModelType model_type = GetModelTypeFromSpecificsFieldNumber(field_number);
+ if (!IsRealDataType(model_type)) {
+ NOTREACHED() << "Unknown field number " << field_number;
+ continue;
+ }
+ to_migrate.Put(model_type);
}
// TODO(akalin): This should be a set union.
session->mutable_status_controller()->
@@ -322,9 +327,14 @@
// THROTTLED is currently the only error code that uses |error_data_types|.
DCHECK_EQ(error.error_type(), sync_pb::SyncEnums::THROTTLED);
for (int i = 0; i < error.error_data_type_ids_size(); ++i) {
- sync_protocol_error.error_data_types.Put(
- GetModelTypeFromSpecificsFieldNumber(
- error.error_data_type_ids(i)));
+ int field_number = error.error_data_type_ids(i);
+ ModelType model_type =
+ GetModelTypeFromSpecificsFieldNumber(field_number);
+ if (!IsRealDataType(model_type)) {
+ NOTREACHED() << "Unknown field number " << field_number;
+ continue;
+ }
+ sync_protocol_error.error_data_types.Put(model_type);
}
}
« no previous file with comments | « sync/engine/store_timestamps_command.cc ('k') | sync/internal_api/public/base/model_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698