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

Side by Side Diff: components/omnibox/browser/url_index_private_data.h

Issue 2333253002: flat containers prototype (Closed)
Patch Set: Fixing performance bug in insert(It, It) Created 4 years 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 (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_URL_INDEX_PRIVATE_DATA_H_ 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_
6 #define COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ 6 #define COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Creates a cache item for a term which has no results. 180 // Creates a cache item for a term which has no results.
181 SearchTermCacheItem(); 181 SearchTermCacheItem();
182 SearchTermCacheItem(const SearchTermCacheItem& other); 182 SearchTermCacheItem(const SearchTermCacheItem& other);
183 183
184 ~SearchTermCacheItem(); 184 ~SearchTermCacheItem();
185 185
186 WordIDSet word_id_set_; 186 WordIDSet word_id_set_;
187 HistoryIDSet history_id_set_; 187 HistoryIDSet history_id_set_;
188 bool used_; // True if this item has been used for the current term search. 188 bool used_; // True if this item has been used for the current term search.
189 }; 189 };
190 typedef std::map<base::string16, SearchTermCacheItem> SearchTermCacheMap; 190 typedef base::flat_map<base::string16, SearchTermCacheItem>
191 SearchTermCacheMap;
191 192
192 // A helper predicate class used to filter excess history items when the 193 // A helper predicate class used to filter excess history items when the
193 // candidate results set is too large. 194 // candidate results set is too large.
194 class HistoryItemFactorGreater { 195 class HistoryItemFactorGreater {
195 public: 196 public:
196 explicit HistoryItemFactorGreater(const HistoryInfoMap& history_info_map); 197 explicit HistoryItemFactorGreater(const HistoryInfoMap& history_info_map);
197 ~HistoryItemFactorGreater(); 198 ~HistoryItemFactorGreater();
198 199
199 bool operator()(const HistoryID h1, const HistoryID h2); 200 bool operator()(const HistoryID h1, const HistoryID h2);
200 201
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 int saved_cache_version_; 382 int saved_cache_version_;
382 383
383 // Used for unit testing only. Records the number of candidate history items 384 // Used for unit testing only. Records the number of candidate history items
384 // at three stages in the index searching process. 385 // at three stages in the index searching process.
385 size_t pre_filter_item_count_; // After word index is queried. 386 size_t pre_filter_item_count_; // After word index is queried.
386 size_t post_filter_item_count_; // After trimming large result set. 387 size_t post_filter_item_count_; // After trimming large result set.
387 size_t post_scoring_item_count_; // After performing final filter/scoring. 388 size_t post_scoring_item_count_; // After performing final filter/scoring.
388 }; 389 };
389 390
390 #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_ 391 #endif // COMPONENTS_OMNIBOX_BROWSER_URL_INDEX_PRIVATE_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698