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