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

Side by Side Diff: components/bookmarks/browser/titled_url_node_sorter.h

Issue 2883523002: Reduce the memory usage of bookmarks storage (Closed)
Patch Set: MakeUnique Created 3 years, 6 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_ 5 #ifndef COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_
6 #define COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_ 6 #define COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_
7 7
8 #include <set>
9 #include <vector> 8 #include <vector>
10 9
10 #include "base/containers/flat_set.h"
11
11 namespace bookmarks { 12 namespace bookmarks {
12 13
13 class TitledUrlNode; 14 class TitledUrlNode;
14 15
15 class TitledUrlNodeSorter { 16 class TitledUrlNodeSorter {
16 public: 17 public:
17 using TitledUrlNodes = std::vector<const TitledUrlNode*>; 18 using TitledUrlNodes = std::vector<const TitledUrlNode*>;
18 using TitledUrlNodeSet = std::set<const TitledUrlNode*>; 19 using TitledUrlNodeSet = base::flat_set<const TitledUrlNode*>;
19 20
20 virtual ~TitledUrlNodeSorter() {}; 21 virtual ~TitledUrlNodeSorter() {};
21 22
22 // Sorts |matches| in an implementation-specific way, placing the results in 23 // Sorts |matches| in an implementation-specific way, placing the results in
23 // |sorted_nodes|. 24 // |sorted_nodes|.
24 virtual void SortMatches(const TitledUrlNodeSet& matches, 25 virtual void SortMatches(const TitledUrlNodeSet& matches,
25 TitledUrlNodes* sorted_nodes) const = 0; 26 TitledUrlNodes* sorted_nodes) const = 0;
26 }; 27 };
27 28
28 } // namespace bookmarks 29 } // namespace bookmarks
29 30
30 #endif // COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_ 31 #endif // COMPONENTS_BOOKMARKS_BROWSER_TITLED_URL_NODE_SORTER_H_
OLDNEW
« no previous file with comments | « components/bookmarks/browser/titled_url_index.cc ('k') | components/sync_bookmarks/bookmark_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698