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

Unified Diff: chrome/browser/history/in_memory_url_index_types.h

Issue 10541045: Move ScoredHistoryMatch into Its Own Set of Files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/in_memory_url_index.h ('k') | chrome/browser/history/in_memory_url_index_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/in_memory_url_index_types.h
===================================================================
--- chrome/browser/history/in_memory_url_index_types.h (revision 140773)
+++ chrome/browser/history/in_memory_url_index_types.h (working copy)
@@ -59,25 +59,6 @@
TermMatches ReplaceOffsetsInTermMatches(const TermMatches& matches,
const std::vector<size_t>& offsets);
-// Used for intermediate history result operations -----------------------------
-
-struct ScoredHistoryMatch : public history::HistoryMatch {
- ScoredHistoryMatch(); // Required by STL.
- explicit ScoredHistoryMatch(const history::URLRow& url_info);
- ~ScoredHistoryMatch();
-
- static bool MatchScoreGreater(const ScoredHistoryMatch& m1,
- const ScoredHistoryMatch& m2);
-
- // An interim score taking into consideration location and completeness
- // of the match.
- int raw_score;
- TermMatches url_matches; // Term matches within the URL.
- TermMatches title_matches; // Term matches within the page title.
- bool can_inline; // True if this is a candidate for in-line autocompletion.
-};
-typedef std::vector<ScoredHistoryMatch> ScoredHistoryMatches;
-
// Convenience Types -----------------------------------------------------------
typedef std::vector<string16> String16Vector;
@@ -85,11 +66,11 @@
typedef std::set<char16> Char16Set;
typedef std::vector<char16> Char16Vector;
-// Utility Functions -----------------------------------------------------------
-
// A vector that contains the offsets at which each word starts within a string.
typedef std::vector<size_t> WordStarts;
+// Utility Functions -----------------------------------------------------------
+
// Breaks the string |uni_string| down into individual words. If |word_starts|
// is not NULL then clears and pushes the offsets within |uni_string| at which
// each word starts onto |word_starts|. These offsets are collected only up to
@@ -154,11 +135,32 @@
RowWordStarts();
~RowWordStarts();
+ // Clears both url_word_starts_ and title_word_starts_.
+ void Clear();
+
WordStarts url_word_starts_;
WordStarts title_word_starts_;
};
typedef std::map<HistoryID, RowWordStarts> WordStartsMap;
+// A RefCountedThreadSafe class that manages a bool used for passing around
+// success when saving the persistent data for the InMemoryURLIndex in a cache.
+class RefCountedBool : public base::RefCountedThreadSafe<RefCountedBool> {
+ public:
+ explicit RefCountedBool(bool value) : value_(value) {}
+
+ bool value() const { return value_; }
+ void set_value(bool value) { value_ = value; }
+
+ private:
+ friend class base::RefCountedThreadSafe<RefCountedBool>;
+ virtual ~RefCountedBool();
+
+ bool value_;
+
+ DISALLOW_COPY_AND_ASSIGN(RefCountedBool);
+};
+
} // namespace history
#endif // CHROME_BROWSER_HISTORY_IN_MEMORY_URL_INDEX_TYPES_H_
« no previous file with comments | « chrome/browser/history/in_memory_url_index.h ('k') | chrome/browser/history/in_memory_url_index_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698