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/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "chrome/browser/history/download_row.h" | 17 #include "chrome/browser/history/download_row.h" |
18 #include "content/public/browser/browser_thread.h" | |
19 #include "content/public/browser/download_item.h" | 18 #include "content/public/browser/download_item.h" |
20 #include "sql/statement.h" | 19 #include "sql/statement.h" |
21 | 20 |
22 using content::DownloadItem; | 21 using content::DownloadItem; |
23 | 22 |
24 namespace history { | 23 namespace history { |
25 | 24 |
26 // static | 25 // static |
27 const int64 DownloadDatabase::kUninitializedHandle = -1; | 26 const int64 DownloadDatabase::kUninitializedHandle = -1; |
28 | 27 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 263 } |
265 | 264 |
266 int DownloadDatabase::CountDownloads() { | 265 int DownloadDatabase::CountDownloads() { |
267 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, | 266 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE, |
268 "SELECT count(*) from downloads")); | 267 "SELECT count(*) from downloads")); |
269 statement.Step(); | 268 statement.Step(); |
270 return statement.ColumnInt(0); | 269 return statement.ColumnInt(0); |
271 } | 270 } |
272 | 271 |
273 } // namespace history | 272 } // namespace history |
OLD | NEW |