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

Side by Side Diff: components/sync_bookmarks/bookmark_change_processor.cc

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: MakeUnique Created 3 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
« no previous file with comments | « components/bookmarks/browser/titled_url_node_sorter.h ('k') | no next file » | 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 "components/sync_bookmarks/bookmark_change_processor.h" 5 #include "components/sync_bookmarks/bookmark_change_processor.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <map> 9 #include <map>
10 #include <stack> 10 #include <stack>
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 const BookmarkNode* bookmark_node, 961 const BookmarkNode* bookmark_node,
962 BookmarkModel* model, 962 BookmarkModel* model,
963 syncer::WriteNode* sync_node) { 963 syncer::WriteNode* sync_node) {
964 scoped_refptr<base::RefCountedMemory> favicon_bytes(nullptr); 964 scoped_refptr<base::RefCountedMemory> favicon_bytes(nullptr);
965 EncodeFavicon(bookmark_node, model, &favicon_bytes); 965 EncodeFavicon(bookmark_node, model, &favicon_bytes);
966 if (favicon_bytes.get() && favicon_bytes->size()) { 966 if (favicon_bytes.get() && favicon_bytes->size()) {
967 sync_pb::BookmarkSpecifics updated_specifics( 967 sync_pb::BookmarkSpecifics updated_specifics(
968 sync_node->GetBookmarkSpecifics()); 968 sync_node->GetBookmarkSpecifics());
969 updated_specifics.set_favicon(favicon_bytes->front(), 969 updated_specifics.set_favicon(favicon_bytes->front(),
970 favicon_bytes->size()); 970 favicon_bytes->size());
971 updated_specifics.set_icon_url(bookmark_node->icon_url().spec()); 971 updated_specifics.set_icon_url(bookmark_node->icon_url()
972 ? bookmark_node->icon_url()->spec()
973 : std::string());
972 sync_node->SetBookmarkSpecifics(updated_specifics); 974 sync_node->SetBookmarkSpecifics(updated_specifics);
973 } 975 }
974 } 976 }
975 977
976 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { 978 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) {
977 return bookmark_model_->client()->CanSyncNode(node); 979 return bookmark_model_->client()->CanSyncNode(node);
978 } 980 }
979 981
980 } // namespace sync_bookmarks 982 } // namespace sync_bookmarks
OLDNEW
« no previous file with comments | « components/bookmarks/browser/titled_url_node_sorter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698