OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // | |
5 | 4 |
6 #include "chrome/browser/sync/engine/verify_updates_command.h" | 5 #include "chrome/browser/sync/engine/verify_updates_command.h" |
7 | 6 |
| 7 #include "base/tracked.h" |
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" |
11 #include "chrome/browser/sync/engine/syncer_util.h" | 11 #include "chrome/browser/sync/engine/syncer_util.h" |
12 #include "chrome/browser/sync/engine/syncproto.h" | 12 #include "chrome/browser/sync/engine/syncproto.h" |
13 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" | 13 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" |
14 #include "chrome/browser/sync/syncable/directory_manager.h" | 14 #include "chrome/browser/sync/syncable/directory_manager.h" |
15 #include "chrome/browser/sync/syncable/syncable.h" | 15 #include "chrome/browser/sync/syncable/syncable.h" |
16 | 16 |
17 namespace browser_sync { | 17 namespace browser_sync { |
(...skipping 10 matching lines...) Expand all Loading... |
28 | 28 |
29 void VerifyUpdatesCommand::ModelChangingExecuteImpl( | 29 void VerifyUpdatesCommand::ModelChangingExecuteImpl( |
30 sessions::SyncSession* session) { | 30 sessions::SyncSession* session) { |
31 VLOG(1) << "Beginning Update Verification"; | 31 VLOG(1) << "Beginning Update Verification"; |
32 ScopedDirLookup dir(session->context()->directory_manager(), | 32 ScopedDirLookup dir(session->context()->directory_manager(), |
33 session->context()->account_name()); | 33 session->context()->account_name()); |
34 if (!dir.good()) { | 34 if (!dir.good()) { |
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, FROM_HERE); |
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 VLOG(1) << update_count << " entries to verify"; | 43 VLOG(1) << 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& update = | 45 const SyncEntity& update = |
46 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); | 46 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); |
47 ModelSafeGroup g = GetGroupForModelType(update.GetModelType(), | 47 ModelSafeGroup g = GetGroupForModelType(update.GetModelType(), |
48 session->routing_info()); | 48 session->routing_info()); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 deleted, is_directory, model_type); | 119 deleted, is_directory, model_type); |
120 } | 120 } |
121 | 121 |
122 if (VERIFY_UNDECIDED == result.value) | 122 if (VERIFY_UNDECIDED == result.value) |
123 result.value = VERIFY_SUCCESS; // No news is good news. | 123 result.value = VERIFY_SUCCESS; // No news is good news. |
124 | 124 |
125 return result; // This might be VERIFY_SUCCESS as well | 125 return result; // This might be VERIFY_SUCCESS as well |
126 } | 126 } |
127 | 127 |
128 } // namespace browser_sync | 128 } // namespace browser_sync |
OLD | NEW |