| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/engine/syncer.h" | 5 #include "sync/engine/syncer.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 next_step = SYNCER_END; | 234 next_step = SYNCER_END; |
| 235 break; | 235 break; |
| 236 } | 236 } |
| 237 default: | 237 default: |
| 238 LOG(ERROR) << "Unknown command: " << current_step; | 238 LOG(ERROR) << "Unknown command: " << current_step; |
| 239 } | 239 } |
| 240 DVLOG(2) << "last step: " << SyncerStepToString(last_step) << ", " | 240 DVLOG(2) << "last step: " << SyncerStepToString(last_step) << ", " |
| 241 << "current step: " << SyncerStepToString(current_step) << ", " | 241 << "current step: " << SyncerStepToString(current_step) << ", " |
| 242 << "next step: " << SyncerStepToString(next_step) << ", " | 242 << "next step: " << SyncerStepToString(next_step) << ", " |
| 243 << "snapshot: " << session->TakeSnapshot().ToString(); | 243 << "snapshot: " << session->TakeSnapshot().ToString(); |
| 244 if (last_step == current_step) | 244 if (last_step == current_step) { |
| 245 session->SetFinished(); |
| 245 break; | 246 break; |
| 247 } |
| 246 current_step = next_step; | 248 current_step = next_step; |
| 247 } | 249 } |
| 248 } | 250 } |
| 249 | 251 |
| 250 void Syncer::ProcessClientCommand(sessions::SyncSession* session) { | 252 void Syncer::ProcessClientCommand(sessions::SyncSession* session) { |
| 251 const ClientToServerResponse& response = | 253 const ClientToServerResponse& response = |
| 252 session->status_controller().updates_response(); | 254 session->status_controller().updates_response(); |
| 253 if (!response.has_client_command()) | 255 if (!response.has_client_command()) |
| 254 return; | 256 return; |
| 255 const ClientCommand& command = response.client_command(); | 257 const ClientCommand& command = response.client_command(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 entry->Put(SERVER_CTIME, Time()); | 296 entry->Put(SERVER_CTIME, Time()); |
| 295 entry->Put(SERVER_VERSION, 0); | 297 entry->Put(SERVER_VERSION, 0); |
| 296 entry->Put(SERVER_IS_DIR, false); | 298 entry->Put(SERVER_IS_DIR, false); |
| 297 entry->Put(SERVER_IS_DEL, false); | 299 entry->Put(SERVER_IS_DEL, false); |
| 298 entry->Put(IS_UNAPPLIED_UPDATE, false); | 300 entry->Put(IS_UNAPPLIED_UPDATE, false); |
| 299 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 301 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
| 300 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 302 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
| 301 } | 303 } |
| 302 | 304 |
| 303 } // namespace browser_sync | 305 } // namespace browser_sync |
| OLD | NEW |