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

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

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: string in codec.cc 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..1c91d393fded2ed3cd84c1aa56cf8c539e5559bb 100644
--- a/components/bookmarks/browser/bookmark_node.h
+++ b/components/bookmarks/browser/bookmark_node.h
@@ -69,7 +69,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 +134,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_.reset(new GURL(icon_url));
sky 2017/05/31 22:35:49 Use MakeUnique (in base/memory/ptr_util.h) (see th
ssid 2017/06/01 01:26:29 Done.
}
// Returns the favicon. In nearly all cases you should use the method
@@ -179,7 +179,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