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

Unified Diff: components/omnibox/browser/in_memory_url_index_types.h

Issue 2690303012: Cleaning up url_index_private_data and in_memory_url_index_types. (Closed)
Patch Set: Rough sketch. Created 3 years, 10 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/omnibox/browser/in_memory_url_index_types.h
diff --git a/components/omnibox/browser/in_memory_url_index_types.h b/components/omnibox/browser/in_memory_url_index_types.h
index 070ba43bf621896e2bdf4c18ec71ead2678ff4b0..cc26067f74a869c9b51c299acbf045c15893aac1 100644
--- a/components/omnibox/browser/in_memory_url_index_types.h
+++ b/components/omnibox/browser/in_memory_url_index_types.h
@@ -8,9 +8,9 @@
#include <stddef.h>
#include <map>
-#include <set>
#include <vector>
+#include "base/containers/flat_set.h"
#include "base/containers/hash_tables.h"
#include "base/strings/string16.h"
#include "components/history/core/browser/history_types.h"
@@ -69,8 +69,8 @@ TermMatches ReplaceOffsetsInTermMatches(const TermMatches& matches,
// Convenience Types -----------------------------------------------------------
typedef std::vector<base::string16> String16Vector;
-typedef std::set<base::string16> String16Set;
-typedef std::set<base::char16> Char16Set;
+typedef base::flat_set<base::string16> String16Set;
+typedef base::flat_set<base::char16> Char16Set;
typedef std::vector<base::char16> Char16Vector;
// A vector that contains the offsets at which each word starts within a string.
@@ -131,12 +131,12 @@ typedef size_t WordID;
typedef std::map<base::string16, WordID> WordMap;
// A map from character to the word_ids of words containing that character.
-typedef std::set<WordID> WordIDSet; // An index into the WordList.
+typedef base::flat_set<WordID> WordIDSet; // An index into the WordList.
typedef std::map<base::char16, WordIDSet> CharWordIDMap;
// A map from word (by word_id) to history items containing that word.
typedef history::URLID HistoryID;
-typedef std::set<HistoryID> HistoryIDSet;
+typedef base::flat_set<HistoryID> HistoryIDSet;
typedef std::vector<HistoryID> HistoryIDVector;
typedef std::map<WordID, HistoryIDSet> WordIDHistoryMap;
typedef std::map<HistoryID, WordIDSet> HistoryIDWordMap;
@@ -147,6 +147,10 @@ typedef std::vector<history::VisitInfo> VisitInfoVector;
struct HistoryInfoMapValue {
HistoryInfoMapValue();
Peter Kasting 2017/02/17 01:33:45 Since we're just trying to declare all these as "=
dyaroshev 2017/02/17 20:17:22 Checkers forbidding inlining don't allow me to do
HistoryInfoMapValue(const HistoryInfoMapValue& other);
+ HistoryInfoMapValue& operator=(const HistoryInfoMapValue& other);
Peter Kasting 2017/02/17 01:33:46 Nit: Google style guide suggests listing construct
dyaroshev 2017/02/17 20:17:22 Done.
+ HistoryInfoMapValue(HistoryInfoMapValue&& other);
+ HistoryInfoMapValue& operator=(HistoryInfoMapValue&& other);
+
~HistoryInfoMapValue();
// This field is always populated.
@@ -166,6 +170,10 @@ typedef base::hash_map<HistoryID, HistoryInfoMapValue> HistoryInfoMap;
struct RowWordStarts {
RowWordStarts();
RowWordStarts(const RowWordStarts& other);
+ RowWordStarts& operator=(const RowWordStarts& other);
+ RowWordStarts(RowWordStarts&& other);
+ RowWordStarts& operator=(RowWordStarts&& other);
+
~RowWordStarts();
// Clears both url_word_starts_ and title_word_starts_.

Powered by Google App Engine
This is Rietveld 408576698