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

Unified Diff: components/bookmarks/browser/bookmark_node.h

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: MakeUnique 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
« no previous file with comments | « components/bookmarks/browser/bookmark_model.cc ('k') | components/bookmarks/browser/bookmark_node.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_node.h
diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks/browser/bookmark_node.h
index d125c44e52c92806cea31a7297925411baba0182..c3d26e50e15e2eddb87aabc2b22f66e8c116e60a 100644
--- a/components/bookmarks/browser/bookmark_node.h
+++ b/components/bookmarks/browser/bookmark_node.h
@@ -10,6 +10,7 @@
#include <memory>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
#include "components/bookmarks/browser/titled_url_node.h"
@@ -69,7 +70,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
// Returns the favicon's URL. Returns an empty URL if there is no favicon
// associated with this bookmark.
- const GURL& icon_url() const { return icon_url_; }
+ const GURL* icon_url() const { return icon_url_ ? icon_url_.get() : nullptr; }
Type type() const { return type_; }
void set_type(Type type) { type_ = type; }
@@ -134,7 +135,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
// Sets the favicon's URL.
void set_icon_url(const GURL& icon_url) {
- icon_url_ = icon_url;
+ icon_url_ = base::MakeUnique<GURL>(icon_url);
}
// Returns the favicon. In nearly all cases you should use the method
@@ -179,7 +180,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
favicon_base::IconType favicon_type_;
// The URL of the node's favicon.
- GURL icon_url_;
+ std::unique_ptr<GURL> icon_url_;
// The loading state of the favicon.
FaviconState favicon_state_;
« no previous file with comments | « components/bookmarks/browser/bookmark_model.cc ('k') | components/bookmarks/browser/bookmark_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698