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

Side by Side Diff: chrome/browser/sync/glue/bookmark_change_processor.cc

Issue 302173004: sync: Specialize functions that fetch type root (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/GET_BY_SERVER_TAG_DEPRECATED/GET_BY_SERVER_TAG/ Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/sync/glue/bookmark_change_processor.h" 5 #include "chrome/browser/sync/glue/bookmark_change_processor.h"
6 6
7 #include <map> 7 #include <map>
8 #include <stack> 8 #include <stack>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 int index = parent->GetIndexOf(dst); 544 int index = parent->GetIndexOf(dst);
545 if (index > -1) 545 if (index > -1)
546 model->Remove(parent, index); 546 model->Remove(parent, index);
547 } 547 }
548 548
549 // A map to keep track of some reordering work we defer until later. 549 // A map to keep track of some reordering work we defer until later.
550 std::multimap<int, const BookmarkNode*> to_reposition; 550 std::multimap<int, const BookmarkNode*> to_reposition;
551 551
552 syncer::ReadNode synced_bookmarks(trans); 552 syncer::ReadNode synced_bookmarks(trans);
553 int64 synced_bookmarks_id = syncer::kInvalidId; 553 int64 synced_bookmarks_id = syncer::kInvalidId;
554 if (synced_bookmarks.InitByTagLookup(kMobileBookmarksTag) == 554 if (synced_bookmarks.InitByTagLookupForBookmarks(kMobileBookmarksTag) ==
555 syncer::BaseNode::INIT_OK) { 555 syncer::BaseNode::INIT_OK) {
556 synced_bookmarks_id = synced_bookmarks.GetId(); 556 synced_bookmarks_id = synced_bookmarks.GetId();
557 } 557 }
558 558
559 // Continue iterating where the previous loop left off. 559 // Continue iterating where the previous loop left off.
560 for ( ; it != changes.Get().end(); ++it) { 560 for ( ; it != changes.Get().end(); ++it) {
561 const BookmarkNode* dst = 561 const BookmarkNode* dst =
562 model_associator_->GetChromeNodeFromSyncId(it->id); 562 model_associator_->GetChromeNodeFromSyncId(it->id);
563 563
564 // Ignore changes to the permanent top-level nodes. We only care about 564 // Ignore changes to the permanent top-level nodes. We only care about
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 sync_pb::BookmarkSpecifics updated_specifics( 836 sync_pb::BookmarkSpecifics updated_specifics(
837 sync_node->GetBookmarkSpecifics()); 837 sync_node->GetBookmarkSpecifics());
838 updated_specifics.set_favicon(favicon_bytes->front(), 838 updated_specifics.set_favicon(favicon_bytes->front(),
839 favicon_bytes->size()); 839 favicon_bytes->size());
840 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); 840 updated_specifics.set_icon_url(bookmark_node->icon_url().spec());
841 sync_node->SetBookmarkSpecifics(updated_specifics); 841 sync_node->SetBookmarkSpecifics(updated_specifics);
842 } 842 }
843 } 843 }
844 844
845 } // namespace browser_sync 845 } // namespace browser_sync
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/bookmark_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698