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 #include <limits> | 5 #include <limits> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "chrome/browser/history/text_database.h" | 9 #include "chrome/browser/history/text_database.h" |
10 | 10 |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" | 17 #include "chrome/browser/diagnostics/sqlite_diagnostics.h" |
18 #include "sql/statement.h" | 18 #include "sql/statement.h" |
19 #include "sql/transaction.h" | 19 #include "sql/transaction.h" |
20 | 20 |
21 // There are two tables in each database, one full-text search (FTS) table which | 21 // There are two tables in each database, one full-text search (FTS) table which |
22 // indexes the contents and title of the pages. The other is a regular SQLITE | 22 // indexes the contents and title of the pages. The other is a regular SQLITE |
23 // table which contains non-indexed information about the page. All columns of | 23 // table which contains non-indexed information about the page. All columns of |
24 // a FTS table are indexed using the text search algorithm, which isn't what we | 24 // a FTS table are indexed using the text search algorithm, which isn't what we |
25 // want for things like times. If this were in the FTS table, there would be | 25 // want for things like times. If this were in the FTS table, there would be |
26 // different words in the index for each time number. | 26 // different words in the index for each time number. |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 | 345 |
346 // Compute the snippet based on those matches. | 346 // Compute the snippet based on those matches. |
347 std::string body = statement.ColumnString(4); | 347 std::string body = statement.ColumnString(4); |
348 match.snippet.ComputeSnippet(match_positions, body); | 348 match.snippet.ComputeSnippet(match_positions, body); |
349 } | 349 } |
350 statement.Reset(true); | 350 statement.Reset(true); |
351 return result_count > options.EffectiveMaxCount(); | 351 return result_count > options.EffectiveMaxCount(); |
352 } | 352 } |
353 | 353 |
354 } // namespace history | 354 } // namespace history |
OLD | NEW |