OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 db_.BeginTransaction(); | 162 db_.BeginTransaction(); |
163 } | 163 } |
164 | 164 |
165 void TextDatabase::CommitTransaction() { | 165 void TextDatabase::CommitTransaction() { |
166 db_.CommitTransaction(); | 166 db_.CommitTransaction(); |
167 } | 167 } |
168 | 168 |
169 bool TextDatabase::CreateTables() { | 169 bool TextDatabase::CreateTables() { |
170 // FTS table of page contents. | 170 // FTS table of page contents. |
171 if (!db_.DoesTableExist("pages")) { | 171 if (!db_.DoesTableExist("pages")) { |
172 if (!db_.Execute("CREATE VIRTUAL TABLE pages USING fts2(" | 172 if (!db_.Execute("CREATE VIRTUAL TABLE pages USING fts3(" |
173 "TOKENIZE icu," | 173 "TOKENIZE icu," |
174 "url LONGVARCHAR," | 174 "url LONGVARCHAR," |
175 "title LONGVARCHAR," | 175 "title LONGVARCHAR," |
176 "body LONGVARCHAR)")) | 176 "body LONGVARCHAR)")) |
177 return false; | 177 return false; |
178 } | 178 } |
179 | 179 |
180 // Non-FTS table containing URLs and times so we can efficiently find them | 180 // Non-FTS table containing URLs and times so we can efficiently find them |
181 // using a regular index (all FTS columns are special and are treated as | 181 // using a regular index (all FTS columns are special and are treated as |
182 // full-text-search, which is not what we want when retrieving this data). | 182 // full-text-search, which is not what we want when retrieving this data). |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 } else { | 367 } else { |
368 // Since we got the results in order, we know the last item is the last | 368 // Since we got the results in order, we know the last item is the last |
369 // time we considered. | 369 // time we considered. |
370 *first_time_searched = results->back().time; | 370 *first_time_searched = results->back().time; |
371 } | 371 } |
372 | 372 |
373 statement.Reset(); | 373 statement.Reset(); |
374 } | 374 } |
375 | 375 |
376 } // namespace history | 376 } // namespace history |
OLD | NEW |