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

Unified Diff: components/bookmarks/browser/bookmark_storage.cc

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: remove client interface 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 side-by-side diff with in-line comments
Download patch
Index: components/bookmarks/browser/bookmark_storage.cc
diff --git a/components/bookmarks/browser/bookmark_storage.cc b/components/bookmarks/browser/bookmark_storage.cc
index d32a90c88061a8b082c770da656f63da4bdfc0a2..2841b43090012885fd0b6c69c15ff692e55806d9 100644
--- a/components/bookmarks/browser/bookmark_storage.cc
+++ b/components/bookmarks/browser/bookmark_storage.cc
@@ -34,6 +34,10 @@ const base::FilePath::CharType kBackupExtension[] = FILE_PATH_LITERAL("bak");
// How often we save.
const int kSaveDelayMS = 2500;
+// Keys in meta info of bookmark node that should be excluded after removing
+// enhanced bookmarks feature crrev.com/1638413003.
+const char* const kExcludedMetaInfoKeys[] = {"stars."};
+
void BackupCallback(const base::FilePath& path) {
base::FilePath backup_path = path.ReplaceExtension(kBackupExtension);
base::CopyFile(path, backup_path);
@@ -69,6 +73,12 @@ void LoadCallback(const base::FilePath& path,
// thread.
int64_t max_node_id = 0;
BookmarkCodec codec;
+ std::vector<std::string> excluded_keys;
+ excluded_keys.insert(excluded_keys.end(),
+ std::begin(kExcludedMetaInfoKeys),
+ std::end(kExcludedMetaInfoKeys));
+ codec.set_excluded_meta_info_keys(excluded_keys);
+
TimeTicks start_time = TimeTicks::Now();
codec.Decode(details->bb_node(), details->other_folder_node(),
details->mobile_folder_node(), &max_node_id, *root.get());

Powered by Google App Engine
This is Rietveld 408576698