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

Unified Diff: sync/engine/store_timestamps_command.cc

Issue 11490018: [Sync] Handle invalid specifics field numbers gracefully (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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 | « no previous file | sync/engine/syncer_proto_util.cc » ('j') | sync/engine/syncer_proto_util.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/store_timestamps_command.cc
diff --git a/sync/engine/store_timestamps_command.cc b/sync/engine/store_timestamps_command.cc
index bab995e7a99ce830607fabf324245874bed17349..6f381b0d7a36510fdb1f0e64a658c5d001f47422 100644
--- a/sync/engine/store_timestamps_command.cc
+++ b/sync/engine/store_timestamps_command.cc
@@ -28,15 +28,14 @@ SyncerError StoreTimestampsCommand::ExecuteImpl(
// state.
ModelTypeSet forward_progress_types;
for (int i = 0; i < updates.new_progress_marker_size(); ++i) {
- ModelType model =
- GetModelTypeFromSpecificsFieldNumber(
- updates.new_progress_marker(i).data_type_id());
- if (model == UNSPECIFIED || model == TOP_LEVEL_FOLDER) {
- NOTREACHED() << "Unintelligible server response.";
+ int field_number = updates.new_progress_marker(i).data_type_id();
+ ModelType model_type = GetModelTypeFromSpecificsFieldNumber(field_number);
+ if (!IsRealDataType(model_type)) {
+ NOTREACHED() << "Unknown field number " << field_number;
continue;
}
- forward_progress_types.Put(model);
- dir->SetDownloadProgress(model, updates.new_progress_marker(i));
+ forward_progress_types.Put(model_type);
+ dir->SetDownloadProgress(model_type, updates.new_progress_marker(i));
}
DCHECK(!forward_progress_types.Empty() ||
updates.changes_remaining() == 0);
« no previous file with comments | « no previous file | sync/engine/syncer_proto_util.cc » ('j') | sync/engine/syncer_proto_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698