OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 | 5 |
6 #include "chrome/browser/sync/engine/verify_updates_command.h" | 6 #include "chrome/browser/sync/engine/verify_updates_command.h" |
7 | 7 |
8 #include "chrome/browser/sync/engine/syncer.h" | 8 #include "chrome/browser/sync/engine/syncer.h" |
9 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 9 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
10 #include "chrome/browser/sync/engine/syncer_types.h" | 10 #include "chrome/browser/sync/engine/syncer_types.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 LOG(ERROR) << "Scoped dir lookup failed!"; | 35 LOG(ERROR) << "Scoped dir lookup failed!"; |
36 return; | 36 return; |
37 } | 37 } |
38 WriteTransaction trans(dir, SYNCER, __FILE__, __LINE__); | 38 WriteTransaction trans(dir, SYNCER, __FILE__, __LINE__); |
39 sessions::StatusController* status = session->status_controller(); | 39 sessions::StatusController* status = session->status_controller(); |
40 const GetUpdatesResponse& updates = status->updates_response().get_updates(); | 40 const GetUpdatesResponse& updates = status->updates_response().get_updates(); |
41 int update_count = updates.entries().size(); | 41 int update_count = updates.entries().size(); |
42 | 42 |
43 LOG(INFO) << update_count << " entries to verify"; | 43 LOG(INFO) << update_count << " entries to verify"; |
44 for (int i = 0; i < update_count; i++) { | 44 for (int i = 0; i < update_count; i++) { |
45 const SyncEntity entry = | 45 const SyncEntity& entry = |
46 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); | 46 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); |
47 ModelSafeGroup g = GetGroupForModelType(entry.GetModelType(), | 47 ModelSafeGroup g = GetGroupForModelType(entry.GetModelType(), |
48 session->routing_info()); | 48 session->routing_info()); |
49 if (g != status->group_restriction()) | 49 if (g != status->group_restriction()) |
50 continue; | 50 continue; |
51 | 51 |
52 // Needs to be done separately in order to make sure the update processing | 52 // Needs to be done separately in order to make sure the update processing |
53 // still happens like normal. We should really just use one type of | 53 // still happens like normal. We should really just use one type of |
54 // ID in fact, there isn't actually a need for server_knows and not IDs. | 54 // ID in fact, there isn't actually a need for server_knows and not IDs. |
55 SyncerUtil::AttemptReuniteLostCommitResponses(&trans, entry, | 55 SyncerUtil::AttemptReuniteLostCommitResponses(&trans, entry, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 deleted, is_directory, model_type); | 129 deleted, is_directory, model_type); |
130 } | 130 } |
131 | 131 |
132 if (VERIFY_UNDECIDED == result.value) | 132 if (VERIFY_UNDECIDED == result.value) |
133 result.value = VERIFY_SUCCESS; // No news is good news. | 133 result.value = VERIFY_SUCCESS; // No news is good news. |
134 | 134 |
135 return result; // This might be VERIFY_SUCCESS as well | 135 return result; // This might be VERIFY_SUCCESS as well |
136 } | 136 } |
137 | 137 |
138 } // namespace browser_sync | 138 } // namespace browser_sync |
OLD | NEW |