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

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

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: Created 3 years, 7 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
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(
972 bookmark_node->icon_url() ? bookmark_node->icon_url()->spec() : "");
sky 2017/05/12 20:00:13 "" -> std::string()
ssid 2017/05/25 00:27:27 Done.
972 sync_node->SetBookmarkSpecifics(updated_specifics); 973 sync_node->SetBookmarkSpecifics(updated_specifics);
973 } 974 }
974 } 975 }
975 976
976 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) { 977 bool BookmarkChangeProcessor::CanSyncNode(const BookmarkNode* node) {
977 return bookmark_model_->client()->CanSyncNode(node); 978 return bookmark_model_->client()->CanSyncNode(node);
978 } 979 }
979 980
980 } // namespace sync_bookmarks 981 } // namespace sync_bookmarks
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698