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

Side by Side Diff: components/bookmarks/managed/managed_bookmark_service.cc

Issue 2379863002: Fix object ownership in ui/base/models. (Closed)
Patch Set: fix Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/bookmarks/managed/managed_bookmark_service.h" 5 #include "components/bookmarks/managed/managed_bookmark_service.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9
9 #include <utility> 10 #include <utility>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/callback.h" 14 #include "base/callback.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/memory/scoped_vector.h" 17 #include "base/memory/scoped_vector.h"
17 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
18 #include "base/values.h" 19 #include "base/values.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 }; 63 };
63 64
64 // Returns a list of initialized BookmarkPermanentNodes using |next_node_id| to 65 // Returns a list of initialized BookmarkPermanentNodes using |next_node_id| to
65 // start assigning id. |next_node_id| is updated as a side effect of calling 66 // start assigning id. |next_node_id| is updated as a side effect of calling
66 // this method. 67 // this method.
67 BookmarkPermanentNodeList LoadExtraNodes( 68 BookmarkPermanentNodeList LoadExtraNodes(
68 ScopedVector<BookmarkPermanentNodeLoader> loaders, 69 ScopedVector<BookmarkPermanentNodeLoader> loaders,
69 int64_t* next_node_id) { 70 int64_t* next_node_id) {
70 BookmarkPermanentNodeList extra_nodes; 71 BookmarkPermanentNodeList extra_nodes;
71 for (auto* loader : loaders) 72 for (auto* loader : loaders)
72 extra_nodes.push_back(loader->Load(next_node_id).release()); 73 extra_nodes.push_back(loader->Load(next_node_id));
73 return extra_nodes; 74 return extra_nodes;
74 } 75 }
75 76
76 } // namespace 77 } // namespace
77 78
78 ManagedBookmarkService::ManagedBookmarkService( 79 ManagedBookmarkService::ManagedBookmarkService(
79 PrefService* prefs, 80 PrefService* prefs,
80 const GetManagementDomainCallback& callback) 81 const GetManagementDomainCallback& callback)
81 : prefs_(prefs), 82 : prefs_(prefs),
82 bookmark_model_(nullptr), 83 bookmark_model_(nullptr),
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 180 }
180 181
181 managed_bookmarks_tracker_.reset(); 182 managed_bookmarks_tracker_.reset();
182 supervised_bookmarks_tracker_.reset(); 183 supervised_bookmarks_tracker_.reset();
183 184
184 managed_node_ = nullptr; 185 managed_node_ = nullptr;
185 supervised_node_ = nullptr; 186 supervised_node_ = nullptr;
186 } 187 }
187 188
188 } // namespace bookmarks 189 } // namespace bookmarks
OLDNEW
« no previous file with comments | « components/bookmarks/browser/bookmark_utils_unittest.cc ('k') | components/bookmarks/managed/managed_bookmarks_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698