Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: chrome/browser/sync/engine/syncer_util.cc

Issue 553015: Support for multiple sync ModelSafeWorkers.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 CHECK(local_entry->Get(ID) == server_entry.id()) 269 CHECK(local_entry->Get(ID) == server_entry.id())
270 << "ID Changing not supported here"; 270 << "ID Changing not supported here";
271 local_entry->Put(SERVER_PARENT_ID, server_entry.parent_id()); 271 local_entry->Put(SERVER_PARENT_ID, server_entry.parent_id());
272 local_entry->Put(SERVER_NON_UNIQUE_NAME, name); 272 local_entry->Put(SERVER_NON_UNIQUE_NAME, name);
273 local_entry->Put(SERVER_VERSION, server_entry.version()); 273 local_entry->Put(SERVER_VERSION, server_entry.version());
274 local_entry->Put(SERVER_CTIME, 274 local_entry->Put(SERVER_CTIME,
275 ServerTimeToClientTime(server_entry.ctime())); 275 ServerTimeToClientTime(server_entry.ctime()));
276 local_entry->Put(SERVER_MTIME, 276 local_entry->Put(SERVER_MTIME,
277 ServerTimeToClientTime(server_entry.mtime())); 277 ServerTimeToClientTime(server_entry.mtime()));
278 local_entry->Put(SERVER_IS_BOOKMARK_OBJECT, 278 local_entry->Put(SERVER_IS_BOOKMARK_OBJECT,
279 GetSyncDataType(server_entry) == SYNC_TYPE_BOOKMARK); 279 GetModelType(server_entry) == syncable::BOOKMARKS);
280 local_entry->Put(SERVER_IS_DIR, server_entry.IsFolder()); 280 local_entry->Put(SERVER_IS_DIR, server_entry.IsFolder());
281 if (server_entry.has_singleton_tag()) { 281 if (server_entry.has_singleton_tag()) {
282 const string& tag = server_entry.singleton_tag(); 282 const string& tag = server_entry.singleton_tag();
283 local_entry->Put(SINGLETON_TAG, tag); 283 local_entry->Put(SINGLETON_TAG, tag);
284 } 284 }
285 if (!server_entry.deleted()) { 285 if (!server_entry.deleted()) {
286 if (server_entry.specifics().HasExtension(sync_pb::bookmark)) { 286 if (server_entry.specifics().HasExtension(sync_pb::bookmark)) {
287 // New style bookmark data. 287 // New style bookmark data.
288 const sync_pb::BookmarkSpecifics& bookmark = 288 const sync_pb::BookmarkSpecifics& bookmark =
289 server_entry.specifics().GetExtension(sync_pb::bookmark); 289 server_entry.specifics().GetExtension(sync_pb::bookmark);
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 } 760 }
761 761
762 // |update_entry| is considered to be somewhere after |candidate|, so store 762 // |update_entry| is considered to be somewhere after |candidate|, so store
763 // it as the upper bound. 763 // it as the upper bound.
764 closest_sibling = candidate.Get(ID); 764 closest_sibling = candidate.Get(ID);
765 } 765 }
766 766
767 return closest_sibling; 767 return closest_sibling;
768 } 768 }
769 769
770 browser_sync::SyncDataType SyncerUtil::GetSyncDataType( 770 syncable::ModelType SyncerUtil::GetModelType(
771 const SyncEntity& entry) { 771 const SyncEntity& entry) {
772 772
773 const bool is_bookmark = 773 const bool is_bookmark =
774 (entry.has_specifics() && 774 (entry.has_specifics() &&
775 entry.specifics().HasExtension(sync_pb::bookmark)) || 775 entry.specifics().HasExtension(sync_pb::bookmark)) ||
776 entry.has_bookmarkdata(); 776 entry.has_bookmarkdata();
777 777
778 if (is_bookmark) { 778 if (is_bookmark) {
779 return SYNC_TYPE_BOOKMARK; 779 return syncable::BOOKMARKS;
780 } 780 }
781 781
782 return SYNC_TYPE_UNKNOWN; 782 return syncable::UNSPECIFIED;
783 } 783 }
784 784
785 } // namespace browser_sync 785 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/syncer_util.h ('k') | chrome/browser/sync/engine/verify_updates_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698