OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/tracked.h" |
8 #include "chrome/browser/sync/engine/syncer.h" | 9 #include "chrome/browser/sync/engine/syncer.h" |
9 #include "chrome/browser/sync/engine/syncer_proto_util.h" | 10 #include "chrome/browser/sync/engine/syncer_proto_util.h" |
10 #include "chrome/browser/sync/engine/syncer_types.h" | 11 #include "chrome/browser/sync/engine/syncer_types.h" |
11 #include "chrome/browser/sync/engine/syncer_util.h" | 12 #include "chrome/browser/sync/engine/syncer_util.h" |
12 #include "chrome/browser/sync/engine/syncproto.h" | 13 #include "chrome/browser/sync/engine/syncproto.h" |
13 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 14 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
14 #include "chrome/browser/sync/syncable/directory_manager.h" | 15 #include "chrome/browser/sync/syncable/directory_manager.h" |
15 #include "chrome/browser/sync/syncable/syncable.h" | 16 #include "chrome/browser/sync/syncable/syncable.h" |
16 | 17 |
17 namespace browser_sync { | 18 namespace browser_sync { |
(...skipping 10 matching lines...) Expand all Loading... |
28 | 29 |
29 void VerifyUpdatesCommand::ModelChangingExecuteImpl( | 30 void VerifyUpdatesCommand::ModelChangingExecuteImpl( |
30 sessions::SyncSession* session) { | 31 sessions::SyncSession* session) { |
31 VLOG(1) << "Beginning Update Verification"; | 32 VLOG(1) << "Beginning Update Verification"; |
32 ScopedDirLookup dir(session->context()->directory_manager(), | 33 ScopedDirLookup dir(session->context()->directory_manager(), |
33 session->context()->account_name()); | 34 session->context()->account_name()); |
34 if (!dir.good()) { | 35 if (!dir.good()) { |
35 LOG(ERROR) << "Scoped dir lookup failed!"; | 36 LOG(ERROR) << "Scoped dir lookup failed!"; |
36 return; | 37 return; |
37 } | 38 } |
38 WriteTransaction trans(dir, SYNCER, __FILE__, __LINE__); | 39 WriteTransaction trans(dir, SYNCER, FROM_HERE); |
39 sessions::StatusController* status = session->status_controller(); | 40 sessions::StatusController* status = session->status_controller(); |
40 const GetUpdatesResponse& updates = status->updates_response().get_updates(); | 41 const GetUpdatesResponse& updates = status->updates_response().get_updates(); |
41 int update_count = updates.entries().size(); | 42 int update_count = updates.entries().size(); |
42 | 43 |
43 VLOG(1) << update_count << " entries to verify"; | 44 VLOG(1) << update_count << " entries to verify"; |
44 for (int i = 0; i < update_count; i++) { | 45 for (int i = 0; i < update_count; i++) { |
45 const SyncEntity& update = | 46 const SyncEntity& update = |
46 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); | 47 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); |
47 ModelSafeGroup g = GetGroupForModelType(update.GetModelType(), | 48 ModelSafeGroup g = GetGroupForModelType(update.GetModelType(), |
48 session->routing_info()); | 49 session->routing_info()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 deleted, is_directory, model_type); | 120 deleted, is_directory, model_type); |
120 } | 121 } |
121 | 122 |
122 if (VERIFY_UNDECIDED == result.value) | 123 if (VERIFY_UNDECIDED == result.value) |
123 result.value = VERIFY_SUCCESS; // No news is good news. | 124 result.value = VERIFY_SUCCESS; // No news is good news. |
124 | 125 |
125 return result; // This might be VERIFY_SUCCESS as well | 126 return result; // This might be VERIFY_SUCCESS as well |
126 } | 127 } |
127 | 128 |
128 } // namespace browser_sync | 129 } // namespace browser_sync |
OLD | NEW |