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

Side by Side Diff: chrome/browser/history/history_database.cc

Issue 16951015: Remove TextDatabase from the history service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@replace_fts
Patch Set: Fix unit test for Windows. Created 7 years, 5 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 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 #include "chrome/browser/history/history_database.h" 5 #include "chrome/browser/history/history_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // not be a released product that makes a database too old for us to handle. 430 // not be a released product that makes a database too old for us to handle.
431 LOG_IF(WARNING, cur_version < GetCurrentVersion()) << 431 LOG_IF(WARNING, cur_version < GetCurrentVersion()) <<
432 "History database version " << cur_version << " is too old to handle."; 432 "History database version " << cur_version << " is too old to handle.";
433 433
434 return sql::INIT_OK; 434 return sql::INIT_OK;
435 } 435 }
436 436
437 #if !defined(OS_WIN) 437 #if !defined(OS_WIN)
438 void HistoryDatabase::MigrateTimeEpoch() { 438 void HistoryDatabase::MigrateTimeEpoch() {
439 // Update all the times in the URLs and visits table in the main database. 439 // Update all the times in the URLs and visits table in the main database.
440 // For visits, clear the indexed flag since we'll delete the FTS databases in
441 // the next step.
442 ignore_result(db_.Execute( 440 ignore_result(db_.Execute(
443 "UPDATE urls " 441 "UPDATE urls "
444 "SET last_visit_time = last_visit_time + 11644473600000000 " 442 "SET last_visit_time = last_visit_time + 11644473600000000 "
445 "WHERE id IN (SELECT id FROM urls WHERE last_visit_time > 0);")); 443 "WHERE id IN (SELECT id FROM urls WHERE last_visit_time > 0);"));
446 ignore_result(db_.Execute( 444 ignore_result(db_.Execute(
447 "UPDATE visits " 445 "UPDATE visits "
448 "SET visit_time = visit_time + 11644473600000000, is_indexed = 0 " 446 "SET visit_time = visit_time + 11644473600000000 "
449 "WHERE id IN (SELECT id FROM visits WHERE visit_time > 0);")); 447 "WHERE id IN (SELECT id FROM visits WHERE visit_time > 0);"));
450 ignore_result(db_.Execute( 448 ignore_result(db_.Execute(
451 "UPDATE segment_usage " 449 "UPDATE segment_usage "
452 "SET time_slot = time_slot + 11644473600000000 " 450 "SET time_slot = time_slot + 11644473600000000 "
453 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);")); 451 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);"));
454 452
455 // Erase all the full text index files. These will take a while to update and 453 // Erase all the full text index files. These will take a while to update and
456 // are less important, so we just blow them away. Same with the archived 454 // are less important, so we just blow them away. Same with the archived
457 // database. 455 // database.
458 needs_version_17_migration_ = true; 456 needs_version_17_migration_ = true;
459 } 457 }
460 #endif 458 #endif
461 459
462 } // namespace history 460 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698