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

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

Issue 2379863002: Fix object ownership in ui/base/models. (Closed)
Patch Set: fix Created 4 years, 3 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_index.cc ('k') | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_model.h
diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
index 61cdfa48bc417a24941731d52af91ecfbd698d70..2dd64c58c8fd85717daf92581841a88af531a6a0 100644
--- a/components/bookmarks/browser/bookmark_model.h
+++ b/components/bookmarks/browser/bookmark_model.h
@@ -354,12 +354,13 @@ class BookmarkModel : public BookmarkUndoProvider,
// Populates |nodes_ordered_by_url_set_| from root.
void PopulateNodesByURL(BookmarkNode* node);
- // Removes the node from its parent, but does not delete it. No notifications
+ // Removes the node from its parent and returns it. No notifications
// are sent. |removed_urls| is populated with the urls which no longer have
// any bookmarks associated with them.
// This method should be called after acquiring |url_lock_|.
- void RemoveNodeAndGetRemovedUrls(BookmarkNode* node,
- std::set<GURL>* removed_urls);
+ std::unique_ptr<BookmarkNode> RemoveNodeAndGetRemovedUrls(
+ BookmarkNode* node,
+ std::set<GURL>* removed_urls);
// Removes the node from its parent, sends notification, and deletes it.
// type specifies how the node should be removed.
@@ -372,7 +373,7 @@ class BookmarkModel : public BookmarkUndoProvider,
// observers.
BookmarkNode* AddNode(BookmarkNode* parent,
int index,
- BookmarkNode* node);
+ std::unique_ptr<BookmarkNode> node);
// Adds the |node| to |nodes_ordered_by_url_set_| and |index_|.
void AddNodeToInternalMaps(BookmarkNode* node);
« no previous file with comments | « components/bookmarks/browser/bookmark_index.cc ('k') | components/bookmarks/browser/bookmark_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698