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 "chrome/browser/history/download_database.h" | 5 #include "chrome/browser/history/download_database.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/debug/alias.h" | 11 #include "base/debug/alias.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "chrome/browser/history/download_row.h" | 20 #include "chrome/browser/history/download_row.h" |
21 #include "chrome/browser/history/history_types.h" | 21 #include "components/history/core/browser/history_types.h" |
22 #include "content/public/browser/download_interrupt_reasons.h" | 22 #include "content/public/browser/download_interrupt_reasons.h" |
23 #include "content/public/browser/download_item.h" | 23 #include "content/public/browser/download_item.h" |
24 #include "sql/statement.h" | 24 #include "sql/statement.h" |
25 | 25 |
26 using content::DownloadItem; | 26 using content::DownloadItem; |
27 | 27 |
28 namespace history { | 28 namespace history { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 size_t DownloadDatabase::CountDownloads() { | 662 size_t DownloadDatabase::CountDownloads() { |
663 EnsureInProgressEntriesCleanedUp(); | 663 EnsureInProgressEntriesCleanedUp(); |
664 | 664 |
665 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, | 665 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, |
666 "SELECT count(*) from downloads")); | 666 "SELECT count(*) from downloads")); |
667 statement.Step(); | 667 statement.Step(); |
668 return statement.ColumnInt(0); | 668 return statement.ColumnInt(0); |
669 } | 669 } |
670 | 670 |
671 } // namespace history | 671 } // namespace history |
OLD | NEW |