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

Side by Side Diff: chrome/browser/sync/engine/verify_updates_command.cc

Issue 8638001: [Sync] Made some sync session member functions const (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix latent bug in StatusController Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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 4
5 #include "chrome/browser/sync/engine/verify_updates_command.h" 5 #include "chrome/browser/sync/engine/verify_updates_command.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "chrome/browser/sync/engine/syncer.h" 10 #include "chrome/browser/sync/engine/syncer.h"
(...skipping 19 matching lines...) Expand all
30 void VerifyUpdatesCommand::ModelChangingExecuteImpl( 30 void VerifyUpdatesCommand::ModelChangingExecuteImpl(
31 sessions::SyncSession* session) { 31 sessions::SyncSession* session) {
32 VLOG(1) << "Beginning Update Verification"; 32 VLOG(1) << "Beginning Update Verification";
33 ScopedDirLookup dir(session->context()->directory_manager(), 33 ScopedDirLookup dir(session->context()->directory_manager(),
34 session->context()->account_name()); 34 session->context()->account_name());
35 if (!dir.good()) { 35 if (!dir.good()) {
36 LOG(ERROR) << "Scoped dir lookup failed!"; 36 LOG(ERROR) << "Scoped dir lookup failed!";
37 return; 37 return;
38 } 38 }
39 WriteTransaction trans(FROM_HERE, SYNCER, dir); 39 WriteTransaction trans(FROM_HERE, SYNCER, dir);
40 sessions::StatusController* status = session->status_controller(); 40 sessions::StatusController* status = session->mutable_status_controller();
41 const GetUpdatesResponse& updates = status->updates_response().get_updates(); 41 const GetUpdatesResponse& updates = status->updates_response().get_updates();
42 int update_count = updates.entries().size(); 42 int update_count = updates.entries().size();
43 43
44 VLOG(1) << update_count << " entries to verify"; 44 VLOG(1) << update_count << " entries to verify";
45 for (int i = 0; i < update_count; i++) { 45 for (int i = 0; i < update_count; i++) {
46 const SyncEntity& update = 46 const SyncEntity& update =
47 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i))); 47 *reinterpret_cast<const SyncEntity *>(&(updates.entries(i)));
48 ModelSafeGroup g = GetGroupForModelType(update.GetModelType(), 48 ModelSafeGroup g = GetGroupForModelType(update.GetModelType(),
49 session->routing_info()); 49 session->routing_info());
50 if (g != status->group_restriction()) 50 if (g != status->group_restriction())
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 deleted, is_directory, model_type); 120 deleted, is_directory, model_type);
121 } 121 }
122 122
123 if (VERIFY_UNDECIDED == result.value) 123 if (VERIFY_UNDECIDED == result.value)
124 result.value = VERIFY_SUCCESS; // No news is good news. 124 result.value = VERIFY_SUCCESS; // No news is good news.
125 125
126 return result; // This might be VERIFY_SUCCESS as well 126 return result; // This might be VERIFY_SUCCESS as well
127 } 127 }
128 128
129 } // namespace browser_sync 129 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_unittest.cc ('k') | chrome/browser/sync/engine/verify_updates_command_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698