| OLD | NEW |
| 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/build_and_process_conflict_sets_command.h" | 5 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 using std::vector; | 28 using std::vector; |
| 29 | 29 |
| 30 BuildAndProcessConflictSetsCommand::BuildAndProcessConflictSetsCommand() {} | 30 BuildAndProcessConflictSetsCommand::BuildAndProcessConflictSetsCommand() {} |
| 31 BuildAndProcessConflictSetsCommand::~BuildAndProcessConflictSetsCommand() {} | 31 BuildAndProcessConflictSetsCommand::~BuildAndProcessConflictSetsCommand() {} |
| 32 | 32 |
| 33 std::set<ModelSafeGroup> BuildAndProcessConflictSetsCommand::GetGroupsToChange( | 33 std::set<ModelSafeGroup> BuildAndProcessConflictSetsCommand::GetGroupsToChange( |
| 34 const sessions::SyncSession& session) const { | 34 const sessions::SyncSession& session) const { |
| 35 return session.GetEnabledGroupsWithConflicts(); | 35 return session.GetEnabledGroupsWithConflicts(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void BuildAndProcessConflictSetsCommand::ModelChangingExecuteImpl( | 38 SyncerError BuildAndProcessConflictSetsCommand::ModelChangingExecuteImpl( |
| 39 SyncSession* session) { | 39 SyncSession* session) { |
| 40 session->mutable_status_controller()->update_conflict_sets_built( | 40 session->mutable_status_controller()->update_conflict_sets_built( |
| 41 BuildAndProcessConflictSets(session)); | 41 BuildAndProcessConflictSets(session)); |
| 42 return NO_ERROR; |
| 42 } | 43 } |
| 43 | 44 |
| 44 bool BuildAndProcessConflictSetsCommand::BuildAndProcessConflictSets( | 45 bool BuildAndProcessConflictSetsCommand::BuildAndProcessConflictSets( |
| 45 SyncSession* session) { | 46 SyncSession* session) { |
| 46 syncable::ScopedDirLookup dir(session->context()->directory_manager(), | 47 syncable::ScopedDirLookup dir(session->context()->directory_manager(), |
| 47 session->context()->account_name()); | 48 session->context()->account_name()); |
| 48 if (!dir.good()) | 49 if (!dir.good()) |
| 49 return false; | 50 return false; |
| 50 bool had_single_direction_sets = false; | 51 bool had_single_direction_sets = false; |
| 51 { // Scope for transaction. | 52 { // Scope for transaction. |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 LocallyDeletedPathChecker checker; | 411 LocallyDeletedPathChecker checker; |
| 411 if (!checker.CausingConflict(parent, *entry)) | 412 if (!checker.CausingConflict(parent, *entry)) |
| 412 return; | 413 return; |
| 413 conflict_progress->MergeSets(entry->Get(syncable::ID), | 414 conflict_progress->MergeSets(entry->Get(syncable::ID), |
| 414 parent.Get(syncable::ID)); | 415 parent.Get(syncable::ID)); |
| 415 CrawlDeletedTreeMergingSets(trans, parent, conflict_progress, checker); | 416 CrawlDeletedTreeMergingSets(trans, parent, conflict_progress, checker); |
| 416 } | 417 } |
| 417 } | 418 } |
| 418 | 419 |
| 419 } // namespace browser_sync | 420 } // namespace browser_sync |
| OLD | NEW |