| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ |
| 6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ | 6 #define CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 // Create a new database entry for one download and return its primary db id. | 51 // Create a new database entry for one download and return its primary db id. |
| 52 int64 CreateDownload(const DownloadPersistentStoreInfo& info); | 52 int64 CreateDownload(const DownloadPersistentStoreInfo& info); |
| 53 | 53 |
| 54 // Remove a download from the database. | 54 // Remove a download from the database. |
| 55 void RemoveDownload(DownloadID db_handle); | 55 void RemoveDownload(DownloadID db_handle); |
| 56 | 56 |
| 57 // Remove all completed downloads that started after |remove_begin| | 57 // Remove all completed downloads that started after |remove_begin| |
| 58 // (inclusive) and before |remove_end|. You may use null Time values | 58 // (inclusive) and before |remove_end|. You may use null Time values |
| 59 // to do an unbounded delete in either direction. This function ignores | 59 // to do an unbounded delete in either direction. This function ignores |
| 60 // all downloads that are in progress or are waiting to be cancelled. | 60 // all downloads that are in progress or are waiting to be cancelled. |
| 61 void RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); | 61 bool RemoveDownloadsBetween(base::Time remove_begin, base::Time remove_end); |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 // Returns the database for the functions in this interface. | 64 // Returns the database for the functions in this interface. |
| 65 virtual sql::Connection& GetDB() = 0; | 65 virtual sql::Connection& GetDB() = 0; |
| 66 | 66 |
| 67 // Creates the downloads table if needed. | 67 // Creates the downloads table if needed. |
| 68 bool InitDownloadTable(); | 68 bool InitDownloadTable(); |
| 69 | 69 |
| 70 // Used to quickly clear the downloads. First you would drop it, then you | 70 // Used to quickly clear the downloads. First you would drop it, then you |
| 71 // would re-initialize it. | 71 // would re-initialize it. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 84 | 84 |
| 85 int next_id_; | 85 int next_id_; |
| 86 sql::MetaTable meta_table_; | 86 sql::MetaTable meta_table_; |
| 87 | 87 |
| 88 DISALLOW_COPY_AND_ASSIGN(DownloadDatabase); | 88 DISALLOW_COPY_AND_ASSIGN(DownloadDatabase); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace history | 91 } // namespace history |
| 92 | 92 |
| 93 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ | 93 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ |
| OLD | NEW |