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

Unified Diff: components/bookmarks/browser/bookmark_codec.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 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..0a2d744c32f9d9eb3e096ac41f57b696859b087b 100644
--- a/components/bookmarks/browser/bookmark_codec.cc
+++ b/components/bookmarks/browser/bookmark_codec.cc
@@ -13,6 +13,7 @@
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
+#include "base/sys_info.h"
#include "base/values.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/strings/grit/components_strings.h"
@@ -433,6 +434,13 @@ void BookmarkCodec::DecodeMetaInfoHelper(
const std::string& prefix,
BookmarkNode::MetaInfoMap* meta_info_map) {
for (base::DictionaryValue::Iterator it(dict); !it.IsAtEnd(); it.Advance()) {
+ // Do not load the image and page data into memory for low-end devices.
+ if (base::SysInfo::IsLowEndDevice() &&
sky 2017/05/12 20:00:13 If we're going to support disabling this feature I
ssid 2017/05/25 00:27:27 So, I moved the strings to storage.cc and passed i
+ (it.key().find("imageData") != std::string::npos ||
+ it.key().find("pageData") != std::string::npos)) {
+ continue;
+ }
+
if (it.value().IsType(base::Value::Type::DICTIONARY)) {
const base::DictionaryValue* subdict;
it.value().GetAsDictionary(&subdict);

Powered by Google App Engine
This is Rietveld 408576698