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

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

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_node.h
diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks/browser/bookmark_node.h
index d125c44e52c92806cea31a7297925411baba0182..60bc3659959cc01ad06c4ad5698083291cce09cc 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 std::unique_ptr<GURL>& icon_url() const { return icon_url_; }
sky 2017/05/12 20:00:13 This should return a const GURL*.
ssid 2017/05/25 00:27:27 Sorry, fixed!
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));
}
// 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_;
sky 2017/05/12 20:00:13 What is the actual savings of this? What is sizeof
ssid 2017/05/25 00:27:27 The GURL is 95 bytes I think. for 500 urls it turn
// The loading state of the favicon.
FaviconState favicon_state_;

Powered by Google App Engine
This is Rietveld 408576698