OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_util.h" | 5 #include "chrome/browser/sync/engine/syncer_util.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 509 |
510 // This function is called on an entry when we can update the user-facing data | 510 // This function is called on an entry when we can update the user-facing data |
511 // from the server data. | 511 // from the server data. |
512 // static | 512 // static |
513 void SyncerUtil::UpdateLocalDataFromServerData( | 513 void SyncerUtil::UpdateLocalDataFromServerData( |
514 syncable::WriteTransaction* trans, | 514 syncable::WriteTransaction* trans, |
515 syncable::MutableEntry* entry) { | 515 syncable::MutableEntry* entry) { |
516 DCHECK(!entry->Get(IS_UNSYNCED)); | 516 DCHECK(!entry->Get(IS_UNSYNCED)); |
517 DCHECK(entry->Get(IS_UNAPPLIED_UPDATE)); | 517 DCHECK(entry->Get(IS_UNAPPLIED_UPDATE)); |
518 | 518 |
519 VLOG(1) << "Updating entry : " << *entry; | 519 VLOG(2) << "Updating entry : " << *entry; |
520 // Start by setting the properties that determine the model_type. | 520 // Start by setting the properties that determine the model_type. |
521 entry->Put(SPECIFICS, entry->Get(SERVER_SPECIFICS)); | 521 entry->Put(SPECIFICS, entry->Get(SERVER_SPECIFICS)); |
522 entry->Put(IS_DIR, entry->Get(SERVER_IS_DIR)); | 522 entry->Put(IS_DIR, entry->Get(SERVER_IS_DIR)); |
523 // This strange dance around the IS_DEL flag avoids problems when setting | 523 // This strange dance around the IS_DEL flag avoids problems when setting |
524 // the name. | 524 // the name. |
525 // TODO(chron): Is this still an issue? Unit test this codepath. | 525 // TODO(chron): Is this still an issue? Unit test this codepath. |
526 if (entry->Get(SERVER_IS_DEL)) { | 526 if (entry->Get(SERVER_IS_DEL)) { |
527 entry->Put(IS_DEL, true); | 527 entry->Put(IS_DEL, true); |
528 } else { | 528 } else { |
529 entry->Put(NON_UNIQUE_NAME, entry->Get(SERVER_NON_UNIQUE_NAME)); | 529 entry->Put(NON_UNIQUE_NAME, entry->Get(SERVER_NON_UNIQUE_NAME)); |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 | 862 |
863 // |update_entry| is considered to be somewhere after |candidate|, so store | 863 // |update_entry| is considered to be somewhere after |candidate|, so store |
864 // it as the upper bound. | 864 // it as the upper bound. |
865 closest_sibling = candidate.Get(ID); | 865 closest_sibling = candidate.Get(ID); |
866 } | 866 } |
867 | 867 |
868 return closest_sibling; | 868 return closest_sibling; |
869 } | 869 } |
870 | 870 |
871 } // namespace browser_sync | 871 } // namespace browser_sync |
OLD | NEW |