OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ |
6 #define COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
| 12 #include "base/containers/hash_tables.h" |
12 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
13 #include "components/history/core/browser/history_types.h" | 14 #include "components/history/core/browser/history_types.h" |
14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
15 | 16 |
16 // Matches within URL and Title Strings ---------------------------------------- | 17 // Matches within URL and Title Strings ---------------------------------------- |
17 | 18 |
18 // Specifies where an omnibox term occurs within a string. Used for specifying | 19 // Specifies where an omnibox term occurs within a string. Used for specifying |
19 // highlights in AutocompleteMatches (ACMatchClassifications) and to assist in | 20 // highlights in AutocompleteMatches (ACMatchClassifications) and to assist in |
20 // scoring a result. | 21 // scoring a result. |
21 struct TermMatch { | 22 struct TermMatch { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 history::URLRow url_row; | 147 history::URLRow url_row; |
147 | 148 |
148 // This field gets filled in asynchronously after a visit. As such, | 149 // This field gets filled in asynchronously after a visit. As such, |
149 // it's almost always correct. If it's wrong, it's likely to either | 150 // it's almost always correct. If it's wrong, it's likely to either |
150 // be empty (if this URL was recently added to the index) or | 151 // be empty (if this URL was recently added to the index) or |
151 // slightly out-of-date (one visit behind). | 152 // slightly out-of-date (one visit behind). |
152 VisitInfoVector visits; | 153 VisitInfoVector visits; |
153 }; | 154 }; |
154 | 155 |
155 // A map from history_id to the history's URL and title. | 156 // A map from history_id to the history's URL and title. |
156 typedef std::map<HistoryID, HistoryInfoMapValue> HistoryInfoMap; | 157 typedef base::hash_map<HistoryID, HistoryInfoMapValue> HistoryInfoMap; |
157 | 158 |
158 // A map from history_id to URL and page title word start metrics. | 159 // A map from history_id to URL and page title word start metrics. |
159 struct RowWordStarts { | 160 struct RowWordStarts { |
160 RowWordStarts(); | 161 RowWordStarts(); |
161 ~RowWordStarts(); | 162 ~RowWordStarts(); |
162 | 163 |
163 // Clears both url_word_starts_ and title_word_starts_. | 164 // Clears both url_word_starts_ and title_word_starts_. |
164 void Clear(); | 165 void Clear(); |
165 | 166 |
166 WordStarts url_word_starts_; | 167 WordStarts url_word_starts_; |
167 WordStarts title_word_starts_; | 168 WordStarts title_word_starts_; |
168 }; | 169 }; |
169 typedef std::map<HistoryID, RowWordStarts> WordStartsMap; | 170 typedef std::map<HistoryID, RowWordStarts> WordStartsMap; |
170 | 171 |
171 #endif // COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ | 172 #endif // COMPONENTS_OMNIBOX_BROWSER_IN_MEMORY_URL_INDEX_TYPES_H_ |
OLD | NEW |