| 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 #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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 virtual sql::Connection& GetDB() = 0; | 62 virtual sql::Connection& GetDB() = 0; |
| 63 | 63 |
| 64 // Returns the meta-table object for the functions in this interface. | 64 // Returns the meta-table object for the functions in this interface. |
| 65 virtual sql::MetaTable& GetMetaTable() = 0; | 65 virtual sql::MetaTable& GetMetaTable() = 0; |
| 66 | 66 |
| 67 // Returns true if able to successfully rewrite the invalid values for the | 67 // Returns true if able to successfully rewrite the invalid values for the |
| 68 // |state| field from 3 to 4. Returns false if there was an error fixing the | 68 // |state| field from 3 to 4. Returns false if there was an error fixing the |
| 69 // database. See http://crbug.com/140687 | 69 // database. See http://crbug.com/140687 |
| 70 bool MigrateDownloadsState(); | 70 bool MigrateDownloadsState(); |
| 71 | 71 |
| 72 // Returns true if able to successfully add the last interrupt reason and the |
| 73 // two target paths to downloads. |
| 74 bool MigrateDownloadsReasonPathsAndDangerType(); |
| 75 |
| 72 // Creates the downloads table if needed. | 76 // Creates the downloads table if needed. |
| 73 bool InitDownloadTable(); | 77 bool InitDownloadTable(); |
| 74 | 78 |
| 75 // Used to quickly clear the downloads. First you would drop it, then you | 79 // Used to quickly clear the downloads. First you would drop it, then you |
| 76 // would re-initialize it. | 80 // would re-initialize it. |
| 77 bool DropDownloadTable(); | 81 bool DropDownloadTable(); |
| 78 | 82 |
| 79 private: | 83 private: |
| 80 bool EnsureColumnExists(const std::string& name, const std::string& type); | 84 bool EnsureColumnExists(const std::string& name, const std::string& type); |
| 81 | 85 |
| 82 bool owning_thread_set_; | 86 bool owning_thread_set_; |
| 83 base::PlatformThreadId owning_thread_; | 87 base::PlatformThreadId owning_thread_; |
| 84 | 88 |
| 85 int next_id_; | 89 int next_id_; |
| 86 int next_db_handle_; | 90 int next_db_handle_; |
| 87 | 91 |
| 88 DISALLOW_COPY_AND_ASSIGN(DownloadDatabase); | 92 DISALLOW_COPY_AND_ASSIGN(DownloadDatabase); |
| 89 }; | 93 }; |
| 90 | 94 |
| 91 } // namespace history | 95 } // namespace history |
| 92 | 96 |
| 93 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ | 97 #endif // CHROME_BROWSER_HISTORY_DOWNLOAD_DATABASE_H_ |
| OLD | NEW |