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

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

Issue 19637009: Revert 212459 "Remove TextDatabase from the history service." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | Annotate | Revision Log
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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 // not be a released product that makes a database too old for us to handle. 434 // not be a released product that makes a database too old for us to handle.
435 LOG_IF(WARNING, cur_version < GetCurrentVersion()) << 435 LOG_IF(WARNING, cur_version < GetCurrentVersion()) <<
436 "History database version " << cur_version << " is too old to handle."; 436 "History database version " << cur_version << " is too old to handle.";
437 437
438 return sql::INIT_OK; 438 return sql::INIT_OK;
439 } 439 }
440 440
441 #if !defined(OS_WIN) 441 #if !defined(OS_WIN)
442 void HistoryDatabase::MigrateTimeEpoch() { 442 void HistoryDatabase::MigrateTimeEpoch() {
443 // Update all the times in the URLs and visits table in the main database. 443 // Update all the times in the URLs and visits table in the main database.
444 // For visits, clear the indexed flag since we'll delete the FTS databases in
445 // the next step.
444 ignore_result(db_.Execute( 446 ignore_result(db_.Execute(
445 "UPDATE urls " 447 "UPDATE urls "
446 "SET last_visit_time = last_visit_time + 11644473600000000 " 448 "SET last_visit_time = last_visit_time + 11644473600000000 "
447 "WHERE id IN (SELECT id FROM urls WHERE last_visit_time > 0);")); 449 "WHERE id IN (SELECT id FROM urls WHERE last_visit_time > 0);"));
448 ignore_result(db_.Execute( 450 ignore_result(db_.Execute(
449 "UPDATE visits " 451 "UPDATE visits "
450 "SET visit_time = visit_time + 11644473600000000 " 452 "SET visit_time = visit_time + 11644473600000000, is_indexed = 0 "
451 "WHERE id IN (SELECT id FROM visits WHERE visit_time > 0);")); 453 "WHERE id IN (SELECT id FROM visits WHERE visit_time > 0);"));
452 ignore_result(db_.Execute( 454 ignore_result(db_.Execute(
453 "UPDATE segment_usage " 455 "UPDATE segment_usage "
454 "SET time_slot = time_slot + 11644473600000000 " 456 "SET time_slot = time_slot + 11644473600000000 "
455 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);")); 457 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);"));
456 458
457 // Erase all the full text index files. These will take a while to update and 459 // Erase all the full text index files. These will take a while to update and
458 // are less important, so we just blow them away. Same with the archived 460 // are less important, so we just blow them away. Same with the archived
459 // database. 461 // database.
460 needs_version_17_migration_ = true; 462 needs_version_17_migration_ = true;
461 } 463 }
462 #endif 464 #endif
463 465
464 } // namespace history 466 } // namespace history
OLDNEW
« no previous file with comments | « trunk/src/chrome/browser/history/history_backend_unittest.cc ('k') | trunk/src/chrome/browser/history/history_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698