| 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/syncer.h" | 5 #include "chrome/browser/sync/engine/syncer.h" | 
| 6 | 6 | 
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" | 
| 8 #include "base/time.h" | 8 #include "base/time.h" | 
|  | 9 #include "base/tracked.h" | 
| 9 #include "chrome/browser/sync/engine/apply_updates_command.h" | 10 #include "chrome/browser/sync/engine/apply_updates_command.h" | 
| 10 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" | 11 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" | 
| 11 #include "chrome/browser/sync/engine/build_commit_command.h" | 12 #include "chrome/browser/sync/engine/build_commit_command.h" | 
| 12 #include "chrome/browser/sync/engine/cleanup_disabled_types_command.h" | 13 #include "chrome/browser/sync/engine/cleanup_disabled_types_command.h" | 
| 13 #include "chrome/browser/sync/engine/clear_data_command.h" | 14 #include "chrome/browser/sync/engine/clear_data_command.h" | 
| 14 #include "chrome/browser/sync/engine/conflict_resolver.h" | 15 #include "chrome/browser/sync/engine/conflict_resolver.h" | 
| 15 #include "chrome/browser/sync/engine/download_updates_command.h" | 16 #include "chrome/browser/sync/engine/download_updates_command.h" | 
| 16 #include "chrome/browser/sync/engine/get_commit_ids_command.h" | 17 #include "chrome/browser/sync/engine/get_commit_ids_command.h" | 
| 17 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 18 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 
| 18 #include "chrome/browser/sync/engine/post_commit_message_command.h" | 19 #include "chrome/browser/sync/engine/post_commit_message_command.h" | 
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 160       case BUILD_COMMIT_REQUEST: { | 161       case BUILD_COMMIT_REQUEST: { | 
| 161         session->status_controller()->set_syncing(true); | 162         session->status_controller()->set_syncing(true); | 
| 162 | 163 | 
| 163         VLOG(1) << "Processing Commit Request"; | 164         VLOG(1) << "Processing Commit Request"; | 
| 164         ScopedDirLookup dir(session->context()->directory_manager(), | 165         ScopedDirLookup dir(session->context()->directory_manager(), | 
| 165                             session->context()->account_name()); | 166                             session->context()->account_name()); | 
| 166         if (!dir.good()) { | 167         if (!dir.good()) { | 
| 167           LOG(ERROR) << "Scoped dir lookup failed!"; | 168           LOG(ERROR) << "Scoped dir lookup failed!"; | 
| 168           return; | 169           return; | 
| 169         } | 170         } | 
| 170         WriteTransaction trans(dir, SYNCER, __FILE__, __LINE__); | 171         WriteTransaction trans(dir, SYNCER, FROM_HERE); | 
| 171         sessions::ScopedSetSessionWriteTransaction set_trans(session, &trans); | 172         sessions::ScopedSetSessionWriteTransaction set_trans(session, &trans); | 
| 172 | 173 | 
| 173         VLOG(1) << "Getting the Commit IDs"; | 174         VLOG(1) << "Getting the Commit IDs"; | 
| 174         GetCommitIdsCommand get_commit_ids_command( | 175         GetCommitIdsCommand get_commit_ids_command( | 
| 175             session->context()->max_commit_batch_size()); | 176             session->context()->max_commit_batch_size()); | 
| 176         get_commit_ids_command.Execute(session); | 177         get_commit_ids_command.Execute(session); | 
| 177 | 178 | 
| 178         if (!session->status_controller()->commit_ids().empty()) { | 179         if (!session->status_controller()->commit_ids().empty()) { | 
| 179           VLOG(1) << "Building a commit message"; | 180           VLOG(1) << "Building a commit message"; | 
| 180           BuildCommitCommand build_commit_command; | 181           BuildCommitCommand build_commit_command; | 
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 329   entry->Put(SERVER_CTIME, 0); | 330   entry->Put(SERVER_CTIME, 0); | 
| 330   entry->Put(SERVER_VERSION, 0); | 331   entry->Put(SERVER_VERSION, 0); | 
| 331   entry->Put(SERVER_IS_DIR, false); | 332   entry->Put(SERVER_IS_DIR, false); | 
| 332   entry->Put(SERVER_IS_DEL, false); | 333   entry->Put(SERVER_IS_DEL, false); | 
| 333   entry->Put(IS_UNAPPLIED_UPDATE, false); | 334   entry->Put(IS_UNAPPLIED_UPDATE, false); | 
| 334   entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 335   entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 
| 335   entry->Put(SERVER_POSITION_IN_PARENT, 0); | 336   entry->Put(SERVER_POSITION_IN_PARENT, 0); | 
| 336 } | 337 } | 
| 337 | 338 | 
| 338 }  // namespace browser_sync | 339 }  // namespace browser_sync | 
| OLD | NEW | 
|---|