| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 entry. | 3 // found in the LICENSE entry. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/engine/syncer.h" | 5 #include "chrome/browser/sync/engine/syncer.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 dest->Put(SERVER_IS_DIR, src->Get(SERVER_IS_DIR)); | 295 dest->Put(SERVER_IS_DIR, src->Get(SERVER_IS_DIR)); |
| 296 dest->Put(SERVER_IS_DEL, src->Get(SERVER_IS_DEL)); | 296 dest->Put(SERVER_IS_DEL, src->Get(SERVER_IS_DEL)); |
| 297 dest->Put(SERVER_IS_BOOKMARK_OBJECT, src->Get(SERVER_IS_BOOKMARK_OBJECT)); | 297 dest->Put(SERVER_IS_BOOKMARK_OBJECT, src->Get(SERVER_IS_BOOKMARK_OBJECT)); |
| 298 dest->Put(IS_UNAPPLIED_UPDATE, src->Get(IS_UNAPPLIED_UPDATE)); | 298 dest->Put(IS_UNAPPLIED_UPDATE, src->Get(IS_UNAPPLIED_UPDATE)); |
| 299 dest->Put(SERVER_BOOKMARK_URL, src->Get(SERVER_BOOKMARK_URL)); | 299 dest->Put(SERVER_BOOKMARK_URL, src->Get(SERVER_BOOKMARK_URL)); |
| 300 dest->Put(SERVER_BOOKMARK_FAVICON, src->Get(SERVER_BOOKMARK_FAVICON)); | 300 dest->Put(SERVER_BOOKMARK_FAVICON, src->Get(SERVER_BOOKMARK_FAVICON)); |
| 301 dest->Put(SERVER_POSITION_IN_PARENT, src->Get(SERVER_POSITION_IN_PARENT)); | 301 dest->Put(SERVER_POSITION_IN_PARENT, src->Get(SERVER_POSITION_IN_PARENT)); |
| 302 } | 302 } |
| 303 | 303 |
| 304 void ClearServerData(syncable::MutableEntry* entry) { | 304 void ClearServerData(syncable::MutableEntry* entry) { |
| 305 entry->Put(SERVER_NON_UNIQUE_NAME, PSTR("")); | 305 entry->Put(SERVER_NON_UNIQUE_NAME, ""); |
| 306 entry->Put(SERVER_PARENT_ID, syncable::kNullId); | 306 entry->Put(SERVER_PARENT_ID, syncable::kNullId); |
| 307 entry->Put(SERVER_MTIME, 0); | 307 entry->Put(SERVER_MTIME, 0); |
| 308 entry->Put(SERVER_CTIME, 0); | 308 entry->Put(SERVER_CTIME, 0); |
| 309 entry->Put(SERVER_VERSION, 0); | 309 entry->Put(SERVER_VERSION, 0); |
| 310 entry->Put(SERVER_IS_DIR, false); | 310 entry->Put(SERVER_IS_DIR, false); |
| 311 entry->Put(SERVER_IS_DEL, false); | 311 entry->Put(SERVER_IS_DEL, false); |
| 312 entry->Put(SERVER_IS_BOOKMARK_OBJECT, false); | 312 entry->Put(SERVER_IS_BOOKMARK_OBJECT, false); |
| 313 entry->Put(IS_UNAPPLIED_UPDATE, false); | 313 entry->Put(IS_UNAPPLIED_UPDATE, false); |
| 314 entry->Put(SERVER_BOOKMARK_URL, PSTR("")); | 314 entry->Put(SERVER_BOOKMARK_URL, ""); |
| 315 entry->Put(SERVER_BOOKMARK_FAVICON, Blob()); | 315 entry->Put(SERVER_BOOKMARK_FAVICON, Blob()); |
| 316 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 316 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
| 317 } | 317 } |
| 318 | 318 |
| 319 std::string SyncEntityDebugString(const sync_pb::SyncEntity& entry) { | 319 std::string SyncEntityDebugString(const sync_pb::SyncEntity& entry) { |
| 320 return StringPrintf("id: %s, parent_id: %s, " | 320 return StringPrintf("id: %s, parent_id: %s, " |
| 321 "version: %"PRId64"d, " | 321 "version: %"PRId64"d, " |
| 322 "mtime: %" PRId64"d (client: %" PRId64"d), " | 322 "mtime: %" PRId64"d (client: %" PRId64"d), " |
| 323 "ctime: %" PRId64"d (client: %" PRId64"d), " | 323 "ctime: %" PRId64"d (client: %" PRId64"d), " |
| 324 "name: %s, sync_timestamp: %" PRId64"d, " | 324 "name: %s, sync_timestamp: %" PRId64"d, " |
| 325 "%s ", | 325 "%s ", |
| 326 entry.id_string().c_str(), | 326 entry.id_string().c_str(), |
| 327 entry.parent_id_string().c_str(), | 327 entry.parent_id_string().c_str(), |
| 328 entry.version(), | 328 entry.version(), |
| 329 entry.mtime(), ServerTimeToClientTime(entry.mtime()), | 329 entry.mtime(), ServerTimeToClientTime(entry.mtime()), |
| 330 entry.ctime(), ServerTimeToClientTime(entry.ctime()), | 330 entry.ctime(), ServerTimeToClientTime(entry.ctime()), |
| 331 entry.name().c_str(), entry.sync_timestamp(), | 331 entry.name().c_str(), entry.sync_timestamp(), |
| 332 entry.deleted() ? "deleted, ":""); | 332 entry.deleted() ? "deleted, ":""); |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace browser_sync | 335 } // namespace browser_sync |
| OLD | NEW |