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

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

Issue 16776004: Replace FTS in the history_service with a brute force text search. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some typos Created 7 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
Index: chrome/browser/history/query_parser.h
diff --git a/chrome/browser/history/query_parser.h b/chrome/browser/history/query_parser.h
index 6bb0787cb6a5481410cff11191cc3d1412782590..fe69e0b1d99e8483a25c076451587bd0cc241589 100644
--- a/chrome/browser/history/query_parser.h
+++ b/chrome/browser/history/query_parser.h
@@ -46,6 +46,9 @@ class QueryNode {
virtual bool HasMatchIn(const std::vector<QueryWord>& words,
Snippet::MatchPositions* match_positions) const = 0;
+ // Returns true if this node matches at least one of the words in |words|.
+ virtual bool HasMatchIn(const std::vector<QueryWord>& words) const = 0;
+
// Appends the words that make up this node in |words|.
virtual void AppendWords(std::vector<string16>* words) const = 0;
};
@@ -87,14 +90,19 @@ class QueryParser {
const std::vector<QueryNode*>& nodes,
Snippet::MatchPositions* match_positions);
+ // Returns true if all of the |words| match the query |nodes| created by a
+ // call to ParseQuery.
+ bool DoesQueryMatch(const std::vector<QueryWord>& words,
+ const std::vector<QueryNode*>& nodes);
+
+ // Extracts the words from |text|, placing each word into |words|.
+ void ExtractQueryWords(const string16& text, std::vector<QueryWord>* words);
+
private:
// Does the work of parsing |query|; creates nodes in |root| as appropriate.
// This is invoked from both of the ParseQuery methods.
bool ParseQueryImpl(const string16& query, QueryNodeList* root);
- // Extracts the words from |text|, placing each word into |words|.
- void ExtractQueryWords(const string16& text, std::vector<QueryWord>* words);
-
DISALLOW_COPY_AND_ASSIGN(QueryParser);
};

Powered by Google App Engine
This is Rietveld 408576698