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

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

Issue 833033002: Remove dependency on //content from history DownloadDatabase (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete #include Created 5 years, 11 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
« no previous file with comments | « chrome/browser/history/history_database.h ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/files/file_util.h" 12 #include "base/files/file_util.h"
13 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
14 #include "base/rand_util.h" 14 #include "base/rand_util.h"
15 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "components/history/content/browser/download_constants_utils.h"
18 #include "content/public/browser/download_interrupt_reasons.h"
17 #include "sql/transaction.h" 19 #include "sql/transaction.h"
18 20
19 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
20 #include "base/mac/mac_util.h" 22 #include "base/mac/mac_util.h"
21 #endif 23 #endif
22 24
23 namespace history { 25 namespace history {
24 26
25 namespace { 27 namespace {
26 28
27 // Current version number. We write databases at the "current" version number, 29 // Current version number. We write databases at the "current" version number,
28 // but any previous version that can read the "compatible" one can make do with 30 // but any previous version that can read the "compatible" one can make do with
29 // our database without *too* many bad effects. 31 // our database without *too* many bad effects.
30 const int kCurrentVersionNumber = 29; 32 const int kCurrentVersionNumber = 29;
31 const int kCompatibleVersionNumber = 16; 33 const int kCompatibleVersionNumber = 16;
32 const char kEarlyExpirationThresholdKey[] = "early_expiration_threshold"; 34 const char kEarlyExpirationThresholdKey[] = "early_expiration_threshold";
33 35
34 } // namespace 36 } // namespace
35 37
36 HistoryDatabase::HistoryDatabase() { 38 HistoryDatabase::HistoryDatabase()
39 : DownloadDatabase(ToHistoryDownloadInterruptReason(
40 content::DOWNLOAD_INTERRUPT_REASON_NONE),
41 ToHistoryDownloadInterruptReason(
42 content::DOWNLOAD_INTERRUPT_REASON_CRASH)) {
37 } 43 }
38 44
39 HistoryDatabase::~HistoryDatabase() { 45 HistoryDatabase::~HistoryDatabase() {
40 } 46 }
41 47
42 sql::InitStatus HistoryDatabase::Init(const base::FilePath& history_name) { 48 sql::InitStatus HistoryDatabase::Init(const base::FilePath& history_name) {
43 db_.set_histogram_tag("History"); 49 db_.set_histogram_tag("History");
44 50
45 // Set the exceptional sqlite error handler. 51 // Set the exceptional sqlite error handler.
46 db_.set_error_callback(error_callback_); 52 db_.set_error_callback(error_callback_);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 "SET visit_time = visit_time + 11644473600000000 " 457 "SET visit_time = visit_time + 11644473600000000 "
452 "WHERE id IN (SELECT id FROM visits WHERE visit_time > 0);")); 458 "WHERE id IN (SELECT id FROM visits WHERE visit_time > 0);"));
453 ignore_result(db_.Execute( 459 ignore_result(db_.Execute(
454 "UPDATE segment_usage " 460 "UPDATE segment_usage "
455 "SET time_slot = time_slot + 11644473600000000 " 461 "SET time_slot = time_slot + 11644473600000000 "
456 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);")); 462 "WHERE id IN (SELECT id FROM segment_usage WHERE time_slot > 0);"));
457 } 463 }
458 #endif 464 #endif
459 465
460 } // namespace history 466 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/history_database.h ('k') | chrome/browser/history/history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698