Chromium Code Reviews| Index: components/history/core/browser/download_database.h |
| diff --git a/components/history/core/browser/download_database.h b/components/history/core/browser/download_database.h |
| index 6388195eccf2b1b0f314fe86c21487ce10a6fd21..6f67d4aed6c1b673b3181127f6fd73fd03f31686 100644 |
| --- a/components/history/core/browser/download_database.h |
| +++ b/components/history/core/browser/download_database.h |
| @@ -14,6 +14,7 @@ |
| #include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| #include "base/threading/platform_thread.h" |
| +#include "components/history/core/browser/download_job_info.h" |
| #include "components/history/core/browser/download_types.h" |
| namespace sql { |
| @@ -27,6 +28,9 @@ struct DownloadRow; |
| // Maintains a table of downloads. |
| class DownloadDatabase { |
| public: |
| + // Check if Parallel downloading feature is enabled. |
| + static bool IsParallelDownloadingEnabled(); |
|
asanka
2017/02/02 19:06:28
Not needed.
qinmin
2017/02/02 22:31:32
Done. Removed
|
| + |
| // Must call InitDownloadTable before using any other functions. |
| DownloadDatabase(DownloadInterruptReason download_interrupt_reason_none, |
| DownloadInterruptReason download_interrupt_reason_crash); |
| @@ -113,6 +117,16 @@ class DownloadDatabase { |
| void RemoveDownloadURLs(uint32_t id); |
| + bool EnsureDownloadJobsTableExists(); |
| + |
| + // Updates the state of a download job. Returns true on success, or false |
| + // otherwise. If the job doesn't exist, a new job will be created. If |
| + // |is_new_download| is true, should always insert a new job into the db. |
| + bool UpdateDownloadJob(const DownloadJobInfo& info, bool is_new_download); |
| + |
| + // Delete all the download jobs associated with one DownloadRow. |
| + void RemoveDownloadJobs(uint32_t id); |
| + |
| bool owning_thread_set_; |
| base::PlatformThreadId owning_thread_; |