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

Side by Side Diff: components/bookmarks/browser/bookmark_codec.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bookmarks/browser/bookmark_codec.h" 5 #include "components/bookmarks/browser/bookmark_codec.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 426 }
427 427
428 return true; 428 return true;
429 } 429 }
430 430
431 void BookmarkCodec::DecodeMetaInfoHelper( 431 void BookmarkCodec::DecodeMetaInfoHelper(
432 const base::DictionaryValue& dict, 432 const base::DictionaryValue& dict,
433 const std::string& prefix, 433 const std::string& prefix,
434 BookmarkNode::MetaInfoMap* meta_info_map) { 434 BookmarkNode::MetaInfoMap* meta_info_map) {
435 for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) { 435 for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) {
436 // Deprecated keys should be excluded after removing enhanced bookmarks
437 // feature crrev.com/1638413003.
438 if (base::StartsWith(it.key(), "stars.", base::CompareCase::SENSITIVE))
439 continue;
440
436 if (it.value().IsType(base::Value::Type::DICTIONARY)) { 441 if (it.value().IsType(base::Value::Type::DICTIONARY)) {
437 const base::DictionaryValue* subdict; 442 const base::DictionaryValue* subdict;
438 it.value().GetAsDictionary(&subdict); 443 it.value().GetAsDictionary(&subdict);
439 DecodeMetaInfoHelper(*subdict, prefix + it.key() + ".", meta_info_map); 444 DecodeMetaInfoHelper(*subdict, prefix + it.key() + ".", meta_info_map);
440 } else if (it.value().IsType(base::Value::Type::STRING)) { 445 } else if (it.value().IsType(base::Value::Type::STRING)) {
441 it.value().GetAsString(&(*meta_info_map)[prefix + it.key()]); 446 it.value().GetAsString(&(*meta_info_map)[prefix + it.key()]);
442 } 447 }
443 } 448 }
444 } 449 }
445 450
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 base::MD5Init(&md5_context_); 497 base::MD5Init(&md5_context_);
493 } 498 }
494 499
495 void BookmarkCodec::FinalizeChecksum() { 500 void BookmarkCodec::FinalizeChecksum() {
496 base::MD5Digest digest; 501 base::MD5Digest digest;
497 base::MD5Final(&digest, &md5_context_); 502 base::MD5Final(&digest, &md5_context_);
498 computed_checksum_ = base::MD5DigestToBase16(digest); 503 computed_checksum_ = base::MD5DigestToBase16(digest);
499 } 504 }
500 505
501 } // namespace bookmarks 506 } // namespace bookmarks
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/bookmarks_helper.cc ('k') | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698