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

Unified Diff: components/bookmarks/browser/bookmark_codec.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_codec.cc
diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmarks/browser/bookmark_codec.cc
index abbb1cd7b64289eceba9eff25a87872d786d9304..c71ce1785733c2b371cc686338c3ced6cc7edbb0 100644
--- a/components/bookmarks/browser/bookmark_codec.cc
+++ b/components/bookmarks/browser/bookmark_codec.cc
@@ -433,6 +433,14 @@ void BookmarkCodec::DecodeMetaInfoHelper(
const std::string& prefix,
BookmarkNode::MetaInfoMap* meta_info_map) {
for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) {
+ bool is_excluded = false;
+ for (const auto& excluded : excluded_meta_info_keys_) {
sky 2017/05/31 21:29:14 Sorry if I wasn't clear. I'm suggesting you harcod
ssid 2017/05/31 21:44:52 No problem. fixed it. Made it a single string. if
+ if (it.key().find(excluded) != std::string::npos)
sky 2017/05/31 21:29:13 You don't want a find, you want a starts with, rig
ssid 2017/05/31 21:44:52 Done.
+ is_excluded = true;
+ }
+ if (is_excluded)
+ continue;
+
if (it.value().IsType(base::Value::Type::DICTIONARY)) {
const base::DictionaryValue* subdict;
it.value().GetAsDictionary(&subdict);
« no previous file with comments | « components/bookmarks/browser/bookmark_codec.h ('k') | components/bookmarks/browser/bookmark_codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698